ia64/xen-unstable

changeset 3880:a42fd001d8f5

bitkeeper revision 1.1233 (421a1c36TYJWUEtp558QjJv1X0XXrQ)

If debugging is enabled, printout the e820 map for vmx guests.

Signed-off-by: michael.fetterman@cl.cam.ac.uk
author maf46@burn.cl.cam.ac.uk
date Mon Feb 21 17:36:54 2005 +0000 (2005-02-21)
parents d8180577bbb5
children bedb2b313393
files xen/arch/x86/e820.c xen/arch/x86/vmx_vmcs.c xen/include/asm-x86/e820.h
line diff
     1.1 --- a/xen/arch/x86/e820.c	Mon Feb 21 17:31:22 2005 +0000
     1.2 +++ b/xen/arch/x86/e820.c	Mon Feb 21 17:36:54 2005 +0000
     1.3 @@ -27,15 +27,22 @@ static void __init add_memory_region(uns
     1.4  
     1.5  #define E820_DEBUG	1
     1.6  
     1.7 -static void __init print_memory_map(void)
     1.8 +#ifndef NDEBUG
     1.9 +#define __init_unless_debugging
    1.10 +#else
    1.11 +#define __init_unless_debugging __init
    1.12 +#endif
    1.13 +
    1.14 +void __init_unless_debugging
    1.15 +print_e820_memory_map(struct e820entry *map, int entries)
    1.16  {
    1.17      int i;
    1.18  
    1.19 -    for (i = 0; i < e820.nr_map; i++) {
    1.20 +    for (i = 0; i < entries; i++) {
    1.21          printk(" %016Lx - %016Lx ",
    1.22 -               e820.map[i].addr,
    1.23 -               e820.map[i].addr + e820.map[i].size);
    1.24 -        switch (e820.map[i].type) {
    1.25 +               map[i].addr,
    1.26 +               map[i].addr + map[i].size);
    1.27 +        switch (map[i].type) {
    1.28          case E820_RAM:	printk("(usable)\n");
    1.29              break;
    1.30          case E820_RESERVED:
    1.31 @@ -47,7 +54,7 @@ static void __init print_memory_map(void
    1.32          case E820_NVS:
    1.33              printk("(ACPI NVS)\n");
    1.34              break;
    1.35 -        default:	printk("type %u\n", e820.map[i].type);
    1.36 +        default:	printk("type %u\n", map[i].type);
    1.37              break;
    1.38          }
    1.39      }
    1.40 @@ -343,10 +350,10 @@ static void __init machine_specific_memo
    1.41      clip_4gb();
    1.42  }
    1.43  
    1.44 -unsigned long init_e820(struct e820entry *raw, int raw_nr)
    1.45 +unsigned long __init init_e820(struct e820entry *raw, int raw_nr)
    1.46  {
    1.47      machine_specific_memory_setup(raw, raw_nr);
    1.48      printk(KERN_INFO "Physical RAM map:\n");
    1.49 -    print_memory_map();
    1.50 +    print_e820_memory_map(e820.map, e820.nr_map);
    1.51      return find_max_pfn();
    1.52  }
     2.1 --- a/xen/arch/x86/vmx_vmcs.c	Mon Feb 21 17:31:22 2005 +0000
     2.2 +++ b/xen/arch/x86/vmx_vmcs.c	Mon Feb 21 17:36:54 2005 +0000
     2.3 @@ -125,6 +125,10 @@ int vmx_setup_platform(struct exec_domai
     2.4  
     2.5      e820p = (struct e820entry *) ((unsigned long) p + offset); 
     2.6  
     2.7 +#ifndef NDEBUG
     2.8 +    print_e820_memory_map(e820p, n);
     2.9 +#endif
    2.10 +
    2.11      for (i = 0; i < n; i++) {
    2.12          if (e820p[i].type == E820_SHARED_PAGE) {
    2.13              gpfn = (e820p[i].addr >> PAGE_SHIFT);
     3.1 --- a/xen/include/asm-x86/e820.h	Mon Feb 21 17:31:22 2005 +0000
     3.2 +++ b/xen/include/asm-x86/e820.h	Mon Feb 21 17:36:54 2005 +0000
     3.3 @@ -27,6 +27,10 @@ struct e820map {
     3.4  extern unsigned long init_e820(struct e820entry *, int);
     3.5  extern struct e820map e820;
     3.6  
     3.7 +#ifndef NDEBUG
     3.8 +extern void print_e820_memory_map(struct e820entry *map, int entries);
     3.9 +#endif
    3.10 +
    3.11  #endif /*!__ASSEMBLY__*/
    3.12  
    3.13  #define PFN_DOWN(x)   ((x) >> PAGE_SHIFT)