From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yhqbb-0005Uw-6r for qemu-devel@nongnu.org; Mon, 13 Apr 2015 22:29:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YhqbY-0007GM-1K for qemu-devel@nongnu.org; Mon, 13 Apr 2015 22:29:39 -0400 Received: from e35.co.us.ibm.com ([32.97.110.153]:48832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YhqbX-0007FU-NY for qemu-devel@nongnu.org; Mon, 13 Apr 2015 22:29:35 -0400 Received: from /spool/local by e35.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 13 Apr 2015 20:29:35 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 83EEA19D803E for ; Mon, 13 Apr 2015 20:20:38 -0600 (MDT) Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t3E2TX8r33554528 for ; Mon, 13 Apr 2015 19:29:33 -0700 Received: from d03av03.boulder.ibm.com (localhost [127.0.0.1]) by d03av03.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t3E2TWHv011667 for ; Mon, 13 Apr 2015 20:29:32 -0600 Message-ID: <552C7B8C.7040506@linux.vnet.ibm.com> Date: Mon, 13 Apr 2015 22:29:32 -0400 From: Stefan Berger MIME-Version: 1.0 References: <1427830813-639306-1-git-send-email-stefanb@linux.vnet.ibm.com> <1427830813-639306-4-git-send-email-stefanb@linux.vnet.ibm.com> <20150413082458-mutt-send-email-mst@redhat.com> In-Reply-To: <20150413082458-mutt-send-email-mst@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 3/3] TPM2 ACPI table support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: qemu-devel@nongnu.org, quan.xu@intel.com On 04/13/2015 02:27 AM, Michael S. Tsirkin wrote: >> @@ -1428,12 +1444,22 @@ void acpi_build(PcGuestInfo *guest_info, AcpiBuildTables *tables) >> acpi_add_table(table_offsets, tables_blob); >> build_hpet(tables_blob, tables->linker); >> } >> - if (misc.has_tpm) { >> + if (misc.tpm_version != TPMVersion_Unspec) { >> acpi_add_table(table_offsets, tables_blob); >> build_tpm_tcpa(tables_blob, tables->linker, tables->tcpalog); >> >> acpi_add_table(table_offsets, tables_blob); >> - build_tpm_ssdt(tables_blob, tables->linker); >> + switch (misc.tpm_version) { >> + case TPMVersion1_2: >> + build_tpm_ssdt(tables_blob, tables->linker); >> + break; >> + case TPMVersion2_0: >> + build_tpm2(tables_blob, tables->linker); >> + break; >> + case TPMVersion_Unspec: >> + /* not possible */ >> + break; >> + } >> } >> if (guest_info->numa_nodes) { >> acpi_add_table(table_offsets, tables_blob); > I think we should fix QEMU coding style violations in TPM code. > In particular, mixing of _ and camel case, enum and define values > not all upper case, local variables not all lower case. > This was less of an issue when the violations were contained > within hw/tpm/, but it's more of an issue now that this affects > other code. > The above enums look like the only violation to me. Fixed. Stefan