diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-04 12:39:26 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-04 12:39:26 -0400 |
| commit | cb3e4330e697dffaf3d9cefebc9c7e7d39c89f2e (patch) | |
| tree | f5c425230cfce61ddcea0f6c508e345737766022 | |
| parent | aafcd5d75797ac423f6a03ce1f801933d4b114dc (diff) | |
| parent | 30e46b574a1db7d14404e52dca8e1aa5f5155fd2 (diff) | |
Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 mm changes from Ingo Molnar:
"Misc smaller fixes:
- a parse_setup_data() boot crash fix
- a memblock and an __early_ioremap cleanup
- turn the always-on CONFIG_ARCH_MEMORY_PROBE=y into a configurable
option and turn it off - it's an unrobust debug facility, it
shouldn't be enabled by default"
* 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86: avoid remapping data in parse_setup_data()
x86: Use memblock_set_current_limit() to set limit for memblock.
mm: Remove unused variable idx0 in __early_ioremap()
mm/hotplug, x86: Disable ARCH_MEMORY_PROBE by default
| -rw-r--r-- | Documentation/memory-hotplug.txt | 16 | ||||
| -rw-r--r-- | arch/x86/Kconfig | 6 | ||||
| -rw-r--r-- | arch/x86/include/asm/e820.h | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/e820.c | 5 | ||||
| -rw-r--r-- | arch/x86/kernel/setup.c | 23 | ||||
| -rw-r--r-- | arch/x86/mm/ioremap.c | 5 |
6 files changed, 31 insertions, 26 deletions
diff --git a/Documentation/memory-hotplug.txt b/Documentation/memory-hotplug.txt index 8e5eacbdcfa3..8fd254c73589 100644 --- a/Documentation/memory-hotplug.txt +++ b/Documentation/memory-hotplug.txt | |||
| @@ -210,13 +210,15 @@ If memory device is found, memory hotplug code will be called. | |||
| 210 | 210 | ||
| 211 | 4.2 Notify memory hot-add event by hand | 211 | 4.2 Notify memory hot-add event by hand |
| 212 | ------------ | 212 | ------------ |
| 213 | In some environments, especially virtualized environment, firmware will not | 213 | On powerpc, the firmware does not notify a memory hotplug event to the kernel. |
| 214 | notify memory hotplug event to the kernel. For such environment, "probe" | 214 | Therefore, "probe" interface is supported to notify the event to the kernel. |
| 215 | interface is supported. This interface depends on CONFIG_ARCH_MEMORY_PROBE. | 215 | This interface depends on CONFIG_ARCH_MEMORY_PROBE. |
| 216 | 216 | ||
| 217 | Now, CONFIG_ARCH_MEMORY_PROBE is supported only by powerpc but it does not | 217 | CONFIG_ARCH_MEMORY_PROBE is supported on powerpc only. On x86, this config |
| 218 | contain highly architecture codes. Please add config if you need "probe" | 218 | option is disabled by default since ACPI notifies a memory hotplug event to |
| 219 | interface. | 219 | the kernel, which performs its hotplug operation as the result. Please |
| 220 | enable this option if you need the "probe" interface for testing purposes | ||
| 221 | on x86. | ||
| 220 | 222 | ||
| 221 | Probe interface is located at | 223 | Probe interface is located at |
| 222 | /sys/devices/system/memory/probe | 224 | /sys/devices/system/memory/probe |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index b710efdec9a0..30322b0427d1 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -1344,8 +1344,12 @@ config ARCH_SELECT_MEMORY_MODEL | |||
| 1344 | depends on ARCH_SPARSEMEM_ENABLE | 1344 | depends on ARCH_SPARSEMEM_ENABLE |
| 1345 | 1345 | ||
| 1346 | config ARCH_MEMORY_PROBE | 1346 | config ARCH_MEMORY_PROBE |
| 1347 | def_bool y | 1347 | bool "Enable sysfs memory/probe interface" |
| 1348 | depends on X86_64 && MEMORY_HOTPLUG | 1348 | depends on X86_64 && MEMORY_HOTPLUG |
| 1349 | help | ||
| 1350 | This option enables a sysfs memory/probe interface for testing. | ||
| 1351 | See Documentation/memory-hotplug.txt for more information. | ||
| 1352 | If you are unsure how to answer this question, answer N. | ||
| 1349 | 1353 | ||
| 1350 | config ARCH_PROC_KCORE_TEXT | 1354 | config ARCH_PROC_KCORE_TEXT |
| 1351 | def_bool y | 1355 | def_bool y |
diff --git a/arch/x86/include/asm/e820.h b/arch/x86/include/asm/e820.h index cccd07fa5e3a..779c2efe2e97 100644 --- a/arch/x86/include/asm/e820.h +++ b/arch/x86/include/asm/e820.h | |||
| @@ -29,7 +29,7 @@ extern void e820_setup_gap(void); | |||
| 29 | extern int e820_search_gap(unsigned long *gapstart, unsigned long *gapsize, | 29 | extern int e820_search_gap(unsigned long *gapstart, unsigned long *gapsize, |
| 30 | unsigned long start_addr, unsigned long long end_addr); | 30 | unsigned long start_addr, unsigned long long end_addr); |
| 31 | struct setup_data; | 31 | struct setup_data; |
| 32 | extern void parse_e820_ext(struct setup_data *data); | 32 | extern void parse_e820_ext(u64 phys_addr, u32 data_len); |
| 33 | 33 | ||
| 34 | #if defined(CONFIG_X86_64) || \ | 34 | #if defined(CONFIG_X86_64) || \ |
| 35 | (defined(CONFIG_X86_32) && defined(CONFIG_HIBERNATION)) | 35 | (defined(CONFIG_X86_32) && defined(CONFIG_HIBERNATION)) |
diff --git a/arch/x86/kernel/e820.c b/arch/x86/kernel/e820.c index d32abeabbda5..174da5fc5a7b 100644 --- a/arch/x86/kernel/e820.c +++ b/arch/x86/kernel/e820.c | |||
| @@ -658,15 +658,18 @@ __init void e820_setup_gap(void) | |||
| 658 | * boot_params.e820_map, others are passed via SETUP_E820_EXT node of | 658 | * boot_params.e820_map, others are passed via SETUP_E820_EXT node of |
| 659 | * linked list of struct setup_data, which is parsed here. | 659 | * linked list of struct setup_data, which is parsed here. |
| 660 | */ | 660 | */ |
| 661 | void __init parse_e820_ext(struct setup_data *sdata) | 661 | void __init parse_e820_ext(u64 phys_addr, u32 data_len) |
| 662 | { | 662 | { |
| 663 | int entries; | 663 | int entries; |
| 664 | struct e820entry *extmap; | 664 | struct e820entry *extmap; |
| 665 | struct setup_data *sdata; | ||
| 665 | 666 | ||
| 667 | sdata = early_memremap(phys_addr, data_len); | ||
| 666 | entries = sdata->len / sizeof(struct e820entry); | 668 | entries = sdata->len / sizeof(struct e820entry); |
| 667 | extmap = (struct e820entry *)(sdata->data); | 669 | extmap = (struct e820entry *)(sdata->data); |
| 668 | __append_e820_map(extmap, entries); | 670 | __append_e820_map(extmap, entries); |
| 669 | sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); | 671 | sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); |
| 672 | early_iounmap(sdata, data_len); | ||
| 670 | printk(KERN_INFO "e820: extended physical RAM map:\n"); | 673 | printk(KERN_INFO "e820: extended physical RAM map:\n"); |
| 671 | e820_print_map("extended"); | 674 | e820_print_map("extended"); |
| 672 | } | 675 | } |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index dfa55afccf5e..f0de6294b955 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
| @@ -426,25 +426,23 @@ static void __init reserve_initrd(void) | |||
| 426 | static void __init parse_setup_data(void) | 426 | static void __init parse_setup_data(void) |
| 427 | { | 427 | { |
| 428 | struct setup_data *data; | 428 | struct setup_data *data; |
| 429 | u64 pa_data; | 429 | u64 pa_data, pa_next; |
| 430 | 430 | ||
| 431 | pa_data = boot_params.hdr.setup_data; | 431 | pa_data = boot_params.hdr.setup_data; |
| 432 | while (pa_data) { | 432 | while (pa_data) { |
| 433 | u32 data_len, map_len; | 433 | u32 data_len, map_len, data_type; |
| 434 | 434 | ||
| 435 | map_len = max(PAGE_SIZE - (pa_data & ~PAGE_MASK), | 435 | map_len = max(PAGE_SIZE - (pa_data & ~PAGE_MASK), |
| 436 | (u64)sizeof(struct setup_data)); | 436 | (u64)sizeof(struct setup_data)); |
| 437 | data = early_memremap(pa_data, map_len); | 437 | data = early_memremap(pa_data, map_len); |
| 438 | data_len = data->len + sizeof(struct setup_data); | 438 | data_len = data->len + sizeof(struct setup_data); |
| 439 | if (data_len > map_len) { | 439 | data_type = data->type; |
| 440 | early_iounmap(data, map_len); | 440 | pa_next = data->next; |
| 441 | data = early_memremap(pa_data, data_len); | 441 | early_iounmap(data, map_len); |
| 442 | map_len = data_len; | ||
| 443 | } | ||
| 444 | 442 | ||
| 445 | switch (data->type) { | 443 | switch (data_type) { |
| 446 | case SETUP_E820_EXT: | 444 | case SETUP_E820_EXT: |
| 447 | parse_e820_ext(data); | 445 | parse_e820_ext(pa_data, data_len); |
| 448 | break; | 446 | break; |
| 449 | case SETUP_DTB: | 447 | case SETUP_DTB: |
| 450 | add_dtb(pa_data); | 448 | add_dtb(pa_data); |
| @@ -452,8 +450,7 @@ static void __init parse_setup_data(void) | |||
| 452 | default: | 450 | default: |
| 453 | break; | 451 | break; |
| 454 | } | 452 | } |
| 455 | pa_data = data->next; | 453 | pa_data = pa_next; |
| 456 | early_iounmap(data, map_len); | ||
| 457 | } | 454 | } |
| 458 | } | 455 | } |
| 459 | 456 | ||
| @@ -1070,7 +1067,7 @@ void __init setup_arch(char **cmdline_p) | |||
| 1070 | 1067 | ||
| 1071 | cleanup_highmap(); | 1068 | cleanup_highmap(); |
| 1072 | 1069 | ||
| 1073 | memblock.current_limit = ISA_END_ADDRESS; | 1070 | memblock_set_current_limit(ISA_END_ADDRESS); |
| 1074 | memblock_x86_fill(); | 1071 | memblock_x86_fill(); |
| 1075 | 1072 | ||
| 1076 | /* | 1073 | /* |
| @@ -1103,7 +1100,7 @@ void __init setup_arch(char **cmdline_p) | |||
| 1103 | 1100 | ||
| 1104 | setup_real_mode(); | 1101 | setup_real_mode(); |
| 1105 | 1102 | ||
| 1106 | memblock.current_limit = get_max_mapped(); | 1103 | memblock_set_current_limit(get_max_mapped()); |
| 1107 | dma_contiguous_reserve(0); | 1104 | dma_contiguous_reserve(0); |
| 1108 | 1105 | ||
| 1109 | /* | 1106 | /* |
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 0215e2c563ef..799580cabc78 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
| @@ -487,7 +487,7 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot) | |||
| 487 | unsigned long offset; | 487 | unsigned long offset; |
| 488 | resource_size_t last_addr; | 488 | resource_size_t last_addr; |
| 489 | unsigned int nrpages; | 489 | unsigned int nrpages; |
| 490 | enum fixed_addresses idx0, idx; | 490 | enum fixed_addresses idx; |
| 491 | int i, slot; | 491 | int i, slot; |
| 492 | 492 | ||
| 493 | WARN_ON(system_state != SYSTEM_BOOTING); | 493 | WARN_ON(system_state != SYSTEM_BOOTING); |
| @@ -540,8 +540,7 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot) | |||
| 540 | /* | 540 | /* |
| 541 | * Ok, go for it.. | 541 | * Ok, go for it.. |
| 542 | */ | 542 | */ |
| 543 | idx0 = FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*slot; | 543 | idx = FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*slot; |
| 544 | idx = idx0; | ||
| 545 | while (nrpages > 0) { | 544 | while (nrpages > 0) { |
| 546 | early_set_fixmap(idx, phys_addr, prot); | 545 | early_set_fixmap(idx, phys_addr, prot); |
| 547 | phys_addr += PAGE_SIZE; | 546 | phys_addr += PAGE_SIZE; |
