x86/pvh: print dom0 memory map
authorRoger Pau Monne <roger.pau@citrix.com>
Tue, 25 Jan 2022 10:46:36 +0000 (11:46 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 25 Jan 2022 10:52:25 +0000 (10:52 +0000)
I find it useful for debugging certain issues to have the memory map
dom0 is using, so print it when using `dom0=verbose` on the command
line.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/e820.c
xen/arch/x86/hvm/dom0_build.c
xen/arch/x86/include/asm/e820.h

index aa602773bbfd6189fc7bdc11a8b6a8e9a5cf7754..b653a19c93afb98c2d64330384cb4fa7b4d2e1ec 100644 (file)
@@ -88,7 +88,8 @@ static void __init add_memory_region(unsigned long long start,
     e820.nr_map++;
 }
 
-static void __init print_e820_memory_map(struct e820entry *map, unsigned int entries)
+void __init print_e820_memory_map(const struct e820entry *map,
+                                  unsigned int entries)
 {
     unsigned int i;
 
index 8048987286a9d7c759002f146d47f6a10345e908..afba6e7dfdf465ddcfc8b42955af312ed990701f 100644 (file)
@@ -1269,6 +1269,12 @@ int __init dom0_construct_pvh(struct domain *d, const module_t *image,
         return rc;
     }
 
+    if ( opt_dom0_verbose )
+    {
+        printk("Dom%u memory map:\n", d->domain_id);
+        print_e820_memory_map(d->arch.e820, d->arch.nr_e820);
+    }
+
     printk("WARNING: PVH is an experimental mode with limited functionality\n");
     return 0;
 }
index 9d8f1ba9601d814680f9102f4c1da7592b4993e0..92f5efa4f56dae46558b9d535e09facd7e00abf5 100644 (file)
@@ -32,6 +32,8 @@ extern int e820_change_range_type(
 extern int e820_add_range(
     struct e820map *, uint64_t s, uint64_t e, uint32_t type);
 extern unsigned long init_e820(const char *, struct e820map *);
+extern void print_e820_memory_map(const struct e820entry *map,
+    unsigned int entries);
 extern struct e820map e820;
 extern struct e820map e820_raw;