xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Juergen Gross <jgross@suse.com>
To: xen-devel@lists.xenproject.org
Cc: Juergen Gross <jgross@suse.com>,
	wei.liu2@citrix.com, julien.grall@arm.com,
	ian.jackson@eu.citrix.com
Subject: [PATCH v2] tools/libxl: mark special pages as reserved in e820 map for PVH
Date: Tue, 21 Nov 2017 12:06:06 +0100	[thread overview]
Message-ID: <20171121110606.22809-1-jgross@suse.com> (raw)

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

             reply	other threads:[~2017-11-21 11:06 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-21 11:06 Juergen Gross [this message]
2017-11-21 11:27 ` [PATCH v2] tools/libxl: mark special pages as reserved in e820 map for PVH 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171121110606.22809-1-jgross@suse.com \
    --to=jgross@suse.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien.grall@arm.com \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).