From patchwork Thu Jun 18 16:28:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 486395 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id C177114027C for ; Fri, 19 Jun 2015 02:32:01 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=rM3ESdOI; dkim-atps=neutral Received: from localhost ([::1]:53811 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5cjP-0003Ee-Nu for incoming@patchwork.ozlabs.org; Thu, 18 Jun 2015 12:31:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49449) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5cgh-0006wK-0x for qemu-devel@nongnu.org; Thu, 18 Jun 2015 12:29:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z5cgb-0002IA-35 for qemu-devel@nongnu.org; Thu, 18 Jun 2015 12:29:10 -0400 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]:34390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z5cga-0002H9-SW for qemu-devel@nongnu.org; Thu, 18 Jun 2015 12:29:05 -0400 Received: by wicnd19 with SMTP id nd19so28054981wic.1 for ; Thu, 18 Jun 2015 09:29:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=KaFgccSeCFz5sWIiLyI4G+Ypa1gCmSUxaliuedQBqfA=; b=rM3ESdOIulq7uECL49hpr03kFqfxX8NPwlabCLg7oI374souKoKIyfNRcMKiHywT2i YirGP/kT4q8XFyrRad2Y3cfYi2VYOLwIwAOab9xE2SCuHILoc7AZ21Hdlc3QnQ5lQe9l eXemP5QQP8uLOtuXNz4vBVQoFPvk6YNlWvMPgpfY7l4P6y8aIF5yCTjdNeZ7QjgdHpaH 4P9wwGwXZ3k34RBga65IXcOr3b0vF4DtVik2D/gGCihl14Em05hKdB9/IyvlwVlq7oHD gVA8g3X2toJ6Wv9GOhaZuQ+qilk+U6Nxy0wFYkJYcnMXEAUoAAhynQ4WR1ysSSPoJae0 /1kQ== X-Received: by 10.194.103.130 with SMTP id fw2mr16494115wjb.130.1434644944201; Thu, 18 Jun 2015 09:29:04 -0700 (PDT) Received: from 640k.localdomain (dynamic-adsl-94-39-129-53.clienti.tiscali.it. [94.39.129.53]) by mx.google.com with ESMTPSA id pd7sm12981284wjb.27.2015.06.18.09.29.03 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jun 2015 09:29:03 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Date: Thu, 18 Jun 2015 18:28:41 +0200 Message-Id: <1434644932-90017-1-git-send-email-pbonzini@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1434644648-89776-1-git-send-email-pbonzini@redhat.com> References: <1434644648-89776-1-git-send-email-pbonzini@redhat.com> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::233 Cc: lersek@redhat.com, mst@redhat.com Subject: [Qemu-devel] [PATCH 01/12] piix4/ich9: do not raise SMI on ACPI enable/disable commands X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org 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 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) {