简体   繁体   English

内存Linux中的漏洞是什么意思?

[英]What is meant by holes in the memory Linux?

I have come across a term - holes in the memory in Linux. 我遇到过一个术语 - Linux中的内存漏洞。 I believe this is the memory that is I/O remapped. 我相信这是重新映射I / O的内存。 Is my understanding correct? 我的理解是否正确?

Holes in memory can mean different things: 记忆中的洞可能意味着不同的东西:

1) It can refer to physical memory addressing: For historical and boot-strapping reasons, in the "standard PC" (x86) architecture, all of system RAM is not contiguous. 1)它可以指物理内存寻址:由于历史和引导捆绑的原因,在“标准PC”(x86)架构中,所有系统RAM都不是连续的。 There are "holes" in the address space where memory-mapped I/O resides. 地址空间中存在“漏洞”,其中存储器映射的I / O驻留在其中。 For example, from the earliest days, there has been an area reserved for boot ROM (BIOS) and video memory. 例如,从最早的日子开始,就存在为引导ROM(BIOS)和视频存储器保留的区域。 Also, there is a large area of the address space which is reserved for dynamic assignment to PCI (and PCI-X or PCI-Express) peripherals. 此外,存在大面积的地址空间,其被保留用于动态分配给PCI(和PCI-X或PCI-Express)外围设备。 These areas are often mapped as needed into kernel virtual address space by device drivers (which may be referred to as "I/O remapping"). 这些区域通常由设备驱动程序根据需要映射到内核虚拟地址空间(可以称为“I / O重映射”)。

Memory controllers built-in to the motherboard allow the physical address of the RAM to be configured (this is typically handled by the BIOS in the standard PC architecture). 内置于主板的内存控制器允许配置RAM的物理地址(这通常由标准PC架构中的BIOS处理)。 Other [non-x86] architectures often have similar holes in the physical address space. 其他[非x86]架构通常在物理地址空间中具有类似的漏洞。

2.) The term can also refer to unassigned regions in the virtual address space. 2.)该术语还可以指虚拟地址空间中的未分配区域。 Both kernel virtual address space and user processes' virtual address space typically have "holes" in them. 内核虚拟地址空间和用户进程的虚拟地址空间通常都有“漏洞”。 For example, linux doesn't map any physical memory corresponding to virtual address 0 (ie the first page of the address space never has valid memory) -- this allows null pointer references to be trapped. 例如,linux不映射与虚拟地址0对应的任何物理内存(即地址空间的第一页永远不会有有效内存) - 这允许捕获空指针引用。

In some kinds of memory allocations, the linux kernel maintains unmapped areas between properly allocated virtual memory regions in order to trap faulty memory references (ie that stray beyond the end of the allocated space). 在某些类型的内存分配中,linux内核在正确分配的虚拟内存区域之间维护未映射的区域,以便捕获错误的内存引用(即,在分配的空间的末尾之外的流浪)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM