diff options
author | AKASHI Takahiro <takahiro.akashi@linaro.org> | 2016-08-22 02:55:24 -0400 |
---|---|---|
committer | Will Deacon <will.deacon@arm.com> | 2016-08-25 13:00:31 -0400 |
commit | e7cd190385d17790cc3eb3821b1094b00aacf325 (patch) | |
tree | e37c2a1592816f77a65078fb260aff10b07c7c40 /arch/arm64/kernel/setup.c | |
parent | 5ebe3a44cc744d11cb60d8438106a9322b7c04dc (diff) |
arm64: mark reserved memblock regions explicitly in iomem
Kdump(kexec-tools) parses /proc/iomem to identify all the memory regions
on the system. Since the current kernel names "nomap" regions, like UEFI
runtime services code/data, as "System RAM," kexec-tools sets up elf core
header to include them in a crash dump file (/proc/vmcore).
Then crash dump kernel parses UEFI memory map again, re-marks those regions
as "nomap" and does not create a memory mapping for them unlike the other
areas of System RAM. In this case, copying /proc/vmcore through
copy_oldmem_page() on crash dump kernel will end up with a kernel abort,
as reported in [1].
This patch names all the "nomap" regions explicitly as "reserved" so that
we can exclude them from a crash dump file. acpi_os_ioremap() must also
be modified because those regions have WB attributes [2].
Apart from kdump, this change also matches x86's use of acpi (and
/proc/iomem).
[1] http://lists.infradead.org/pipermail/linux-arm-kernel/2016-August/448186.html
[2] http://lists.infradead.org/pipermail/linux-arm-kernel/2016-August/450089.html
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: James Morse <james.morse@arm.com>
Reviewed-by: James Morse <james.morse@arm.com>
Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'arch/arm64/kernel/setup.c')
-rw-r--r-- | arch/arm64/kernel/setup.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index 536dce22fe76..514b4e3ba029 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c | |||
@@ -206,10 +206,15 @@ static void __init request_standard_resources(void) | |||
206 | 206 | ||
207 | for_each_memblock(memory, region) { | 207 | for_each_memblock(memory, region) { |
208 | res = alloc_bootmem_low(sizeof(*res)); | 208 | res = alloc_bootmem_low(sizeof(*res)); |
209 | res->name = "System RAM"; | 209 | if (memblock_is_nomap(region)) { |
210 | res->name = "reserved"; | ||
211 | res->flags = IORESOURCE_MEM | IORESOURCE_BUSY; | ||
212 | } else { | ||
213 | res->name = "System RAM"; | ||
214 | res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; | ||
215 | } | ||
210 | res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); | 216 | res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); |
211 | res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1; | 217 | res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1; |
212 | res->flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; | ||
213 | 218 | ||
214 | request_resource(&iomem_resource, res); | 219 | request_resource(&iomem_resource, res); |
215 | 220 | ||