aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/include/asm/e820.h2
-rw-r--r--arch/x86/kernel/e820.c5
-rw-r--r--arch/x86/kernel/setup.c19
3 files changed, 13 insertions, 13 deletions
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);
29extern int e820_search_gap(unsigned long *gapstart, unsigned long *gapsize, 29extern 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);
31struct setup_data; 31struct setup_data;
32extern void parse_e820_ext(struct setup_data *data); 32extern 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 */
661void __init parse_e820_ext(struct setup_data *sdata) 661void __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 56f7fcfe7fa2..91964c663f0d 100644
--- a/arch/x86/kernel/setup.c
+++ b/arch/x86/kernel/setup.c
@@ -426,25 +426,23 @@ static void __init reserve_initrd(void)
426static void __init parse_setup_data(void) 426static 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