From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 3ED7F817BA for ; Tue, 3 Jan 2017 19:27:39 -0800 (PST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga105.jf.intel.com with ESMTP; 03 Jan 2017 19:27:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,458,1477983600"; d="scan'208";a="25869276" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 03 Jan 2017 19:27:38 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 3 Jan 2017 19:27:37 -0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.20]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.177]) with mapi id 14.03.0248.002; Wed, 4 Jan 2017 11:27:35 +0800 From: "Long, Qin" To: "Zhang, Chao B" , "edk2-devel@lists.01.org" CC: "Yao, Jiewen" Thread-Topic: [PATCH] SecurityPkg: Tcg2Smm: Update HID patch logic Thread-Index: AQHSZjhlX8d0ziDsh0+7qX7aFM+ix6EnqGlA Date: Wed, 4 Jan 2017 03:27:35 +0000 Message-ID: References: <20170104031229.372-1-chao.b.zhang@intel.com> In-Reply-To: <20170104031229.372-1-chao.b.zhang@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] SecurityPkg: Tcg2Smm: Update HID patch logic X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2017 03:27:39 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Qin Long > -----Original Message----- > From: Zhang, Chao B > Sent: Wednesday, January 04, 2017 11:12 AM > To: edk2-devel@lists.01.org > Cc: Long, Qin; Yao, Jiewen; Zhang, Chao B > Subject: [PATCH] SecurityPkg: Tcg2Smm: Update HID patch logic >=20 > Update HID patch logic. NOOP in ASL template may cause syntax error when > disassembled and recompiled. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Chao Zhang > --- > SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 11 ++++++----- > SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h | 4 ++-- > SecurityPkg/Tcg/Tcg2Smm/Tpm.asl | 8 ++++---- > 3 files changed, 12 insertions(+), 11 deletions(-) >=20 > diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c > b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c > index 5a31a87..0159036 100644 > --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c > +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c > @@ -9,7 +9,7 @@ >=20 > PhysicalPresenceCallback() and MemoryClearCallback() will receive > untrusted input and do some check. >=20 > -Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
> This program and the accompanying materials are licensed and made > available under the terms and conditions of the BSD License which > accompanies this distribution. The full text of the license may be found= at > @@ -331,7 +331,6 @@ UpdateHID ( > // Initialize HID with Default PNP string > // > ZeroMem(HID, TPM_HID_ACPI_SIZE); > - CopyMem(HID, TPM_HID_TAG, TPM_HID_PNP_SIZE); >=20 > // > // Get Manufacturer ID > @@ -391,11 +390,13 @@ UpdateHID ( > if (AsciiStrCmp((CHAR8 *)DataPtr, TPM_HID_TAG) =3D=3D 0) { > if (PnpHID) { > CopyMem(DataPtr, HID, TPM_HID_PNP_SIZE); > - Size =3D TPM_HID_PNP_SIZE; > - } else { > // > - // NOOP will be patched to '\0' > + // if HID is PNP ID, patch the last byte in HID TAG to Noop > // > + *(DataPtr + TPM_HID_PNP_SIZE) =3D AML_NOOP_OP; > + Size =3D TPM_HID_PNP_SIZE; > + } else { > + > CopyMem(DataPtr, HID, TPM_HID_ACPI_SIZE); > Size =3D TPM_HID_ACPI_SIZE; > } > diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h > b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h > index 18e8bfc..100804c 100644 > --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h > +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h > @@ -1,7 +1,7 @@ > /** @file > The header file for Tcg2 SMM driver. >=20 > -Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
> This program and the accompanying materials are licensed and made > available under the terms and conditions of the BSD License which > accompanies this distribution. The full text of the license may be found= at > @@ -98,7 +98,7 @@ typedef struct { // // PNP _HID for TPM2 device // > -#define TPM_HID_TAG "NNN0= 000" > +#define TPM_HID_TAG "NNNN= 0000" > #define TPM_HID_PNP_SIZE 8 > #define TPM_HID_ACPI_SIZE 9 >=20 > diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl > b/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl index 4128684..cf0642e 100644 > --- a/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl > +++ b/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl > @@ -2,7 +2,7 @@ > The TPM2 definition block in ACPI table for TCG2 physical presence > and MemoryClear. >=20 > -Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
> (c)Copyright 2016 HP Development Company, L.P.
This program and > the accompanying materials are licensed and made available under the > terms and conditions of the BSD License @@ -30,11 +30,11 @@ > DefinitionBlock ( > // > // TCG2 > // > - Name (_HID, "NNN0000") > + > // > - // Reserve 1 more byte for ACPI HID > + // TAG for patching TPM2.0 _HID > // > - Noop > + Name (_HID, "NNNN0000") >=20 > Name (_CID, "MSFT0101") >=20 > -- > 1.9.5.msysgit.1