At the moment this flag is unconditionally set for PVHv2 domains. Note that
using this boot flag requires that the FADT table revision is at least 5 (or any
later version), so bump the current FADT version from 4 to 5 and add two new
fields that will be unused.

Reported-by: Jan Beulich <jbeul...@suse.com>
Signed-off-by: Roger Pau Monné <roger....@citrix.com>
---
Cc: Jan Beulich <jbeul...@suse.com>
Cc: Andrew Cooper <andrew.coop...@citrix.com>
Cc: Ian Jackson <ian.jack...@eu.citrix.com>
Cc: Wei Liu <wei.l...@citrix.com>
Cc: boris.ostrov...@oracle.com
Cc: konrad.w...@oracle.com
---
Ideally this should be somehow fetched from the emulation_flags set of flags,
but sadly there's no way for hvmloader (which runs in guest context) to fetch
this information. If at some point a rtc option is added to libxl, we should see
about passing it through to init_acpi_config in libxl_x86_acpi.c so that we can
then appropriately set this flag for PVHv2 guests.
---
 tools/firmware/hvmloader/util.c | 3 ++-
 tools/libacpi/acpi2_0.h         | 1 +
 tools/libacpi/build.c           | 9 +++++++++
 tools/libacpi/libacpi.h         | 1 +
 4 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/tools/firmware/hvmloader/util.c b/tools/firmware/hvmloader/util.c
index 5dbb448..df04324 100644
--- a/tools/firmware/hvmloader/util.c
+++ b/tools/firmware/hvmloader/util.c
@@ -949,7 +949,8 @@ void hvmloader_acpi_build_tables(struct acpi_config *config,
         config->table_flags |= ACPI_HAS_SSDT_S4;
 
     config->table_flags |= (ACPI_HAS_TCPA | ACPI_HAS_IOAPIC | ACPI_HAS_WAET |
-                            ACPI_HAS_VGA | ACPI_HAS_8042 | ACPI_FADT_4);
+                            ACPI_HAS_VGA | ACPI_HAS_8042 | ACPI_FADT_4 |
+                            ACPI_HAS_CMOS_RTC);
 
     config->tis_hdr = (uint16_t *)ACPI_TIS_HDR_ADDRESS;
 
diff --git a/tools/libacpi/acpi2_0.h b/tools/libacpi/acpi2_0.h
index b8ef777..eee13ae 100644
--- a/tools/libacpi/acpi2_0.h
+++ b/tools/libacpi/acpi2_0.h
@@ -232,6 +232,7 @@ struct acpi_50_fadt {
 #define ACPI_FADT_LEGACY_DEVICES    (1 << 0)
 #define ACPI_FADT_8042              (1 << 1)
 #define ACPI_FADT_NO_VGA            (1 << 2)
+#define ACPI_FADT_NO_CMOS_RTC       (1 << 5)
 
 /*
  * FADT Fixed Feature Flags.
diff --git a/tools/libacpi/build.c b/tools/libacpi/build.c
index eb40989..cd76ac3 100644
--- a/tools/libacpi/build.c
+++ b/tools/libacpi/build.c
@@ -591,6 +591,15 @@ int acpi_build_tables(struct acpi_ctxt *ctxt, struct 
acpi_config *config)
         fadt->iapc_boot_arch |= ACPI_FADT_NO_VGA;
     if ( config->table_flags & ACPI_HAS_8042 )
         fadt->iapc_boot_arch |= ACPI_FADT_8042;
+    if ( !(config->table_flags & ACPI_HAS_CMOS_RTC) )
+    {
+        if ( config->table_flags & ACPI_FADT_4 )
+        {
+            printf("ACPI_FADT_NO_CMOS_RTC is not available on FADT revision 
4\n");
+            return -1;
+        }
+        fadt->iapc_boot_arch |= ACPI_FADT_NO_CMOS_RTC;
+    }
 
     if ( config->table_flags & ACPI_FADT_4 )
     {
diff --git a/tools/libacpi/libacpi.h b/tools/libacpi/libacpi.h
index 89bfcc6..8881687 100644
--- a/tools/libacpi/libacpi.h
+++ b/tools/libacpi/libacpi.h
@@ -33,6 +33,7 @@
 #define ACPI_HAS_VGA         (1<<10)
 #define ACPI_HAS_8042        (1<<11)
 #define ACPI_FADT_4          (1<<12)
+#define ACPI_HAS_CMOS_RTC    (1<<13)
 
 struct xen_vmemrange;
 struct acpi_numa {
-- 
2.9.3 (Apple Git-75)


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

Reply via email to