Skip to contentSkip to conversation

libxl: put RSDP for PVH guest near 4GB

PATCH Superseded Juergen Gross 3 participants 4 messages Nov 29, 2017 – Dec 1, 2017 1 message not in the archive

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libxl: put RSDP for PVH guest near 4GB

Instead of locating the RSDP table below 1MB put it just below 4GB like the rest of the ACPI tables in case of PVH guests. This will avoid punching more holes than necessary into the memory map.

---
 tools/libxc/xc_dom_hvmloader.c | 2 +-
 tools/libxl/libxl_x86_acpi.c   | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
tools/libxc/xc_dom_hvmloader.c +1 -1
index 59f94e51e5..3f0bd65547 100644
@@ -136,7 +136,7 @@ static int module_init_one(struct xc_dom_image *dom,
     struct xc_dom_seg seg;
     void *dest;
 
-    if ( module->length )
+    if ( module->length && !module->guest_addr_out )
     {
         if ( xc_dom_alloc_segment(dom, &seg, name, 0, module->length) )
             goto err;
tools/libxl/libxl_x86_acpi.c +2 -2
index 9a7c90467d..b2a861d845 100644
@@ -23,7 +23,6 @@
  /* Number of pages holding ACPI tables */
 #define NUM_ACPI_PAGES 16
 /* Store RSDP in the last 64 bytes of BIOS RO memory */
-#define RSDP_ADDRESS (0x100000 - 64)
 #define ACPI_INFO_PHYSICAL_ADDRESS 0xfc000000
 
 struct libxl_acpi_ctxt {
@@ -220,7 +219,8 @@ int libxl__dom_load_acpi(libxl__gc *gc,
 
     dom->acpi_modules[0].data = (void *)config.rsdp;
     dom->acpi_modules[0].length = 64;
-    dom->acpi_modules[0].guest_addr_out = RSDP_ADDRESS;
+    dom->acpi_modules[0].guest_addr_out = ACPI_INFO_PHYSICAL_ADDRESS +
+        (1 + acpi_pages_num) * libxl_ctxt.page_size;
 
     dom->acpi_modules[1].data = (void *)config.infop;
     dom->acpi_modules[1].length = 4096;
Signature · 7 lines
2.12.3


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

tools/libxl/libxl_x86_acpi.c line 26

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 29.11.17 at 15:13, <[email protected]> wrote:
tools/libxl/libxl_x86_acpi.c +0 -1
@@ -23,7 +23,6 @@
  /* Number of pages holding ACPI tables */
 #define NUM_ACPI_PAGES 16
 /* Store RSDP in the last 64 bytes of BIOS RO memory */
-#define RSDP_ADDRESS (0x100000 - 64)

Leaving a then stale comment around?

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 10 lines · Jan Beulich

tools/libxl/libxl_x86_acpi.c line 26

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 29.11.17 at 15:13, <[email protected]> wrote:
tools/libxl/libxl_x86_acpi.c +0 -1
@@ -23,7 +23,6 @@
  /* Number of pages holding ACPI tables */
 #define NUM_ACPI_PAGES 16
 /* Store RSDP in the last 64 bytes of BIOS RO memory */
-#define RSDP_ADDRESS (0x100000 - 64)

Leaving a then stale comment around?

Indeed. Thanks for noticing.

Juergen

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by on v1 1/1
#4 lore raw
In reply to Juergen Gross
Quoted 5 lines · Juergen Gross

Instead of locating the RSDP table below 1MB put it just below 4GB like the rest of the ACPI tables in case of PVH guests. This will avoid punching more holes than necessary into the memory map.

With Jan's comment addressed:

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel