保留系统内存,ioremap()? [英] reserve system memory, ioremap()?
问题描述
在系统DRAM上调用ioremap()
是否很糟糕.我想在系统DRAM中保留一个不会被任何其他进程使用的空间.这会是这样做的方法吗?我知道DRAM实际上不是IO内存,所以我不确定这是否被认为是不好的做法.
Is it bad to call ioremap()
on system DRAM. I would like to reserve a space in system DRAM that will not be used by any other process. Would this be the way to do it? I know that DRAM is not actually IO memory so I wasn't sure if this was considered bad practice.
推荐答案
在系统DRAM上调用ioremap()很不好.
Is it bad to call ioremap() on system DRAM.
由内核管理的系统内存也不应使用 ioremap()重新映射.这些多个映射可能会导致某些体系结构/处理器上的数据损坏.有关ARM的此问题,请参考本文.
System memory that is managed by the kernel should not also be remapped using ioremap(). These multiple mappings can cause data corruption on some architectures/processors. Refer to this article on this issue for ARM.
您可以尝试通过在启动时从内核管理中排除有问题的内存区域来确保单个映射(使用 ioremap()).
在ARM上,使用ATAG(ATAG_MEM
标签)或设备树(memory
属性)指定减少的物理内存.
否则,请在内核命令行中使用 memmap = 内核参数:
You could try to ensure a single mapping (using ioremap()) by excluding the memory region in question at boot time from the kernel's management.
On ARM specify the reduced physical memory using ATAGs (the ATAG_MEM
tag(s)) or the Device Tree (the memory
property).
Otherwise use the memmap= kernel parameter in the kernel command line:
1835 memmap=nn[KMG]$ss[KMG]
1836 [KNL,ACPI] Mark specific memory as reserved.
1837 Region of memory to be reserved is from ss to ss+nn.
1838 Example: Exclude memory from 0x18690000-0x1869ffff
1839 memmap=64K$0x18690000
1840 or
1841 memmap=0x10000$0x18690000
还应通过 request_mem_region()声明内存区域,以防止多个请求并确保/proc/iomem 的完整性/准确性.
The memory region should also be declared through request_mem_region() to prevent multiple requests and for completeness/accuracy of /proc/iomem.
这篇关于保留系统内存,ioremap()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!