Commit 77ea8c94 authored by Dave Young's avatar Dave Young Committed by Matt Fleming

x86: Reserve setup_data ranges late after parsing memmap cmdline

Currently e820_reserve_setup_data() is called before parsing early
params, it works in normal case. But for memmap=exactmap, the final
memory ranges are created after parsing memmap= cmdline params, so the
previous e820_reserve_setup_data() has no effect. For example,
setup_data ranges will still be marked as normal system ram, thus when
later sysfs driver ioremap them kernel will warn about mapping normal
ram.

This patch fix it by moving the e820_reserve_setup_data() callback after
parsing early params so they can be set as reserved ranges and later
ioremap will be fine with it.
Signed-off-by: default avatarDave Young <dyoung@redhat.com>
Acked-by: default avatarBorislav Petkov <bp@suse.de>
Tested-by: default avatarToshi Kani <toshi.kani@hp.com>
Signed-off-by: default avatarMatt Fleming <matt.fleming@intel.com>
parent 5039e316
...@@ -927,8 +927,6 @@ void __init setup_arch(char **cmdline_p) ...@@ -927,8 +927,6 @@ void __init setup_arch(char **cmdline_p)
iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1; iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1;
setup_memory_map(); setup_memory_map();
parse_setup_data(); parse_setup_data();
/* update the e820_saved too */
e820_reserve_setup_data();
copy_edd(); copy_edd();
...@@ -990,6 +988,8 @@ void __init setup_arch(char **cmdline_p) ...@@ -990,6 +988,8 @@ void __init setup_arch(char **cmdline_p)
early_dump_pci_devices(); early_dump_pci_devices();
#endif #endif
/* update the e820_saved too */
e820_reserve_setup_data();
finish_e820_parsing(); finish_e820_parsing();
if (efi_enabled(EFI_BOOT)) if (efi_enabled(EFI_BOOT))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment