]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
acpi: initialize s4_val used in s4 shutdown
authorBruce Rogers <brogers@suse.com>
Tue, 2 Apr 2013 18:41:40 +0000 (12:41 -0600)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Thu, 4 Apr 2013 22:24:55 +0000 (17:24 -0500)
While investigating why a 32 bit Windows 2003 guest wasn't able to
successfully perform a shutdown /h, it was discovered that commit
afafe4bbe0cf7d3318e1ac7b40925561f86a6bd4 inadvertently dropped the
initialization of the s4_val used to handle s4 shutdown.
Initialize the value as before.

Signed-off-by: Bruce Rogers <brogers@suse.com>
Message-id: 1364928100-487-1-git-send-email-brogers@suse.com
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
(cherry picked from commit 560e63965232e37d1916a447125cf91c18a96930)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/acpi.c
hw/acpi.h
hw/acpi_ich9.c
hw/acpi_piix4.c
hw/vt82c686.c

index 8c9dcc51c4b8c403df6017a5f7a73cf5539110e3..a83c4eaeae2253ca2c32dec672248d72663c756a 100644 (file)
--- a/hw/acpi.c
+++ b/hw/acpi.c
@@ -472,8 +472,9 @@ static const MemoryRegionOps acpi_pm_cnt_ops = {
     .endianness = DEVICE_LITTLE_ENDIAN,
 };
 
-void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent)
+void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent, uint8_t s4_val)
 {
+    ar->pm1.cnt.s4_val = s4_val;
     ar->wakeup.notify = acpi_notify_wakeup;
     qemu_register_wakeup_notifier(&ar->wakeup);
     memory_region_init_io(&ar->pm1.cnt.io, &acpi_pm_cnt_ops, ar, "acpi-cnt", 2);
index c3628d070dbe7e3bc52bbd1104f72dc265b008b9..e18ef28fd32d1b064fb116289c76d458bd4587b7 100644 (file)
--- a/hw/acpi.h
+++ b/hw/acpi.h
@@ -142,7 +142,7 @@ 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);
+void acpi_pm1_cnt_init(ACPIREGS *ar, MemoryRegion *parent, uint8_t s4_val);
 void acpi_pm1_cnt_update(ACPIREGS *ar,
                          bool sci_enable, bool sci_disable);
 void acpi_pm1_cnt_reset(ACPIREGS *ar);
index d2f9808242b5cdd23d044a98a153368be55de424..fe385e926e7e3e04a9bb03832603fcdecc2806b0 100644 (file)
@@ -212,7 +212,7 @@ void ich9_pm_init(PCIDevice *lpc_pci, ICH9LPCPMRegs *pm,
 
     acpi_pm_tmr_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);
     acpi_pm1_evt_init(&pm->acpi_regs, ich9_pm_update_sci_fn, &pm->io);
-    acpi_pm1_cnt_init(&pm->acpi_regs, &pm->io);
+    acpi_pm1_cnt_init(&pm->acpi_regs, &pm->io, 2);
 
     acpi_gpe_init(&pm->acpi_regs, ICH9_PMIO_GPE0_LEN);
     memory_region_init_io(&pm->io_gpe, &ich9_gpe_ops, pm, "apci-gpe0",
index 65b26013bd1492794965693e930e12f9a7a08963..1beac219b05ce0d6477a7f1b43c0a306a98873e4 100644 (file)
@@ -418,7 +418,7 @@ static int piix4_pm_initfn(PCIDevice *dev)
 
     acpi_pm_tmr_init(&s->ar, pm_tmr_timer, &s->io);
     acpi_pm1_evt_init(&s->ar, pm_tmr_timer, &s->io);
-    acpi_pm1_cnt_init(&s->ar, &s->io);
+    acpi_pm1_cnt_init(&s->ar, &s->io, s->s4_val);
     acpi_gpe_init(&s->ar, GPE_LEN);
 
     s->powerdown_notifier.notify = piix4_pm_powerdown_req;
index 2d8e3988dbb25e02011cda3ef48c7cd7a5881d73..9823f8a2c11d3270e44ca4f57fd6423b4f7dab62 100644 (file)
@@ -362,7 +362,7 @@ static int vt82c686b_pm_initfn(PCIDevice *dev)
 
     acpi_pm_tmr_init(&s->ar, pm_tmr_timer, &s->io);
     acpi_pm1_evt_init(&s->ar, pm_tmr_timer, &s->io);
-    acpi_pm1_cnt_init(&s->ar, &s->io);
+    acpi_pm1_cnt_init(&s->ar, &s->io, 2);
 
     return 0;
 }