Commit cb3e4330 authored by Linus Torvalds's avatar Linus Torvalds

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
parents aafcd5d7 30e46b57
...@@ -210,13 +210,15 @@ If memory device is found, memory hotplug code will be called. ...@@ -210,13 +210,15 @@ If memory device is found, memory hotplug code will be called.
4.2 Notify memory hot-add event by hand 4.2 Notify memory hot-add event by hand
------------ ------------
In some environments, especially virtualized environment, firmware will not On powerpc, the firmware does not notify a memory hotplug event to the kernel.
notify memory hotplug event to the kernel. For such environment, "probe" Therefore, "probe" interface is supported to notify the event to the kernel.
interface is supported. This interface depends on CONFIG_ARCH_MEMORY_PROBE. This interface depends on CONFIG_ARCH_MEMORY_PROBE.
Now, CONFIG_ARCH_MEMORY_PROBE is supported only by powerpc but it does not CONFIG_ARCH_MEMORY_PROBE is supported on powerpc only. On x86, this config
contain highly architecture codes. Please add config if you need "probe" option is disabled by default since ACPI notifies a memory hotplug event to
interface. the kernel, which performs its hotplug operation as the result. Please
enable this option if you need the "probe" interface for testing purposes
on x86.
Probe interface is located at Probe interface is located at
/sys/devices/system/memory/probe /sys/devices/system/memory/probe
......
...@@ -1344,8 +1344,12 @@ config ARCH_SELECT_MEMORY_MODEL ...@@ -1344,8 +1344,12 @@ config ARCH_SELECT_MEMORY_MODEL
depends on ARCH_SPARSEMEM_ENABLE depends on ARCH_SPARSEMEM_ENABLE
config ARCH_MEMORY_PROBE config ARCH_MEMORY_PROBE
def_bool y bool "Enable sysfs memory/probe interface"
depends on X86_64 && MEMORY_HOTPLUG depends on X86_64 && MEMORY_HOTPLUG
help
This option enables a sysfs memory/probe interface for testing.
See Documentation/memory-hotplug.txt for more information.
If you are unsure how to answer this question, answer N.
config ARCH_PROC_KCORE_TEXT config ARCH_PROC_KCORE_TEXT
def_bool y def_bool y
......
...@@ -29,7 +29,7 @@ extern void e820_setup_gap(void); ...@@ -29,7 +29,7 @@ extern void e820_setup_gap(void);
extern int e820_search_gap(unsigned long *gapstart, unsigned long *gapsize, extern int e820_search_gap(unsigned long *gapstart, unsigned long *gapsize,
unsigned long start_addr, unsigned long long end_addr); unsigned long start_addr, unsigned long long end_addr);
struct setup_data; struct setup_data;
extern void parse_e820_ext(struct setup_data *data); extern void parse_e820_ext(u64 phys_addr, u32 data_len);
#if defined(CONFIG_X86_64) || \ #if defined(CONFIG_X86_64) || \
(defined(CONFIG_X86_32) && defined(CONFIG_HIBERNATION)) (defined(CONFIG_X86_32) && defined(CONFIG_HIBERNATION))
......
...@@ -658,15 +658,18 @@ __init void e820_setup_gap(void) ...@@ -658,15 +658,18 @@ __init void e820_setup_gap(void)
* boot_params.e820_map, others are passed via SETUP_E820_EXT node of * boot_params.e820_map, others are passed via SETUP_E820_EXT node of
* linked list of struct setup_data, which is parsed here. * linked list of struct setup_data, which is parsed here.
*/ */
void __init parse_e820_ext(struct setup_data *sdata) void __init parse_e820_ext(u64 phys_addr, u32 data_len)
{ {
int entries; int entries;
struct e820entry *extmap; struct e820entry *extmap;
struct setup_data *sdata;
sdata = early_memremap(phys_addr, data_len);
entries = sdata->len / sizeof(struct e820entry); entries = sdata->len / sizeof(struct e820entry);
extmap = (struct e820entry *)(sdata->data); extmap = (struct e820entry *)(sdata->data);
__append_e820_map(extmap, entries); __append_e820_map(extmap, entries);
sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map); sanitize_e820_map(e820.map, ARRAY_SIZE(e820.map), &e820.nr_map);
early_iounmap(sdata, data_len);
printk(KERN_INFO "e820: extended physical RAM map:\n"); printk(KERN_INFO "e820: extended physical RAM map:\n");
e820_print_map("extended"); e820_print_map("extended");
} }
......
...@@ -426,25 +426,23 @@ static void __init reserve_initrd(void) ...@@ -426,25 +426,23 @@ static void __init reserve_initrd(void)
static void __init parse_setup_data(void) static void __init parse_setup_data(void)
{ {
struct setup_data *data; struct setup_data *data;
u64 pa_data; u64 pa_data, pa_next;
pa_data = boot_params.hdr.setup_data; pa_data = boot_params.hdr.setup_data;
while (pa_data) { while (pa_data) {
u32 data_len, map_len; u32 data_len, map_len, data_type;
map_len = max(PAGE_SIZE - (pa_data & ~PAGE_MASK), map_len = max(PAGE_SIZE - (pa_data & ~PAGE_MASK),
(u64)sizeof(struct setup_data)); (u64)sizeof(struct setup_data));
data = early_memremap(pa_data, map_len); data = early_memremap(pa_data, map_len);
data_len = data->len + sizeof(struct setup_data); data_len = data->len + sizeof(struct setup_data);
if (data_len > map_len) { data_type = data->type;
early_iounmap(data, map_len); pa_next = data->next;
data = early_memremap(pa_data, data_len); early_iounmap(data, map_len);
map_len = data_len;
}
switch (data->type) { switch (data_type) {
case SETUP_E820_EXT: case SETUP_E820_EXT:
parse_e820_ext(data); parse_e820_ext(pa_data, data_len);
break; break;
case SETUP_DTB: case SETUP_DTB:
add_dtb(pa_data); add_dtb(pa_data);
...@@ -452,8 +450,7 @@ static void __init parse_setup_data(void) ...@@ -452,8 +450,7 @@ static void __init parse_setup_data(void)
default: default:
break; break;
} }
pa_data = data->next; pa_data = pa_next;
early_iounmap(data, map_len);
} }
} }
...@@ -1070,7 +1067,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -1070,7 +1067,7 @@ void __init setup_arch(char **cmdline_p)
cleanup_highmap(); cleanup_highmap();
memblock.current_limit = ISA_END_ADDRESS; memblock_set_current_limit(ISA_END_ADDRESS);
memblock_x86_fill(); memblock_x86_fill();
/* /*
...@@ -1103,7 +1100,7 @@ void __init setup_arch(char **cmdline_p) ...@@ -1103,7 +1100,7 @@ void __init setup_arch(char **cmdline_p)
setup_real_mode(); setup_real_mode();
memblock.current_limit = get_max_mapped(); memblock_set_current_limit(get_max_mapped());
dma_contiguous_reserve(0); dma_contiguous_reserve(0);
/* /*
......
...@@ -487,7 +487,7 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot) ...@@ -487,7 +487,7 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
unsigned long offset; unsigned long offset;
resource_size_t last_addr; resource_size_t last_addr;
unsigned int nrpages; unsigned int nrpages;
enum fixed_addresses idx0, idx; enum fixed_addresses idx;
int i, slot; int i, slot;
WARN_ON(system_state != SYSTEM_BOOTING); WARN_ON(system_state != SYSTEM_BOOTING);
...@@ -540,8 +540,7 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot) ...@@ -540,8 +540,7 @@ __early_ioremap(resource_size_t phys_addr, unsigned long size, pgprot_t prot)
/* /*
* Ok, go for it.. * Ok, go for it..
*/ */
idx0 = FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*slot; idx = FIX_BTMAP_BEGIN - NR_FIX_BTMAPS*slot;
idx = idx0;
while (nrpages > 0) { while (nrpages > 0) {
early_set_fixmap(idx, phys_addr, prot); early_set_fixmap(idx, phys_addr, prot);
phys_addr += PAGE_SIZE; phys_addr += PAGE_SIZE;
......
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