From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (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 D75231A1DFB for ; Sun, 25 Sep 2016 19:45:24 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP; 25 Sep 2016 19:45:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,397,1470726000"; d="scan'208";a="883714478" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by orsmga003.jf.intel.com with ESMTP; 25 Sep 2016 19:45:24 -0700 Received: from fmsmsx102.amr.corp.intel.com (10.18.124.200) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 25 Sep 2016 19:45:23 -0700 Received: from shsmsx103.ccr.corp.intel.com (10.239.4.69) by FMSMSX102.amr.corp.intel.com (10.18.124.200) with Microsoft SMTP Server (TLS) id 14.3.248.2; Sun, 25 Sep 2016 19:45:23 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.15]) by SHSMSX103.ccr.corp.intel.com ([169.254.4.234]) with mapi id 14.03.0248.002; Mon, 26 Sep 2016 10:45:21 +0800 From: "Yao, Jiewen" To: "Zhang, Chao B" , "edk2-devel@lists.01.org" CC: "Long, Qin" Thread-Topic: [PATCH] SecurityPkg: Tcg: New field for User Confirmation Status Thread-Index: AQHSF58nsYXaCWibykKoKvlImSwrNqCLEL+w Date: Mon, 26 Sep 2016 02:45:20 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C5038699116@shsmsx102.ccr.corp.intel.com> References: <1474857535-13132-1-git-send-email-chao.b.zhang@intel.com> In-Reply-To: <1474857535-13132-1-git-send-email-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: Tcg: New field for User Confirmation Status 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: Mon, 26 Sep 2016 02:45:25 -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: Monday, September 26, 2016 10:39 AM > To: edk2-devel@lists.01.org > Cc: Yao, Jiewen ; Long, Qin ; > Zhang, Chao B > Subject: [PATCH] SecurityPkg: Tcg: New field for User Confirmation Status >=20 > Add a new field in TcgNVS for PP operation user confirmation status, > instead of previous logic overriding Request. Previous logic causes > Get Pending TPM Operation Requested sub function return wrong value. >=20 > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Chao Zhang > --- > SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c | 4 ++-- > SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h | 1 + > SecurityPkg/Tcg/Tcg2Smm/Tpm.asl | 5 +++-- > SecurityPkg/Tcg/TcgSmm/TcgSmm.c | 4 ++-- > SecurityPkg/Tcg/TcgSmm/TcgSmm.h | 3 ++- > SecurityPkg/Tcg/TcgSmm/Tpm.asl | 7 ++++--- > 6 files changed, 14 insertions(+), 10 deletions(-) >=20 > diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c > b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c > index 19d9b48..f3b7641 100644 > --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c > +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.c > @@ -135,8 +135,8 @@ PhysicalPresenceCallback ( >=20 > mTcgNvs->PhysicalPresence.RequestParameter > ); > } else if (mTcgNvs->PhysicalPresence.Parameter =3D=3D > TCG_ACPI_FUNCTION_GET_USER_CONFIRMATION_STATUS_FOR_REQUEST) > { > - mTcgNvs->PhysicalPresence.ReturnCode =3D > Tcg2PhysicalPresenceLibGetUserConfirmationStatusFunction > (mTcgNvs->PhysicalPresence.Request); > - } > + mTcgNvs->PhysicalPresence.ReturnCode =3D > Tcg2PhysicalPresenceLibGetUserConfirmationStatusFunction > (mTcgNvs->PPRequestUserConfirm); > + } >=20 > return EFI_SUCCESS; > } > diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h > b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h > index fa77c9a..0b09032 100644 > --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h > +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.h > @@ -62,6 +62,7 @@ typedef struct { > typedef struct { > PHYSICAL_PRESENCE_NVS PhysicalPresence; > MEMORY_CLEAR_NVS MemoryClear; > + UINT32 PPRequestUserConfirm; > } TCG_NVS; >=20 > typedef struct { > diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl > b/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl > index 9ff74f7..84143cf 100644 > --- a/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl > +++ b/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl > @@ -79,7 +79,8 @@ DefinitionBlock ( > MCIN, 8, // Software SMI for Memory Clear Interface > MCIP, 32, // Used for save the Mor paramter > MORD, 32, // Memory Overwrite Request Data > - MRET, 32 // Memory Overwrite function return code > + MRET, 32, // Memory Overwrite function return code > + UCRQ, 32 // Phyical Presence request operation to Get > User Confirmation Status > } >=20 > Method (PTS, 1, Serialized) > @@ -274,7 +275,7 @@ DefinitionBlock ( > // e) Get User Confirmation Status for Operation > // > Store (8, PPIP) > - Store (DerefOf (Index (Arg2, 0x00)), PPRQ) > + Store (DerefOf (Index (Arg2, 0x00)), UCRQ) >=20 > // > // Triggle the SMI interrupt > diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c > b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c > index 96fb456..589bab6 100644 > --- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.c > +++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.c > @@ -8,7 +8,7 @@ >=20 > PhysicalPresenceCallback() and MemoryClearCallback() will receive > untrusted input and do some check. >=20 > -Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2011 - 2016, 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 > @@ -152,7 +152,7 @@ PhysicalPresenceCallback ( >=20 > RequestConfirmed =3D FALSE; >=20 > - switch (mTcgNvs->PhysicalPresence.Request) { > + switch (mTcgNvs->PPRequestUserConfirm) { > case PHYSICAL_PRESENCE_ENABLE: > case PHYSICAL_PRESENCE_DISABLE: > case PHYSICAL_PRESENCE_ACTIVATE: > diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.h > b/SecurityPkg/Tcg/TcgSmm/TcgSmm.h > index d8eb82f..21e4ad9 100644 > --- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.h > +++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.h > @@ -1,7 +1,7 @@ > /** @file > The header file for TCG SMM driver. >=20 > -Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2012 - 2016, 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 > @@ -58,6 +58,7 @@ typedef struct { > typedef struct { > PHYSICAL_PRESENCE_NVS PhysicalPresence; > MEMORY_CLEAR_NVS MemoryClear; > + UINT32 PPRequestUserConfirm; > } TCG_NVS; >=20 > typedef struct { > diff --git a/SecurityPkg/Tcg/TcgSmm/Tpm.asl > b/SecurityPkg/Tcg/TcgSmm/Tpm.asl > index 087ff9f..b5449d9 100644 > --- a/SecurityPkg/Tcg/TcgSmm/Tpm.asl > +++ b/SecurityPkg/Tcg/TcgSmm/Tpm.asl > @@ -2,7 +2,7 @@ > The TPM definition block in ACPI table for physical presence > and MemoryClear. >=20 > -Copyright (c) 2011 - 2015, Intel Corporation. All rights reserved.
> +Copyright (c) 2011 - 2016, 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 > @@ -78,7 +78,8 @@ DefinitionBlock ( > MCIN, 8, // Software SMI for Memory Clear Interface > MCIP, 32, // Used for save the Mor paramter > MORD, 32, // Memory Overwrite Request Data > - MRET, 32 // Memory Overwrite function return code > + MRET, 32, // Memory Overwrite function return code > + UCRQ, 32 // Phyical Presence request operation to Get > User Confirmation Status > } >=20 > Method (PTS, 1, Serialized) > @@ -269,7 +270,7 @@ DefinitionBlock ( > // e) Get User Confirmation Status for Operation > // > Store (8, PPIP) > - Store (DerefOf (Index (Arg2, 0x00)), PPRQ) > + Store (DerefOf (Index (Arg2, 0x00)), UCRQ) >=20 > // > // Triggle the SMI interrupt > -- > 1.9.5.msysgit.1