[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86/pvh: print dom0 memory map


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Mon, 24 Jan 2022 16:51:41 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WivgsLMvz4O78BXePpMJHcH32FjfjwpJqvql3OKi70I=; b=WEDwUJi8AIovPxEgg49AZoB3a0ebWy2SBtJnLJLQQgpRrlyas8Q2FwSEAb6ijeYonTrm4acxPBauGaptdBUVt0jFw30nGpcu9irlpLiN1QBYRXAH9v4no8J6yRjmXSkoE/SIm4/kCow0pG7BDom8iwQhWaO21Xj5Nw9yPeq1Kjwj+WOUn0qxvBWga+64SZZs018yQpX6NowLNJ6WdGuqv5VCutQuyT5CS8GfsEP7zcj+W2xG/fGx3AIzJcVH/FD+LrM82o51ZOEoWeBVlNGB5EcDvpllap5Yrsfc0DBhDopRMUG1+wJrqVaoGfwk+k+txI4r1sUV6am0dUHcih+o/A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mBqP2hR56ROs32VcdFP9G0sUvCNkoIm4vVajyznSEngReobUQ1neBSPQvwDuABAl3Z9PLAJYf63qcD6TsLoyxAIEFO6wEQy2euIes8BaHvQU/MhzlfhSCdfQfwKRDAStUABE5cE5O1MyyxV2JStyWo+spY8Gb/sbWGk0/T1b6HaZu3JiE7x/o+wYiEryzyblyNheiIhY5QLD9wJESaHoa2Pl3GKVZaqb6uoh2auVJrdnwiN1xAu4+aBP+ibDvdSD3RIsrGOeqD2wL5vyHKjX25hx+lTTXwYcqw1baNYpDN2cQUpggryE6tvvzwYawq5KX/xJc8TBd7u2WZnPFPO+lg==
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Mon, 24 Jan 2022 15:52:31 +0000
  • Ironport-data: A9a23:YU52tq8GCkiZ84IqNONeDrUDUnmTJUtcMsCJ2f8bNWPcYEJGY0x3m GoYX27Tbv6NN2ujed4gYdm18BgPuZTTzdJiTgU9rnw8E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si9AttENlFEkvU2ybuOU5NXsZ2YhFWeIdA970Ug5w7dj3tYx6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPh10 OxR7ISuGD0WI5PKncg9cBpENxtHaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguw5K8bmJsUHs2xIxjDFF/c2B5vERs0m4PcGh29s3Z0SQ54yY eI5UCMwdzefSCdMEQgaL4oupsGUr0bgJmgwRFW9+vNsvjm7IBZK+KfpGMrYfJqNX8o9tkSSq 3/C/m/5KgoHL9HZwj2Amlq8i+mKkS7lVYY6ELyj6uUskFCV3nYUChAdSR28u/bRt6Klc4sBc QpOoHNo9PVsshzwJjXgY/GmiHqchwJFQ8QBKdIn1geI5or34Bq9PFFRG1atd+canMMxQDUr0 HqAkNXoGSFjvdWpdJ6NyluHhWjsYHZIdAfucQdBFFJYuIe7/OnfmzqSFo4LLUK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prpbTMPGhZisWC1/HiVwY+/NyLd8gYVUjtJz7tn2W /Zkzbh7qHml/2g0BfT20La8pwTstr8zdloAtCKl6EuW33RozftQL4kd6yJvTgzru3qwFE2kO PUqxNlBMh342O5RBDAnTLdny3blBo+4X7rzlGVxVH5p9bieT48A81dwapEbxrw8SMbzZ1B+Z MO+1jcm4tcDBvGkii4zcPPTQtWmk29pmdnufIPjkZYTZAVZNZq3MEiFXtuYdk99R/BmcEa+L EENrCd2B8WSyLRU5nhhBgh/DT2NU5DXStvQSA5y7moOnZt7TJEJnAjtb0id0E7heAAoql/lp r525tT5cFzp7ctHNpA7cc6MLyK4z/2MGTx2Fz7GyWVKEhAAQOJl6LK
  • Ironport-sdr: dlIssqMoDR+btzLDzbQK6QqSLWMELW2IJNCAt2pks95YEJhPClRs3Zerx+xjblJuvWbMhAfbDm gStzMhunQHH8OPZaaAe167If/ENq4GVea5gQA12aMXa8CtdCtmdycd/DMnIZgZ80yuzYstvnBy NMpClWJ7/Skw57ya6XUxbSOWfHSU+htTes/ghqoI64kaPEIeGgQMSmVkCQozMsQGcQV7jDCLzh 5OPAKVcga+o+DqDFv4f/ZHFqNJjafPXOj7+cM8KZHJDosvVWi+eTwyUe9z9DljhghL7/+JdKcF 9uZyMTgycPiiLfJu5ifryAih
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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@xxxxxxxxxx>
---
 xen/arch/x86/e820.c             | 2 +-
 xen/arch/x86/hvm/dom0_build.c   | 6 ++++++
 xen/arch/x86/include/asm/e820.h | 1 +
 3 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/xen/arch/x86/e820.c b/xen/arch/x86/e820.c
index aa602773bb..82e9ac46a0 100644
--- a/xen/arch/x86/e820.c
+++ b/xen/arch/x86/e820.c
@@ -88,7 +88,7 @@ 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(struct e820entry *map, unsigned int entries)
 {
     unsigned int i;
 
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 739bb8adb6..93ebe4f404 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -1271,6 +1271,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;
 }
diff --git a/xen/arch/x86/include/asm/e820.h b/xen/arch/x86/include/asm/e820.h
index 9d8f1ba960..7fcfde3b66 100644
--- a/xen/arch/x86/include/asm/e820.h
+++ b/xen/arch/x86/include/asm/e820.h
@@ -32,6 +32,7 @@ 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(struct e820entry *map, unsigned int entries);
 extern struct e820map e820;
 extern struct e820map e820_raw;
 
-- 
2.34.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.