xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] tools/libxl: mark special pages as reserved in e820 map for PVH
@ 2017-11-21 11:06 Juergen Gross
  2017-11-21 11:27 ` Jan Beulich
                   ` (4 more replies)
  0 siblings, 5 replies; 17+ messages in thread
From: Juergen Gross @ 2017-11-21 11:06 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, wei.liu2, julien.grall, ian.jackson

The "special pages" for PVH guests include the frames for console and
Xenstore ring buffers. Those have to be marked as "Reserved" in the
guest's E820 map, as otherwise conflicts might arise later e.g. when
hotplugging memory into the guest.

Signed-off-by: Juergen Gross <jgross@suse.com>
---
This is a bugfix for PVH guests. Please consider for 4.10.
---
 tools/libxl/libxl_x86.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index 5f91fe4f92..d82013f6ed 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -530,6 +530,9 @@ int libxl__arch_domain_construct_memmap(libxl__gc *gc,
         if (d_config->rdms[i].policy != LIBXL_RDM_RESERVE_POLICY_INVALID)
             e820_entries++;
 
+    /* Add mmio entry for PVH. */
+    if (dom->mmio_size && d_config->b_info.type == LIBXL_DOMAIN_TYPE_PVH)
+        e820_entries++;
 
     /* If we should have a highmem range. */
     if (highmem_size)
@@ -564,6 +567,14 @@ int libxl__arch_domain_construct_memmap(libxl__gc *gc,
         nr++;
     }
 
+    /* mmio area */
+    if (dom->mmio_size && d_config->b_info.type == LIBXL_DOMAIN_TYPE_PVH) {
+        e820[nr].addr = dom->mmio_start;
+        e820[nr].size = dom->mmio_size;
+        e820[nr].type = E820_RESERVED;
+        nr++;
+    }
+
     for (i = 0; i < MAX_ACPI_MODULES; i++) {
         if (dom->acpi_modules[i].length) {
             e820[nr].addr = dom->acpi_modules[i].guest_addr_out & ~(page_size - 1);
-- 
2.12.3


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-02-13 12:37 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-21 11:06 [PATCH v2] tools/libxl: mark special pages as reserved in e820 map for PVH Juergen Gross
2017-11-21 11:27 ` Jan Beulich
     [not found] ` <5A141B9E0200007800190754@suse.com>
2017-11-21 11:48   ` Juergen Gross
2017-11-21 12:56     ` Jan Beulich
2017-12-04 15:49 ` Juergen Gross
2017-12-05 15:23   ` [for-4.10] " Julien Grall
2017-12-05 15:36     ` Ian Jackson
2017-12-05 16:19     ` Juergen Gross
2017-12-06  9:53       ` Julien Grall
2017-12-06 11:22         ` Juergen Gross
2017-12-06 11:47           ` Roger Pau Monné
2017-12-06 11:50             ` Julien Grall
2017-12-06 11:57               ` Juergen Gross
2017-12-04 16:44 ` Roger Pau Monné
2018-02-13 11:55 ` Wei Liu
2018-02-13 11:57   ` Juergen Gross
2018-02-13 12:37     ` Wei Liu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).