<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">From 851490ff6f45b9b6093abc4d856ae3ceaa2360c2 Mon Sep 17 00:00:00 2001
From: Laszlo Ersek &lt;lersek@redhat.com&gt;
Date: Wed, 17 Jun 2015 14:07:41 +0200
Subject: [PATCH 01/23] hw/acpi: acpi_pm1_cnt_init(): take "disable_s3" and
 "disable_s4"

Message-id: &lt;1434550063-12144-2-git-send-email-lersek@redhat.com&gt;
Patchwork-id: 66286
O-Subject: [RHEV-7.2 qemu-kvm-rhev 1/3] hw/acpi: acpi_pm1_cnt_init(): take "disable_s3" and "disable_s4"
Bugzilla: 1204696
RH-Acked-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
RH-Acked-by: Thomas Huth &lt;thuth@redhat.com&gt;
RH-Acked-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;

This patch only modifies the function prototype and updates all chipset
code that calls acpi_pm1_cnt_init() to pass in their own disable_s3 and
disable_s4 settings. vt82c686 is assumed to be fixed "S3 and S4 enabled".

RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=1204696
Cc: Amit Shah &lt;amit.shah@redhat.com&gt;
Cc: "Michael S. Tsirkin" &lt;mst@redhat.com&gt;
Cc: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Cc: Richard Henderson &lt;rth@twiddle.net&gt;
Cc: Eduardo Habkost &lt;ehabkost@redhat.com&gt;
Cc: Aurelien Jarno &lt;aurelien@aurel32.net&gt;
Cc: Leon Alrae &lt;leon.alrae@imgtec.com&gt;
Signed-off-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Reviewed-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
(cherry picked from commit 9a10bbb4e83b184faef6fa744396a6775283c0aa)
Signed-off-by: Miroslav Rezanina &lt;mrezanin@redhat.com&gt;
---
 hw/acpi/core.c         | 3 ++-
 hw/acpi/ich9.c         | 3 ++-
 hw/acpi/piix4.c        | 2 +-
 hw/isa/vt82c686.c      | 2 +-
 include/hw/acpi/acpi.h | 3 ++-
 5 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/hw/acpi/core.c b/hw/acpi/core.c
index 51913d6..c19be8f 100644
--- a/hw/acpi/core.c
+++ b/hw/acpi/core.c
@@ -592,7 +592,8 @@ static const MemoryRegionOps acpi_pm_cnt_ops = {
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
-void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent, uint8_t s4_val)
+void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent,
+                       bool disable_s3, bool disable_s4, uint8_t s4_val)
 {
     ar-&gt;pm1.cnt.s4_val = s4_val;
     ar-&gt;wakeup.notify = acpi_notify_wakeup;
diff --git a/hw/acpi/ich9.c b/hw/acpi/ich9.c
index 84e5bb8..799351e 100644
--- a/hw/acpi/ich9.c
+++ b/hw/acpi/ich9.c
@@ -219,7 +219,8 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
 
     acpi_pm_tmr_init(&amp;pm-&gt;acpi_regs, ich9_pm_update_sci_fn, &amp;pm-&gt;io);
     acpi_pm1_evt_init(&amp;pm-&gt;acpi_regs, ich9_pm_update_sci_fn, &amp;pm-&gt;io);
-    acpi_pm1_cnt_init(&amp;pm-&gt;acpi_regs, &amp;pm-&gt;io, pm-&gt;s4_val);
+    acpi_pm1_cnt_init(&amp;pm-&gt;acpi_regs, &amp;pm-&gt;io, pm-&gt;disable_s3, pm-&gt;disable_s4,
+                      pm-&gt;s4_val);
 
     acpi_gpe_init(&amp;pm-&gt;acpi_regs, ICH9_PMIO_GPE0_LEN);
     memory_region_init_io(&amp;pm-&gt;io_gpe, OBJECT(lpc_pci), &amp;ich9_gpe_ops, pm,
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index d20c1e8..1fb32f5 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -475,7 +475,7 @@ static void piix4_pm_realize(PCIDevice *dev, Error **errp)
 
     acpi_pm_tmr_init(&amp;s-&gt;ar, pm_tmr_timer, &amp;s-&gt;io);
     acpi_pm1_evt_init(&amp;s-&gt;ar, pm_tmr_timer, &amp;s-&gt;io);
-    acpi_pm1_cnt_init(&amp;s-&gt;ar, &amp;s-&gt;io, s-&gt;s4_val);
+    acpi_pm1_cnt_init(&amp;s-&gt;ar, &amp;s-&gt;io, s-&gt;disable_s3, s-&gt;disable_s4, s-&gt;s4_val);
     acpi_gpe_init(&amp;s-&gt;ar, GPE_LEN);
 
     s-&gt;powerdown_notifier.notify = piix4_pm_powerdown_req;
diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c
index b8197b1..b2ba870 100644
--- a/hw/isa/vt82c686.c
+++ b/hw/isa/vt82c686.c
@@ -356,7 +356,7 @@ static void vt82c686b_pm_realize(PCIDevice *dev, Error **errp)
 
     acpi_pm_tmr_init(&amp;s-&gt;ar, pm_tmr_timer, &amp;s-&gt;io);
     acpi_pm1_evt_init(&amp;s-&gt;ar, pm_tmr_timer, &amp;s-&gt;io);
-    acpi_pm1_cnt_init(&amp;s-&gt;ar, &amp;s-&gt;io, 2);
+    acpi_pm1_cnt_init(&amp;s-&gt;ar, &amp;s-&gt;io, false, false, 2);
 }
 
 I2CBus *vt82c686b_pm_init(PCIBus *bus, int devfn, uint32_t smb_io_base,
diff --git a/include/hw/acpi/acpi.h b/include/hw/acpi/acpi.h
index 1f678b4..b0ce094 100644
--- a/include/hw/acpi/acpi.h
+++ b/include/hw/acpi/acpi.h
@@ -160,7 +160,8 @@ void acpi_pm1_evt_init(ACPIREGS *ar, acpi_update_sci_fn update_sci,
                        MemoryRegion *parent);
 
 /* PM1a_CNT: piix and ich9 don't implement PM1b CNT. */
-void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent, uint8_t s4_val);
+void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent,
+                       bool disable_s3, bool disable_s4, uint8_t s4_val);
 void acpi_pm1_cnt_update(ACPIREGS *ar,
                          bool sci_enable, bool sci_disable);
 void acpi_pm1_cnt_reset(ACPIREGS *ar);
-- 
1.8.3.1

</pre></body></html>