On Tue, Mar 23, 2021 at 10:24:31AM -0700, Isaku Yamahata wrote: > Commit 6be8cf56bc8b made sure that SCI is enabled in PM1.CNT > on reset in acpi_only mode by modifying acpi_pm1_cnt_reset() and > that worked for q35 as expected. > > The function was introduced by commit > eaba51c573a (acpi, acpi_piix, vt82c686: factor out PM1_CNT logic) > that forgot to actually call it at piix4 reset time and as result > SCI_EN wasn't set as was expected by 6be8cf56bc8b in acpi_only mode. > > So Windows crashes when it notices that SCI_EN is not set and FADT is > not providing information about how to enable it anymore. > Reproducer: > qemu-system-x86_64 -enable-kvm -M pc-i440fx-6.0,smm=off -cdrom > any_windows_10x64.iso > > Fix it by calling acpi_pm1_cnt_reset() at piix4 reset time. > > Occasionally this patch adds reset acpi PM related registers on > piix4/vt582c686 reset time and de-assert sci. > piix4_pm_realize() initializes acpi pm tmr, evt, cnt and gpe. > via_pm_realize() initializes acpi pm tmr, evt and cnt. > reset them on device reset. pm_reset() in ich9.c correctly calls > corresponding reset functions. > > Fixes: 6be8cf56bc8b (acpi/core: always set SCI_EN when SMM isn't supported) > Reported-by: Reinoud Zandijk <rein...@netbsd.org> > Co-developed-by: Igor Mammedov <imamm...@redhat.com> > Signed-off-by: Igor Mammedov <imamm...@redhat.com> > Signed-off-by: Isaku Yamahata <isaku.yamah...@intel.com> > --- > CC: imamm...@redhat.com > CC: isaku.yamah...@intel.com > CC: m...@redhat.com > CC: rein...@netbsd.org > CC: isaku.yamah...@gmail.com > CC: berra...@redhat.com > CC: pbonz...@redhat.com > CC: f4...@amsat.org > CC: aurel...@aurel32.net
Can you split acpi and vt82c686 changes to separate patches please? This way we can merge them independently. Thanks! > --- > hw/acpi/piix4.c | 7 +++++++ > hw/isa/vt82c686.c | 5 +++++ > 2 files changed, 12 insertions(+) > > diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c > index 6056d51667..8f8b0e95e5 100644 > --- a/hw/acpi/piix4.c > +++ b/hw/acpi/piix4.c > @@ -326,6 +326,13 @@ static void piix4_pm_reset(DeviceState *dev) > /* Mark SMM as already inited (until KVM supports SMM). */ > pci_conf[0x5B] = 0x02; > } > + > + acpi_pm1_evt_reset(&s->ar); > + acpi_pm1_cnt_reset(&s->ar); > + acpi_pm_tmr_reset(&s->ar); > + acpi_gpe_reset(&s->ar); > + acpi_update_sci(&s->ar, s->irq); > + > pm_io_space_update(s); > acpi_pcihp_reset(&s->acpi_pci_hotplug, !s->use_acpi_root_pci_hotplug); > } > diff --git a/hw/isa/vt82c686.c b/hw/isa/vt82c686.c > index f0fb309f12..98325bb32b 100644 > --- a/hw/isa/vt82c686.c > +++ b/hw/isa/vt82c686.c > @@ -178,6 +178,11 @@ static void via_pm_reset(DeviceState *d) > /* SMBus IO base */ > pci_set_long(s->dev.config + 0x90, 1); > > + acpi_pm1_evt_reset(&s->ar); > + acpi_pm1_cnt_reset(&s->ar); > + acpi_pm_tmr_reset(&s->ar); > + pm_update_sci(s); > + > pm_io_space_update(s); > smb_io_space_update(s); > } > -- > 2.25.1