Blame SOURCES/kvm-acpi-Force-rev1-FADT-on-old-q35-machine-types.patch

9bac43
From e63d707db946519d04590b86e241ac82e328339b Mon Sep 17 00:00:00 2001
9bac43
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
9bac43
Date: Wed, 11 Oct 2017 17:54:59 +0200
9bac43
Subject: [PATCH 14/69] acpi: Force rev1 FADT on old q35 machine types
9bac43
9bac43
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
9bac43
Message-id: <20171011175500.12390-2-dgilbert@redhat.com>
9bac43
Patchwork-id: 77177
9bac43
O-Subject: [RHV7.5 qemu-kvm-rhev PATCH v3 1/2] acpi: Force rev1 FADT on old q35 machine types
9bac43
Bugzilla: 1489800
9bac43
RH-Acked-by: Laszlo Ersek <lersek@redhat.com>
9bac43
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
9bac43
RH-Acked-by: Igor Mammedov <imammedo@redhat.com>
9bac43
9bac43
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
9bac43
9bac43
Upstream lp's 1714331 found that older OVMF
9bac43
didn't boot various versions of windows on 2.10+q35
9bac43
due to the change to the newer FADT version.  That's
9bac43
fixed with a newer OVMF, and it's too late upstream
9bac43
to keep compatibility.
9bac43
9bac43
Downstream, keep the compatibility on the older rhel-q35
9bac43
machine types by forcing rev1 FADT.
9bac43
9bac43
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
9bac43
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
9bac43
---
9bac43
 hw/acpi/ich9.c         | 16 ++++++++++++++++
9bac43
 hw/i386/acpi-build.c   |  2 ++
9bac43
 include/hw/acpi/ich9.h |  3 +++
9bac43
 include/hw/i386/pc.h   |  5 +++++
9bac43
 4 files changed, 26 insertions(+)
9bac43
9bac43
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
9bac43
index a4e87b8..23a7baa 100644
9bac43
--- a/hw/acpi/ich9.c
9bac43
+++ b/hw/acpi/ich9.c
9bac43
@@ -441,6 +441,18 @@ static void ich9_pm_set_enable_tco(Object *obj, bool value, Error **errp)
9bac43
     s->pm.enable_tco = value;
9bac43
 }
9bac43
 
9bac43
+static bool ich9_pm_get_force_rev1_fadt(Object *obj, Error **errp)
9bac43
+{
9bac43
+    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
9bac43
+    return s->pm.force_rev1_fadt;
9bac43
+}
9bac43
+
9bac43
+static void ich9_pm_set_force_rev1_fadt(Object *obj, bool value, Error **errp)
9bac43
+{
9bac43
+    ICH9LPCState *s = ICH9_LPC_DEVICE(obj);
9bac43
+    s->pm.force_rev1_fadt = value;
9bac43
+}
9bac43
+
9bac43
 void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
9bac43
 {
9bac43
     static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
9bac43
@@ -465,6 +477,10 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm, Error **errp)
9bac43
                              ich9_pm_get_cpu_hotplug_legacy,
9bac43
                              ich9_pm_set_cpu_hotplug_legacy,
9bac43
                              NULL);
9bac43
+    object_property_add_bool(obj, "__com.redhat_force-rev1-fadt",
9bac43
+                             ich9_pm_get_force_rev1_fadt,
9bac43
+                             ich9_pm_set_force_rev1_fadt,
9bac43
+                             NULL);
9bac43
     object_property_add(obj, ACPI_PM_PROP_S3_DISABLED, "uint8",
9bac43
                         ich9_pm_get_disable_s3,
9bac43
                         ich9_pm_set_disable_s3,
9bac43
diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c
9bac43
index 98dd424..e38fff2 100644
9bac43
--- a/hw/i386/acpi-build.c
9bac43
+++ b/hw/i386/acpi-build.c
9bac43
@@ -146,6 +146,8 @@ static void acpi_get_pm_info(AcpiPmInfo *pm)
9bac43
     }
9bac43
     if (lpc) {
9bac43
         obj = lpc;
9bac43
+        pm->force_rev1_fadt = object_property_get_bool(lpc,
9bac43
+                                  "__com.redhat_force-rev1-fadt", NULL);
9bac43
         pm->cpu_hp_io_base = ICH9_CPU_HOTPLUG_IO_BASE;
9bac43
     }
9bac43
     assert(obj);
9bac43
diff --git a/include/hw/acpi/ich9.h b/include/hw/acpi/ich9.h
9bac43
index a352c94..e9a8fad 100644
9bac43
--- a/include/hw/acpi/ich9.h
9bac43
+++ b/include/hw/acpi/ich9.h
9bac43
@@ -61,6 +61,9 @@ typedef struct ICH9LPCPMRegs {
9bac43
     uint8_t smm_enabled;
9bac43
     bool enable_tco;
9bac43
     TCOIORegs tco_regs;
9bac43
+
9bac43
+    /* RH addition, see bz 1489800 */
9bac43
+    bool force_rev1_fadt;
9bac43
 } ICH9LPCPMRegs;
9bac43
 
9bac43
 void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
9bac43
diff --git a/include/hw/i386/pc.h b/include/hw/i386/pc.h
9bac43
index 89bdaa4..a8d6857 100644
9bac43
--- a/include/hw/i386/pc.h
9bac43
+++ b/include/hw/i386/pc.h
9bac43
@@ -1007,6 +1007,11 @@ extern void igd_passthrough_isa_bridge_create(PCIBus *bus, uint16_t gpu_dev_id);
9bac43
             .driver   = "mch",\
9bac43
             .property = "extended-tseg-mbytes",\
9bac43
             .value    = stringify(0),\
9bac43
+        },\
9bac43
+        { /* PC_RHEL7_4_COMPAT bz 1489800 */ \
9bac43
+            .driver   = "ICH9-LPC",\
9bac43
+            .property = "__com.redhat_force-rev1-fadt",\
9bac43
+            .value    = "on",\
9bac43
         },
9bac43
 
9bac43
 
9bac43
-- 
9bac43
1.8.3.1
9bac43