From patchwork Mon Apr 4 01:37:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Berger X-Patchwork-Id: 8736631 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6E8D69F36E for ; Mon, 4 Apr 2016 01:39:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 990E1201E4 for ; Mon, 4 Apr 2016 01:39:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9254220212 for ; Mon, 4 Apr 2016 01:39:36 +0000 (UTC) Received: from localhost ([::1]:56056 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amtUO-00079d-2D for patchwork-qemu-devel@patchwork.kernel.org; Sun, 03 Apr 2016 21:39:36 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:55838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amtTF-0005H5-Pb for qemu-devel@nongnu.org; Sun, 03 Apr 2016 21:38:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1amtTC-00033A-J7 for qemu-devel@nongnu.org; Sun, 03 Apr 2016 21:38:25 -0400 Received: from e18.ny.us.ibm.com ([129.33.205.208]:56115) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1amtTC-00032p-Et for qemu-devel@nongnu.org; Sun, 03 Apr 2016 21:38:22 -0400 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sun, 3 Apr 2016 21:38:19 -0400 Received: from d01dlp01.pok.ibm.com (9.56.250.166) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sun, 3 Apr 2016 21:38:16 -0400 X-IBM-Helo: d01dlp01.pok.ibm.com X-IBM-MailFrom: stefanb@us.ibm.com X-IBM-RcptTo: qemu-devel@nongnu.org Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by d01dlp01.pok.ibm.com (Postfix) with ESMTP id 4A92838C8039 for ; Sun, 3 Apr 2016 21:38:16 -0400 (EDT) Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u341cGG542074236 for ; Mon, 4 Apr 2016 01:38:16 GMT Received: from d01av01.pok.ibm.com (localhost [127.0.0.1]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u341cF3b009924 for ; Sun, 3 Apr 2016 21:38:16 -0400 Received: from sbct-3.watson.ibm.com (sbct-3.watson.ibm.com [9.2.141.158]) by d01av01.pok.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id u341cFub009890; Sun, 3 Apr 2016 21:38:15 -0400 From: Stefan Berger To: stefanb@linux.vnet.ibm.com, qemu-devel@nongnu.org, mst@redhat.com Date: Sun, 3 Apr 2016 21:37:55 -0400 Message-Id: <1459733876-22908-2-git-send-email-stefanb@us.ibm.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1459733876-22908-1-git-send-email-stefanb@us.ibm.com> References: <1459733876-22908-1-git-send-email-stefanb@us.ibm.com> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16040401-0045-0000-0000-000003D1FBC7 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 129.33.205.208 Cc: imammedo@redhat.com, Stefan Berger , crobinso@redhat.com Subject: [Qemu-devel] [PATCH 1/2] acpi: tpm: Fix TPM ACPI description (BZ 1281413) 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch addresses BZ 1281413. https://bugzilla.redhat.com/show_bug.cgi?id=1281413 Fix the APCI description to make it work on operating systems that are more strict about the contents of the TPM's ACPI description than Linux is. The ACPI description was broken in commit 9e472263. We roll back the ACPI description to where it was in QEMU 2.3.1 and deactivate the interrupt, modify the scope to \_SB, and change the name of the device back to 'TPM' from 'ISA.TPM'. Here's the ACPI description from QEMU 2.3.1: Scope(\_SB) { /* TPM with emulated TPM TIS interface */ Device (TPM) { Name (_HID, EisaID ("PNP0C31")) Name (_CRS, ResourceTemplate () { Memory32Fixed (ReadWrite, TPM_TIS_ADDR_BASE, TPM_TIS_ADDR_SIZE) // older Linux tpm_tis drivers do not work with IRQ //IRQNoFlags () {TPM_TIS_IRQ} }) Method (_STA, 0, NotSerialized) { Return (0x0F) } } } Signed-off-by: Stefan Berger --- hw/i386/acpi-build.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/i386/acpi-build.c b/hw/i386/acpi-build.c index 35180ef..e11c721 100644 --- a/hw/i386/acpi-build.c +++ b/hw/i386/acpi-build.c @@ -2335,22 +2335,20 @@ build_dsdt(GArray *table_data, GArray *linker, Aml *scope = aml_scope("PCI0"); /* Scan all PCI buses. Generate tables to support hotplug. */ build_append_pci_bus_devices(scope, bus, pm->pcihp_bridge_en); - - if (misc->tpm_version != TPM_VERSION_UNSPEC) { - dev = aml_device("ISA.TPM"); - aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0C31"))); - aml_append(dev, aml_name_decl("_STA", aml_int(0xF))); - crs = aml_resource_template(); - aml_append(crs, aml_memory32_fixed(TPM_TIS_ADDR_BASE, - TPM_TIS_ADDR_SIZE, AML_READ_WRITE)); - aml_append(crs, aml_irq_no_flags(TPM_TIS_IRQ)); - aml_append(dev, aml_name_decl("_CRS", crs)); - aml_append(scope, dev); - } - - aml_append(sb_scope, scope); } } + + if (misc->tpm_version != TPM_VERSION_UNSPEC) { + dev = aml_device("TPM"); + aml_append(dev, aml_name_decl("_HID", aml_eisaid("PNP0C31"))); + aml_append(dev, aml_name_decl("_STA", aml_int(0xF))); + crs = aml_resource_template(); + aml_append(crs, aml_memory32_fixed(TPM_TIS_ADDR_BASE, + TPM_TIS_ADDR_SIZE, AML_READ_WRITE)); + //aml_append(crs, aml_irq_no_flags(TPM_TIS_IRQ)); + aml_append(dev, aml_name_decl("_CRS", crs)); + aml_append(sb_scope, dev); + } aml_append(dsdt, sb_scope); }