Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=25eff8d4cd7400372d490c392519c5b0064c03f7
Commit:     25eff8d4cd7400372d490c392519c5b0064c03f7
Parent:     24e1c13c93cbdd05e4b7ea921c0050b036555adc
Author:     Yinghai Lu <[EMAIL PROTECTED]>
AuthorDate: Fri Feb 1 17:49:41 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Fri Feb 1 17:49:41 2008 +0100

    x86_64: add debug name for early_res
    
    helps debugging problems in this rather murky area of code.
    
    Signed-off-by: Yinghai Lu <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
---
 arch/x86/kernel/e820_64.c |   15 ++++++++++-----
 arch/x86/kernel/head64.c  |    6 +++---
 arch/x86/mm/init_64.c     |    2 +-
 arch/x86/mm/numa_64.c     |    2 +-
 include/asm-x86/e820_64.h |    2 +-
 5 files changed, 16 insertions(+), 11 deletions(-)

diff --git a/arch/x86/kernel/e820_64.c b/arch/x86/kernel/e820_64.c
index c617174..b74e83b 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;
 
 struct early_res {
        unsigned long start, end;
+       char name[16];
 };
 static struct early_res early_res[MAX_EARLY_RES] __initdata = {
-       { 0, PAGE_SIZE },                       /* BIOS data page */
+       { 0, PAGE_SIZE, "BIOS data page" },                     /* BIOS data 
page */
 #ifdef CONFIG_SMP
-       { SMP_TRAMPOLINE_BASE, SMP_TRAMPOLINE_BASE + 2*PAGE_SIZE },
+       { SMP_TRAMPOLINE_BASE, SMP_TRAMPOLINE_BASE + 2*PAGE_SIZE, 
"SMP_TRAMPOLINE" },
 #endif
        {}
 };
 
-void __init reserve_early(unsigned long start, unsigned long end)
+void __init reserve_early(unsigned long start, unsigned long end, char *name)
 {
        int i;
        struct early_res *r;
        for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) {
                r = &early_res[i];
                if (end > r->start && start < r->end)
-                       panic("Overlapping early reservations %lx-%lx to 
%lx-%lx\n",
-                             start, end, r->start, r->end);
+                       panic("Overlapping early reservations %lx-%lx %s to 
%lx-%lx %s\n",
+                             start, end - 1, name?name:"", r->start, r->end - 
1, r->name);
        }
        if (i >= MAX_EARLY_RES)
                panic("Too many early reservations");
        r = &early_res[i];
        r->start = start;
        r->end = end;
+       if (name)
+               strncpy(r->name, name, sizeof(r->name) - 1);
 }
 
 void __init early_res_to_bootmem(void)
@@ -85,6 +88,8 @@ void __init early_res_to_bootmem(void)
        int i;
        for (i = 0; i < MAX_EARLY_RES && early_res[i].end; i++) {
                struct early_res *r = &early_res[i];
+               printk(KERN_INFO "early res: %d [%lx-%lx] %s\n", i,
+                       r->start, r->end - 1, r->name);
                reserve_bootmem_generic(r->start, r->end - r->start);
        }
 }
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c
index a317336..24dbf56 100644
--- a/arch/x86/kernel/head64.c
+++ b/arch/x86/kernel/head64.c
@@ -75,7 +75,7 @@ static __init void reserve_ebda(void)
        if (ebda_size > 64*1024)
                ebda_size = 64*1024;
 
-       reserve_early(ebda_addr, ebda_addr + ebda_size);
+       reserve_early(ebda_addr, ebda_addr + ebda_size, "EBDA");
 }
 
 void __init x86_64_start_kernel(char * real_mode_data)
@@ -105,14 +105,14 @@ void __init x86_64_start_kernel(char * real_mode_data)
        pda_init(0);
        copy_bootdata(__va(real_mode_data));
 
-       reserve_early(__pa_symbol(&_text), __pa_symbol(&_end));
+       reserve_early(__pa_symbol(&_text), __pa_symbol(&_end), "TEXT DATA BSS");
 
        /* Reserve INITRD */
        if (boot_params.hdr.type_of_loader && boot_params.hdr.ramdisk_image) {
                unsigned long ramdisk_image = boot_params.hdr.ramdisk_image;
                unsigned long ramdisk_size  = boot_params.hdr.ramdisk_size;
                unsigned long ramdisk_end   = ramdisk_image + ramdisk_size;
-               reserve_early(ramdisk_image, ramdisk_end);
+               reserve_early(ramdisk_image, ramdisk_end, "RAMDISK");
        }
 
        reserve_ebda();
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index cc50a13..9a471be 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)
                mmu_cr4_features = read_cr4();
        __flush_tlb_all();
 
-       reserve_early(table_start << PAGE_SHIFT, table_end << PAGE_SHIFT);
+       reserve_early(table_start << PAGE_SHIFT, table_end << PAGE_SHIFT, 
"PGTABLE");
 }
 
 #ifndef CONFIG_NUMA
diff --git a/arch/x86/mm/numa_64.c b/arch/x86/mm/numa_64.c
index dc3b1f7..d339548 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)
        }
        pad_addr = (nodemap_addr + pad) & ~pad;
        memnodemap = phys_to_virt(pad_addr);
-       reserve_early(nodemap_addr, nodemap_addr + nodemap_size);
+       reserve_early(nodemap_addr, nodemap_addr + nodemap_size, "MEMNODEMAP");
 
        printk(KERN_DEBUG "NUMA: Allocated memnodemap from %lx - %lx\n",
               nodemap_addr, nodemap_addr + nodemap_size);
diff --git a/include/asm-x86/e820_64.h b/include/asm-x86/e820_64.h
index 51e4170..cc09469 100644
--- a/include/asm-x86/e820_64.h
+++ b/include/asm-x86/e820_64.h
@@ -41,7 +41,7 @@ extern void finish_e820_parsing(void);
 extern struct e820map e820;
 extern void update_e820(void);
 
-extern void reserve_early(unsigned long start, unsigned long end);
+extern void reserve_early(unsigned long start, unsigned long end, char *name);
 extern void early_res_to_bootmem(void);
 
 #endif/*!__ASSEMBLY__*/
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to