Skip to content

Commit 77ea8c9

Browse files
daveyoungMatt Fleming
authored andcommitted
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: Dave Young <[email protected]> Acked-by: Borislav Petkov <[email protected]> Tested-by: Toshi Kani <[email protected]> Signed-off-by: Matt Fleming <[email protected]>
1 parent 5039e31 commit 77ea8c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kernel/setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -927,8 +927,6 @@ void __init setup_arch(char **cmdline_p)
927927
iomem_resource.end = (1ULL << boot_cpu_data.x86_phys_bits) - 1;
928928
setup_memory_map();
929929
parse_setup_data();
930-
/* update the e820_saved too */
931-
e820_reserve_setup_data();
932930

933931
copy_edd();
934932

@@ -990,6 +988,8 @@ void __init setup_arch(char **cmdline_p)
990988
early_dump_pci_devices();
991989
#endif
992990

991+
/* update the e820_saved too */
992+
e820_reserve_setup_data();
993993
finish_e820_parsing();
994994

995995
if (efi_enabled(EFI_BOOT))

0 commit comments

Comments
 (0)