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

[Xen-devel] [PATCH v1 18/20] libxl/acpi: Add ACPI e820 entry



Add entry for ACPI tables created for PVHv2 guests to e820 map.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
---

New patch

 tools/libxc/include/xc_dom.h |    4 ++++
 tools/libxl/libxl_dom.c      |    8 ++++----
 tools/libxl/libxl_x86.c      |   11 +++++++++++
 3 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/tools/libxc/include/xc_dom.h b/tools/libxc/include/xc_dom.h
index 6cb10c4..ec2da14 100644
--- a/tools/libxc/include/xc_dom.h
+++ b/tools/libxc/include/xc_dom.h
@@ -102,6 +102,10 @@ struct xc_dom_image {
     xen_vaddr_t virt_alloc_end;
     xen_vaddr_t bsd_symtab_start;
 
+    /* ACPI tables (PVHv2 only) */
+    xen_pfn_t acpi_pfn;
+    xen_pfn_t acpi_pages;
+
     /*
      * initrd parameters as specified in start_info page
      * Depending on capabilities of the booted kernel this may be a virtual
diff --git a/tools/libxl/libxl_dom.c b/tools/libxl/libxl_dom.c
index ec29060..ccc41b4 100644
--- a/tools/libxl/libxl_dom.c
+++ b/tools/libxl/libxl_dom.c
@@ -1063,16 +1063,16 @@ int libxl__build_hvm(libxl__gc *gc, uint32_t domid,
             dom->vnode_to_pnode[i] = info->vnuma_nodes[i].pnode;
     }
 
+    rc = libxl__build_dom(gc, domid, info, state, dom);
+    if (rc != 0)
+        goto out;
+
     rc = libxl__arch_domain_construct_memmap(gc, d_config, domid, dom);
     if (rc != 0) {
         LOG(ERROR, "setting domain memory map failed");
         goto out;
     }
 
-    rc = libxl__build_dom(gc, domid, info, state, dom);
-    if (rc != 0)
-        goto out;
-
     rc = hvm_build_set_params(ctx->xch, domid, info, state->store_port,
                                &state->store_mfn, state->console_port,
                                &state->console_mfn, state->store_domid,
diff --git a/tools/libxl/libxl_x86.c b/tools/libxl/libxl_x86.c
index 46cfafb..32ce1d2 100644
--- a/tools/libxl/libxl_x86.c
+++ b/tools/libxl/libxl_x86.c
@@ -503,6 +503,10 @@ int libxl__arch_domain_construct_memmap(libxl__gc *gc,
     if (highmem_size)
         e820_entries++;
 
+    /* PVHv2's ACPI tables */
+    if (dom->acpi_pages)
+        e820_entries++;
+
     if (e820_entries >= E820MAX) {
         LOG(ERROR, "Ooops! Too many entries in the memory map!");
         rc = ERROR_INVAL;
@@ -528,6 +532,13 @@ int libxl__arch_domain_construct_memmap(libxl__gc *gc,
         nr++;
     }
 
+    if (dom->acpi_pages) {
+        e820[nr].addr = dom->acpi_pfn << XC_DOM_PAGE_SHIFT(dom);
+        e820[nr].size = dom->acpi_pages << XC_DOM_PAGE_SHIFT(dom);
+        e820[nr].type = E820_ACPI;
+        nr++;
+    }
+
     /* High memory */
     if (highmem_size) {
         e820[nr].addr = ((uint64_t)1 << 32);
-- 
1.7.1


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

 


Rackspace

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