xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for-4.10] tools/libxl: mark hvm mmio area as reserved in e820 map
@ 2017-11-17 11:47 Juergen Gross
  2017-11-17 11:49 ` Wei Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Juergen Gross @ 2017-11-17 11:47 UTC (permalink / raw)
  To: xen-devel; +Cc: Juergen Gross, wei.liu2, julien.grall, ian.jackson

Make sure the HVM mmio area (especially console and Xenstore pages) is
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 and HVM 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..664bf8bd64 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. */
+    if (dom->mmio_size)
+        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) {
+        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] 5+ messages in thread

end of thread, other threads:[~2017-11-17 16:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-11-17 11:47 [PATCH for-4.10] tools/libxl: mark hvm mmio area as reserved in e820 map Juergen Gross
2017-11-17 11:49 ` Wei Liu
2017-11-17 12:26 ` Jan Beulich
     [not found] ` <5A0EE389020000780018FA7D@suse.com>
2017-11-17 13:27   ` Juergen Gross
2017-11-17 16:50 ` Juergen Gross

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).