diff options
author | Yinghai Lu <Yinghai.Lu@Sun.COM> | 2008-02-01 11:49:41 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-02-01 11:49:41 -0500 |
commit | 25eff8d4cd7400372d490c392519c5b0064c03f7 (patch) | |
tree | 1d07ccfab1f58898dee245d48e7cca3c061b73cc /arch | |
parent | 24e1c13c93cbdd05e4b7ea921c0050b036555adc (diff) |
x86_64: add debug name for early_res
helps debugging problems in this rather murky area of code.
Signed-off-by: Yinghai Lu <yinghai.lu@sun.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/e820_64.c | 15 | ||||
-rw-r--r-- | arch/x86/kernel/head64.c | 6 | ||||
-rw-r--r-- | arch/x86/mm/init_64.c | 2 | ||||
-rw-r--r-- | arch/x86/mm/numa_64.c | 2 |
4 files changed, 15 insertions, 10 deletions
diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c index c617174e8963..b74e83b214cc 100644 --- a/arch/x86/kernel/e820_64.c +++ b/arch/x86/kernel/e820_64.c | |||
@@ -54,30 +54,33 @@ static unsigned long __initdata end_user_pfn = MAXMEM>>PAGE_SHIFT; | |||
54 | 54 | ||
55 | struct early_res { | 55 | struct early_res { |
56 | unsigned long start, end; | 56 | unsigned long start, end; |
57 | char name[16]; | ||
57 | }; | 58 | }; |
58 | static struct early_res early_res[MAX_EARLY_RES] __initdata = { | 59 | static struct early_res early_res[MAX_EARLY_RES] __initdata = { |
59 | { 0, PAGE_SIZE }, /* BIOS data page */ | 60 | { 0, PAGE_SIZE, "BIOS data page" }, /* BIOS data page */ |
60 | #ifdef CONFIG_SMP | 61 | #ifdef CONFIG_SMP |
61 | { SMP_TRAMPOLINE_BASE, SMP_TRAMPOLINE_BASE + 2*PAGE_SIZE }, | 62 | { SMP_TRAMPOLINE_BASE, SMP_TRAMPOLINE_BASE + 2*PAGE_SIZE, "SMP_TRAMPOLINE" }, |
62 | #endif | 63 | #endif |
63 | {} | 64 | {} |
64 | }; | 65 | }; |
65 | 66 | ||
66 | void __init reserve_early(unsigned long start, unsigned long end) | 67 | void __init reserve_early(unsigned long start, unsigned long end, char *name) |
67 | { | 68 | { |
68 | int i; | 69 | int i; |
69 | struct early_res *r; | 70 | struct early_res *r; |
70 | for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) { | 71 | for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) { |
71 | r = &early_res[i]; | 72 | r = &early_res[i]; |
72 | if (end > r->start && start < r->end) | 73 | if (end > r->start && start < r->end) |
73 | panic("Overlapping early reservations %lx-%lx to %lx-%lx\n", | 74 | panic("Overlapping early reservations %lx-%lx %s to %lx-%lx %s\n", |
74 | start, end, r->start, r->end); | 75 | start, end - 1, name?name:"", r->start, r->end - 1, r->name); |
75 | } | 76 | } |
76 | if (i >= MAX_EARLY_RES) | 77 | if (i >= MAX_EARLY_RES) |
77 | panic("Too many early reservations"); | 78 | panic("Too many early reservations"); |
78 | r = &early_res[i]; | 79 | r = &early_res[i]; |
79 | r->start = start; | 80 | r->start = start; |
80 | r->end = end; | 81 | r->end = end; |
82 | if (name) | ||
83 | strncpy(r->name, name, sizeof(r->name) - 1); | ||
81 | } | 84 | } |
82 | 85 | ||
83 | void __init early_res_to_bootmem(void) | 86 | void __init early_res_to_bootmem(void) |
@@ -85,6 +88,8 @@ void __init early_res_to_bootmem(void) | |||
85 | int i; | 88 | int i; |
86 | for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) { | 89 | for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) { |
87 | struct early_res *r = &early_res[i]; | 90 | struct early_res *r = &early_res[i]; |
91 | printk(KERN_INFO "early res: %d [%lx-%lx] %s\n", i, | ||
92 | r->start, r->end - 1, r->name); | ||
88 | reserve_bootmem_generic(r->start, r->end - r->start); | 93 | reserve_bootmem_generic(r->start, r->end - r->start); |
89 | } | 94 | } |
90 | } | 95 | } |
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index a317336cdeaa..24dbf56928d7 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c | |||
@@ -75,7 +75,7 @@ static __init void reserve_ebda(void) | |||
75 | if (ebda_size > 64*1024) | 75 | if (ebda_size > 64*1024) |
76 | ebda_size = 64*1024; | 76 | ebda_size = 64*1024; |
77 | 77 | ||
78 | reserve_early(ebda_addr, ebda_addr + ebda_size); | 78 | reserve_early(ebda_addr, ebda_addr + ebda_size, "EBDA"); |
79 | } | 79 | } |
80 | 80 | ||
81 | void __init x86_64_start_kernel(char * real_mode_data) | 81 | void __init x86_64_start_kernel(char * real_mode_data) |
@@ -105,14 +105,14 @@ void __init x86_64_start_kernel(char * real_mode_data) | |||
105 | pda_init(0); | 105 | pda_init(0); |
106 | copy_bootdata(__va(real_mode_data)); | 106 | copy_bootdata(__va(real_mode_data)); |
107 | 107 | ||
108 | reserve_early(__pa_symbol(&_text), __pa_symbol(&_end)); | 108 | reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS"); |
109 | 109 | ||
110 | /* Reserve INITRD */ | 110 | /* Reserve INITRD */ |
111 | if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) { | 111 | if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) { |
112 | unsigned long ramdisk_image = boot_params.hdr.ramdisk_image; | 112 | unsigned long ramdisk_image = boot_params.hdr.ramdisk_image; |
113 | unsigned long ramdisk_size = boot_params.hdr.ramdisk_size; | 113 | unsigned long ramdisk_size = boot_params.hdr.ramdisk_size; |
114 | unsigned long ramdisk_end = ramdisk_image + ramdisk_size; | 114 | unsigned long ramdisk_end = ramdisk_image + ramdisk_size; |
115 | reserve_early(ramdisk_image, ramdisk_end); | 115 | reserve_early(ramdisk_image, ramdisk_end, "RAMDISK"); |
116 | } | 116 | } |
117 | 117 | ||
118 | reserve_ebda(); | 118 | reserve_ebda(); |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index cc50a13ce8d9..9a471be4f5f1 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -420,7 +420,7 @@ void __init_refok init_memory_mapping(unsigned long start, unsigned long end) | |||
420 | mmu_cr4_features = read_cr4(); | 420 | mmu_cr4_features = read_cr4(); |
421 | __flush_tlb_all(); | 421 | __flush_tlb_all(); |
422 | 422 | ||
423 | reserve_early(table_start << PAGE_SHIFT, table_end << PAGE_SHIFT); | 423 | reserve_early(table_start << PAGE_SHIFT, table_end << PAGE_SHIFT, "PGTABLE"); |
424 | } | 424 | } |
425 | 425 | ||
426 | #ifndef CONFIG_NUMA | 426 | #ifndef CONFIG_NUMA |
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c index dc3b1f7e1451..d33954866085 100644 --- a/arch/x86/mm/numa_64.c +++ b/arch/x86/mm/numa_64.c | |||
@@ -103,7 +103,7 @@ static int __init allocate_cachealigned_memnodemap(void) | |||
103 | } | 103 | } |
104 | pad_addr = (nodemap_addr + pad) & ~pad; | 104 | pad_addr = (nodemap_addr + pad) & ~pad; |
105 | memnodemap = phys_to_virt(pad_addr); | 105 | memnodemap = phys_to_virt(pad_addr); |
106 | reserve_early(nodemap_addr, nodemap_addr + nodemap_size); | 106 | reserve_early(nodemap_addr, nodemap_addr + nodemap_size, "MEMNODEMAP"); |
107 | 107 | ||
108 | printk(KERN_DEBUG "NUMA: Allocated memnodemap from %lx - %lx\n", | 108 | printk(KERN_DEBUG "NUMA: Allocated memnodemap from %lx - %lx\n", |
109 | nodemap_addr, nodemap_addr + nodemap_size); | 109 | nodemap_addr, nodemap_addr + nodemap_size); |