All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PULL 02/13] piix4/ich9: do not raise SMI on ACPI enable/disable commands
Date: Mon,  6 Jul 2015 16:22:10 +0200	[thread overview]
Message-ID: <1436192541-65335-3-git-send-email-pbonzini@redhat.com> (raw)
In-Reply-To: <1436192541-65335-1-git-send-email-pbonzini@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.

Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 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 3bd1d5a..3af0fa7 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 b3e0b1f..341a727 100644
--- a/hw/isa/lpc_ich9.c
+++ b/hw/isa/lpc_ich9.c
@@ -375,6 +375,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) {
-- 
1.8.3.1

  parent reply	other threads:[~2015-07-06 14:22 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06 14:22 [Qemu-devel] [PULL 00/13] KVM patches (SMM implementation) for 2015-07-06 Paolo Bonzini
2015-07-06 14:22 ` [Qemu-devel] [PULL 01/13] linux-headers: Update to 4.2-rc1 Paolo Bonzini
2015-07-06 14:22 ` Paolo Bonzini [this message]
2015-07-06 14:22 ` [Qemu-devel] [PULL 03/13] target-i386: add support for SMBASE MSR and SMIs Paolo Bonzini
2015-07-06 14:22 ` [Qemu-devel] [PULL 04/13] kvm-all: put kvm_mem_flags to more work Paolo Bonzini
2015-07-06 14:22 ` [Qemu-devel] [PULL 05/13] kvm-all: remove useless typedef Paolo Bonzini
2015-07-06 14:22 ` [Qemu-devel] [PULL 06/13] kvm-all: move internal types to kvm_int.h Paolo Bonzini
2015-07-06 14:22 ` [Qemu-devel] [PULL 07/13] kvm-all: make KVM's memory listener more generic Paolo Bonzini
2015-07-06 14:22 ` [Qemu-devel] [PULL 08/13] kvm-all: add support for multiple address spaces Paolo Bonzini
2015-07-06 14:22 ` [Qemu-devel] [PULL 09/13] kvm-all: kvm_irqchip_create is not expected to fail Paolo Bonzini
2015-07-06 14:22 ` [Qemu-devel] [PULL 10/13] target-i386: register a separate KVM address space including SMRAM regions Paolo Bonzini
2015-07-06 14:22 ` [Qemu-devel] [PULL 11/13] pc_piix: rename kvm_enabled to smm_enabled Paolo Bonzini
2015-07-06 14:22 ` [Qemu-devel] [PULL 12/13] ich9: add smm_enabled field and arguments Paolo Bonzini
2015-07-06 14:22 ` [Qemu-devel] [PULL 13/13] pc: add SMM property Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436192541-65335-3-git-send-email-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.