From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48083) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0sf0-0006U4-MR for qemu-devel@nongnu.org; Fri, 05 Jun 2015 10:31:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z0sep-0007he-Ol for qemu-devel@nongnu.org; Fri, 05 Jun 2015 10:31:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:52062) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z0sep-0007hZ-JK for qemu-devel@nongnu.org; Fri, 05 Jun 2015 10:31:39 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 334443674C8 for ; Fri, 5 Jun 2015 14:31:39 +0000 (UTC) From: Paolo Bonzini Date: Fri, 5 Jun 2015 16:31:22 +0200 Message-Id: <1433514693-19414-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1433514693-19414-1-git-send-email-pbonzini@redhat.com> References: <1433514693-19414-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 01/12] piix4/ich9: do not raise SMI on ACPI enable/disable commands List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: lersek@redhat.com, kraxel@redhat.com, mst@redhat.com 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 --- 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