From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) (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 0234C817B2 for ; Tue, 3 Jan 2017 19:26:26 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga101.jf.intel.com with ESMTP; 03 Jan 2017 19:26:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,458,1477983600"; d="scan'208";a="49252808" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga005.fm.intel.com with ESMTP; 03 Jan 2017 19:26:25 -0800 Received: from fmsmsx116.amr.corp.intel.com (10.18.116.20) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 3 Jan 2017 19:26:25 -0800 Received: from shsmsx152.ccr.corp.intel.com (10.239.6.52) by fmsmsx116.amr.corp.intel.com (10.18.116.20) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 3 Jan 2017 19:26:25 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.88]) by SHSMSX152.ccr.corp.intel.com ([169.254.6.132]) with mapi id 14.03.0248.002; Wed, 4 Jan 2017 11:26:22 +0800 From: "Yao, Jiewen" To: "Zhang, Chao B" , "edk2-devel@lists.01.org" CC: "Long, Qin" Thread-Topic: [PATCH] SecurityPkg: Tcg2Smm: Update HID patch logic Thread-Index: AQHSZjhlect1zctupUCEh0xW32U5taEnqCRw Date: Wed, 4 Jan 2017 03:26:22 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C503A8DACCC@shsmsx102.ccr.corp.intel.com> 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:26:26 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Jiewen.yao@intel.com > -----Original Message----- > From: Zhang, Chao B > Sent: Wednesday, January 4, 2017 11:12 AM > To: edk2-devel@lists.01.org > Cc: Long, Qin ; Yao, Jiewen ; Z= hang, > 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 untr= usted > 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 BS= D > License > which accompanies this distribution. The full text of the license may b= e 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 BS= D > License > which accompanies this distribution. The full text of the license may b= e found > at > @@ -98,7 +98,7 @@ typedef struct { > // > // PNP _HID for TPM2 device > // > -#define TPM_HID_TAG > "NNN0000" > +#define TPM_HID_TAG > "NNNN0000" > #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 BS= D > 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