thebeanogamer / rpms / qemu-kvm

Forked from rpms/qemu-kvm 5 months ago
Clone
586cba
From 38b89dc24551258b630f09d1c654b6c72b265c79 Mon Sep 17 00:00:00 2001
586cba
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
586cba
Date: Thu, 14 Apr 2022 14:58:43 +0100
586cba
Subject: pc: Move s3/s4 suspend disabling to compat
586cba
586cba
RH-Author: Dr. David Alan Gilbert <dgilbert@redhat.com>
586cba
RH-MergeRequest: 155: 7.0 machine type fixes (x86)
586cba
RH-Commit: [26/26] 7d666032d5f5dab1444ebba085f92f2de4e86699
586cba
RH-Bugzilla: 2064771
586cba
586cba
Our downstream patches currently have tweaks in the C code to disable
586cba
s3/s4; Thomas pointed out we can just set the property.
586cba
586cba
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
586cba
---
586cba
 hw/acpi/ich9.c  | 4 ++--
586cba
 hw/acpi/piix4.c | 4 ++--
586cba
 hw/i386/pc.c    | 6 ++++++
586cba
 3 files changed, 10 insertions(+), 4 deletions(-)
586cba
586cba
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
586cba
index de1e401cdf..bd9bbade70 100644
586cba
--- a/hw/acpi/ich9.c
586cba
+++ b/hw/acpi/ich9.c
586cba
@@ -435,8 +435,8 @@ void ich9_pm_add_properties(Object *obj, ICH9LPCPMRegs *pm)
586cba
     static const uint32_t gpe0_len = ICH9_PMIO_GPE0_LEN;
586cba
     pm->acpi_memory_hotplug.is_enabled = true;
586cba
     pm->cpu_hotplug_legacy = true;
586cba
-    pm->disable_s3 = 1;
586cba
-    pm->disable_s4 = 1;
586cba
+    pm->disable_s3 = 0;
586cba
+    pm->disable_s4 = 0;
586cba
     pm->s4_val = 2;
586cba
     pm->use_acpi_hotplug_bridge = true;
586cba
     pm->keep_pci_slot_hpc = true;
586cba
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
586cba
index 28544e78c3..2fb2b43248 100644
586cba
--- a/hw/acpi/piix4.c
586cba
+++ b/hw/acpi/piix4.c
586cba
@@ -653,8 +653,8 @@ static void piix4_send_gpe(AcpiDeviceIf *adev, AcpiEventStatusBits ev)
586cba
 
586cba
 static Property piix4_pm_properties[] = {
586cba
     DEFINE_PROP_UINT32("smb_io_base", PIIX4PMState, smb_io_base, 0),
586cba
-    DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 1),
586cba
-    DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 1),
586cba
+    DEFINE_PROP_UINT8(ACPI_PM_PROP_S3_DISABLED, PIIX4PMState, disable_s3, 0),
586cba
+    DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_DISABLED, PIIX4PMState, disable_s4, 0),
586cba
     DEFINE_PROP_UINT8(ACPI_PM_PROP_S4_VAL, PIIX4PMState, s4_val, 2),
586cba
     DEFINE_PROP_BOOL(ACPI_PM_PROP_ACPI_PCIHP_BRIDGE, PIIX4PMState,
586cba
                      use_acpi_hotplug_bridge, true),
586cba
diff --git a/hw/i386/pc.c b/hw/i386/pc.c
586cba
index 0886cfe3fe..f98f842f80 100644
586cba
--- a/hw/i386/pc.c
586cba
+++ b/hw/i386/pc.c
586cba
@@ -380,6 +380,12 @@ const size_t pc_compat_1_4_len = G_N_ELEMENTS(pc_compat_1_4);
586cba
  * machine type.
586cba
  */
586cba
 GlobalProperty pc_rhel_compat[] = {
586cba
+    /* we don't support s3/s4 suspend */
586cba
+    { "PIIX4_PM", "disable_s3", "1" },
586cba
+    { "PIIX4_PM", "disable_s4", "1" },
586cba
+    { "ICH9-LPC", "disable_s3", "1" },
586cba
+    { "ICH9-LPC", "disable_s4", "1" },
586cba
+
586cba
     { TYPE_X86_CPU, "host-phys-bits", "on" },
586cba
     { TYPE_X86_CPU, "host-phys-bits-limit", "48" },
586cba
     { TYPE_X86_CPU, "vmx-entry-load-perf-global-ctrl", "off" },
586cba
-- 
586cba
2.31.1
586cba