]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
libxl/acpi: Add ACPI e820 entry
authorBoris Ostrovsky <boris.ostrovsky@oracle.com>
Wed, 28 Sep 2016 13:22:02 +0000 (09:22 -0400)
committerWei Liu <wei.liu2@citrix.com>
Wed, 28 Sep 2016 13:32:05 +0000 (14:32 +0100)
Add entry for ACPI tables created for PVHv2 guests to e820 map.

Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxl/libxl_dom.c
tools/libxl/libxl_x86.c

index c4be916d621a8a0028d222cf3ece817baac4f7c0..79743020014c450a7c578be9d02130fde1263ffa 100644 (file)
@@ -1134,16 +1134,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,
index 46cfafb51305625a94bec73840634079433ee84c..2b221aa519a11cef69564c0feb857683b0bc8a3d 100644 (file)
@@ -492,6 +492,7 @@ int libxl__arch_domain_construct_memmap(libxl__gc *gc,
     uint64_t highmem_size =
                     dom->highmem_end ? dom->highmem_end - (1ull << 32) : 0;
     uint32_t lowmem_start = dom->device_model ? GUEST_LOW_MEM_START_DEFAULT : 0;
+    unsigned page_size = XC_DOM_PAGE_SIZE(dom);
 
     /* Add all rdm entries. */
     for (i = 0; i < d_config->num_rdms; i++)
@@ -503,6 +504,10 @@ int libxl__arch_domain_construct_memmap(libxl__gc *gc,
     if (highmem_size)
         e820_entries++;
 
+    for (i = 0; i < MAX_ACPI_MODULES; i++)
+        if (dom->acpi_modules[i].length)
+            e820_entries++;
+
     if (e820_entries >= E820MAX) {
         LOG(ERROR, "Ooops! Too many entries in the memory map!");
         rc = ERROR_INVAL;
@@ -528,6 +533,16 @@ int libxl__arch_domain_construct_memmap(libxl__gc *gc,
         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);
+            e820[nr].size = dom->acpi_modules[i].length +
+                (dom->acpi_modules[i].guest_addr_out & (page_size - 1));
+            e820[nr].type = E820_ACPI;
+            nr++;
+        }
+    }
+
     /* High memory */
     if (highmem_size) {
         e820[nr].addr = ((uint64_t)1 << 32);