[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 01/12] piix4/ich9: do not raise SMI on ACPI enable/d
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 01/12] piix4/ich9: do not raise SMI on ACPI enable/disable commands |
Date: |
Fri, 5 Jun 2015 16:31:22 +0200 |
These commands are handled entirely by QEMU. Do not raise an SMI
when they happen, because Windows (at least 2008r2) expects these
commands to work and (depending on the value of APMC_EN at
startup) the firmware might not have installed an SMI handler.
When this happens (e.g. the kernel supports SMIs, or you are using
TCG, but you have used "-machine smm=off") RIP is moved to 0x38000
where there is no code to execute.
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/acpi/piix4.c | 3 +++
hw/isa/lpc_ich9.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/hw/acpi/piix4.c b/hw/acpi/piix4.c
index b730ca6..8a64c60 100644
--- a/hw/acpi/piix4.c
+++ b/hw/acpi/piix4.c
@@ -112,6 +112,9 @@ static void apm_ctrl_changed(uint32_t val, void *arg)
/* ACPI specs 3.0, 4.7.2.5 */
acpi_pm1_cnt_update(&s->ar, val == ACPI_ENABLE, val == ACPI_DISABLE);
+ if (val == ACPI_ENABLE || val == ACPI_DISABLE) {
+ return;
+ }
if (d->config[0x5b] & (1 << 1)) {
if (s->smi_irq) {
diff --git a/hw/isa/lpc_ich9.c b/hw/isa/lpc_ich9.c
index 0269cfe..247158c 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -378,6 +378,9 @@ static void ich9_apm_ctrl_changed(uint32_t val, void *arg)
acpi_pm1_cnt_update(&lpc->pm.acpi_regs,
val == ICH9_APM_ACPI_ENABLE,
val == ICH9_APM_ACPI_DISABLE);
+ if (val == ICH9_APM_ACPI_ENABLE || val == ICH9_APM_ACPI_DISABLE) {
+ return;
+ }
/* SMI_EN = PMBASE + 30. SMI control and enable register */
if (lpc->pm.smi_en & ICH9_PMIO_SMI_EN_APMC_EN) {
--
2.4.1
- [Qemu-devel] [PATCH 00/12] SMM part 2: KVM and -machine enablement, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PATCH 01/12] piix4/ich9: do not raise SMI on ACPI enable/disable commands,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 03/12] kvm-all: put kvm_mem_flags to more work, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PATCH 02/12] target-i386: add support for SMBASE MSR and SMIs, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PATCH 05/12] kvm-all: move internal types to kvm_int.h, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PATCH 04/12] kvm-all: remove useless typedef, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PATCH 07/12] kvm-all: add support for multiple address spaces, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PATCH 08/12] kvm-all: kvm_irqchip_create is not expected to fail, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PATCH 06/12] kvm-all: make KVM's memory listener more generic, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PATCH 09/12] target-i386: register a separate KVM address space including SMRAM regions, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PATCH 10/12] pc_piix: rename kvm_enabled to smm_enabled, Paolo Bonzini, 2015/06/05
- [Qemu-devel] [PATCH 12/12] pc: add SMM property, Paolo Bonzini, 2015/06/05