From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.3643.1586309355987018602 for ; Tue, 07 Apr 2020 18:29:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=zYwwrxZ8; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: guomin.jiang@intel.com) IronPort-SDR: VYRf6u/dNXQre1EntcBG/NXCjXn6Vf4kgmLzvtMZata6p7XtQ81ezlYPyoDBlK58WYdwGK8T9e LUnRQ/CeLA8w== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Apr 2020 18:29:15 -0700 IronPort-SDR: Eil9ICwQcNzBf9HZ2wdkay17T9d8KbU8bFNszcYiOx+EW7CFXB7Zk+wLq91R91WKQCx7a0ZBom M7LQ10JwbO3Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.72,357,1580803200"; d="scan'208";a="254643938" Received: from fmsmsx106.amr.corp.intel.com ([10.18.124.204]) by orsmga006.jf.intel.com with ESMTP; 07 Apr 2020 18:29:15 -0700 Received: from fmsmsx151.amr.corp.intel.com (10.18.125.4) by FMSMSX106.amr.corp.intel.com (10.18.124.204) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 7 Apr 2020 18:29:14 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by FMSMSX151.amr.corp.intel.com (10.18.125.4) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 7 Apr 2020 18:29:14 -0700 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.107) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Tue, 7 Apr 2020 18:29:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=N322XKsM6SiHJ4B55sztu9pdjJnbimirHdG4vDFlMdpqJn1YKtr6SPufttRLYKbA7PUpC9h8wvJL6mkdgrWNI9eNF0GUaLhZ47uBqE0Fe2fNeMTwRvGv6TSynJugQB/LnSNspT+RHSlD2khShGtArz9LcOk8yIwYSJM/MNeAxeX+Ri+iEOuK/EOKmLKT1T8sH7rGCYZeGDpMRdBva2CUZhrtLUyNda7vMuS4suTPNf0UVsaeY7NZzJ3Uavm+gZToJT5f2q/BdfOSpoG18vuDWUDbHDuTgNPs9Xco2Qe3BiXIGha/dNPPxIENVE2IcE97rHZxuiIvcI2MgZh6NkOcQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wQ1hWGu4FzwycKnJEss63nRaPUBFwK7LgzaBctECMBc=; b=j4NBcWR0eLebs8rTQWXW0WflcgWtAzjFk4USuyE0rvV01DYRpqzIi+GBUzqXlkO4nyCGw5ajLB5u14b78xb+hkODn6zf+kmrQKUxlIXRtjLam9n2TmsDqwzUf2Qlxv9UgWBlDh7gHsFwCNY5EMntRquPs8dYbUaopSgtoDffwdzieQOYkO2R9UCHt8Ymw/gwWcc5sq5jRa887oQzrRMk9wjDAzCYHPwPxnCh7q5QXXi47LwSz6fjH9nMppHoD1K+t3L9pFwNF0WeJDReYnJ7ao52vK4uQ/B63odFpHEDBIqQ5+PhafR6q+Ip8gZORJJrNCTtpn3ZXtesfk9yjGkbdA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wQ1hWGu4FzwycKnJEss63nRaPUBFwK7LgzaBctECMBc=; b=zYwwrxZ85wgK13PMeogri3DEqmA0RDo0T+XypzETEBBrT2Z1SgX5ghKzFnfEJhKiMqG2c9F75su8bL8ew6cqzCDyBtwhWN9i25miThaGpax4xeKbvy91RW1q3rnGZ05nlnpVsX49ggWVbaDj30OfDLBemRJVrNAhrHju2YMw5F4= Received: from DM6PR11MB2955.namprd11.prod.outlook.com (2603:10b6:5:65::31) by DM6PR11MB3900.namprd11.prod.outlook.com (2603:10b6:5:19a::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.20; Wed, 8 Apr 2020 01:29:11 +0000 Received: from DM6PR11MB2955.namprd11.prod.outlook.com ([fe80::f1ec:734d:b127:4519]) by DM6PR11MB2955.namprd11.prod.outlook.com ([fe80::f1ec:734d:b127:4519%3]) with mapi id 15.20.2878.022; Wed, 8 Apr 2020 01:29:11 +0000 From: "Guomin Jiang" To: "devel@edk2.groups.io" , "michael.kubacki@outlook.com" CC: Kun Qin , "Wang, Jian J" , "Yao, Jiewen" , "Zhang, Chao B" Subject: Re: [edk2-devel] [PATCH v1 2/2] SecurityPkg Tcg: Use SW SMI IO port PCD in Tpm.asl Thread-Topic: [edk2-devel] [PATCH v1 2/2] SecurityPkg Tcg: Use SW SMI IO port PCD in Tpm.asl Thread-Index: AQHWDEI9FIWpJcR6IkuYeL8pZCdw36hucWwg Date: Wed, 8 Apr 2020 01:29:11 +0000 Message-ID: References: <20200406183422.37140-1-michael.kubacki@outlook.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: spf=none (sender IP is ) smtp.mailfrom=guomin.jiang@intel.com; x-originating-ip: [192.55.52.200] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: b1204680-975c-431d-ad07-08d7db5c3de8 x-ms-traffictypediagnostic: DM6PR11MB3900: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2887; x-forefront-prvs: 0367A50BB1 x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB2955.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10019020)(39860400002)(376002)(366004)(396003)(136003)(346002)(7696005)(186003)(52536014)(55016002)(19627235002)(15650500001)(26005)(5660300002)(107886003)(9686003)(2906002)(8676002)(66556008)(8936002)(966005)(53546011)(478600001)(81156014)(66946007)(64756008)(86362001)(6506007)(66476007)(33656002)(54906003)(45080400002)(66446008)(76116006)(4326008)(71200400001)(110136005)(316002)(81166006);DIR:OUT;SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: eYEYIFYMmgnwsrct58+pCPrkTWi2fEh/JBJPGerukpshcOQXMB0B1OK4Wn2uw6YOuBJo1C3IhGXXTEDmqD1okKkU/qAORgfv34DpVprZw2SYtW9pK5z5AH2p4lY51QUCInDlgo2xKYhSS6dvl5opB24g9jQx0rCEB4XHIGyjdykfDg+Fj9ltqboZLdrFB4RLTaujCgTXN9OoJ6VwXLJ3wtNBiX4HPAUFKXxTEWGO0mP1aF4CvSv8MkY3ATHop4dAIDpQhJZXuyKbcZuqyfBHYpiuRW1/4pN2n6iQncJs65jyPpdNNy3+TO/t+xGhBeMyp3Evth2hW+8UwuNie2V9MavsH4pdAWp0kYzGpRgc2R4nDAZG52OwBAMckOjZlC+9b4KPYdu4rJRxMljfruOgx0GD7v/5gH66iMXl8Q7CR64efeDjL5Cy9wKv7EWUxw2DUUkA+Sdz4yuAI9bYQ3deO32C9ryXSXDErpYg90rfqhZCL7jPABe9sooQzPaTcmy2pm6kJlxuUumxmCHDNEU3+A== x-ms-exchange-antispam-messagedata: Q6H1az2uEAvm5SyxlkPUcQXjO1/sN4slbVToeyMfm/zimp0fSYnkQ3ZqEy2NJ/ao4dRko9aYocQXo7tDtQB4k/pqjQRGpiP4LOQP3X5Q8Rgsm8MiSVdMjr3P65DJWouYzXZHtctcFKDLhPB+aUFvlA== MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: b1204680-975c-431d-ad07-08d7db5c3de8 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Apr 2020 01:29:11.6768 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +mwAjB2D+kBSCUcs/nWQB2Bg+rCYAw/0RcoTZ+yEga4eKZMPcHh+he7blDrEsQsSGXpnrY/Yi6KBRjRL2lF9mA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3900 Return-Path: guomin.jiang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Guomin Jiang > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Michael > Kubacki > Sent: Tuesday, April 7, 2020 2:34 AM > To: devel@edk2.groups.io > Cc: Kun Qin ; Wang, Jian J > ; Yao, Jiewen ; Zhang, > Chao B > Subject: [edk2-devel] [PATCH v1 2/2] SecurityPkg Tcg: Use SW SMI IO port > PCD in Tpm.asl >=20 > From: Michael Kubacki >=20 > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2416 >=20 > Replaces the hardcoded value of 0xB2 with a PCD for the SMI port access > operation region. This allows platforms to customize the IO port value i= f > necessary. >=20 > Cc: Kun Qin > Cc: Jian J Wang > Cc: Jiewen Yao > Cc: Chao Zhang > Signed-off-by: Michael Kubacki > --- > SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf | 4 ++++ > SecurityPkg/Tcg/Tcg2Smm/Tpm.asl | 18 +++++++++--------- > SecurityPkg/Tcg/TcgSmm/TcgSmm.inf | 4 ++++ > SecurityPkg/Tcg/TcgSmm/Tpm.asl | 17 +++++++++-------- > 4 files changed, 26 insertions(+), 17 deletions(-) >=20 > diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf > b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf > index e33cbcc49152..2ebf2e05f2ea 100644 > --- a/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf > +++ b/SecurityPkg/Tcg/Tcg2Smm/Tcg2Smm.inf > @@ -21,6 +21,7 @@ > # This external input must be validated carefully to avoid security is= sue. > # > # Copyright (c) 2015 - 2019, Intel Corporation. All rights reserved. > +# Copyright (c) Microsoft Corporation.
> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -70,6 +71,9 @@ > gEfiSmmVariableProtocolGuid ## CONS= UMES > gEfiAcpiTableProtocolGuid ## CONS= UMES >=20 > +[FixedPcd] > + gEfiSecurityPkgTokenSpaceGuid.PcdSmiCommandIoPort ## > CONSUMES > + > [Pcd] > gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid ## > CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId ## > SOMETIMES_CONSUMES > diff --git a/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl > b/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl index 7a91708a1a34..95f9d7eae841 > 100644 > --- a/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl > +++ b/SecurityPkg/Tcg/Tcg2Smm/Tpm.asl > @@ -4,7 +4,7 @@ >=20 > Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.
> (c)Copyright 2016 HP Development Company, L.P.
-Copyright (c) 2017, > Microsoft Corporation. All rights reserved.
> +Copyright (c) Microsoft Corporation.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -41,10 +41,10 @@ DefinitionBlock ( > // > // Operational region for Smi port access > // > - OperationRegion (SMIP, SystemIO, 0xB2, 1) > + OperationRegion (SMIP, SystemIO, FixedPcdGet16 > + (PcdSmiCommandIoPort), 1) > Field (SMIP, ByteAcc, NoLock, Preserve) > { > - IOB2, 8 > + IOPN, 8 > } >=20 > // > @@ -258,7 +258,7 @@ DefinitionBlock ( > // > // Trigger the SMI interrupt > // > - Store (MCIN, IOB2) > + Store (MCIN, IOPN) > } > } > Return (0) > @@ -359,7 +359,7 @@ DefinitionBlock ( > // > // Trigger the SMI interrupt > // > - Store (PPIN, IOB2) > + Store (PPIN, IOPN) > Return (FRET) >=20 >=20 > @@ -390,7 +390,7 @@ DefinitionBlock ( > // > // Trigger the SMI interrupt > // > - Store (PPIN, IOB2) > + Store (PPIN, IOPN) >=20 > Store (LPPR, Index (TPM3, 0x01)) > Store (PPRP, Index (TPM3, 0x02)) @@ -422,7 +422,7 @@ > DefinitionBlock ( > // > // Trigger the SMI interrupt > // > - Store (PPIN, IOB2) > + Store (PPIN, IOPN) > Return (FRET) > } > Case (8) > @@ -436,7 +436,7 @@ DefinitionBlock ( > // > // Trigger the SMI interrupt > // > - Store (PPIN, IOB2) > + Store (PPIN, IOPN) >=20 > Return (FRET) > } > @@ -475,7 +475,7 @@ DefinitionBlock ( > // > // Trigger the SMI interrupt > // > - Store (MCIN, IOB2) > + Store (MCIN, IOPN) > Return (MRET) > } > Default {BreakPoint} > diff --git a/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf > b/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf > index 29f9c15b0e02..9fac896dde8b 100644 > --- a/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf > +++ b/SecurityPkg/Tcg/TcgSmm/TcgSmm.inf > @@ -10,6 +10,7 @@ > # This external input must be validated carefully to avoid security is= sue. > # > # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved. > +# Copyright (c) Microsoft Corporation.
> # SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -63,6 +64,9 @@ > gEfiSmmVariableProtocolGuid ## CONSUMES > gEfiAcpiTableProtocolGuid ## CONSUMES >=20 > +[FixedPcd] > + gEfiSecurityPkgTokenSpaceGuid.PcdSmiCommandIoPort ## CONSUMES > + > [Pcd] > gEfiSecurityPkgTokenSpaceGuid.PcdTpmInstanceGuid ## CONSUMES > gEfiMdeModulePkgTokenSpaceGuid.PcdAcpiDefaultOemId ## > SOMETIMES_CONSUMES > diff --git a/SecurityPkg/Tcg/TcgSmm/Tpm.asl > b/SecurityPkg/Tcg/TcgSmm/Tpm.asl index 739067dbec03..9d5e6ddc110b > 100644 > --- a/SecurityPkg/Tcg/TcgSmm/Tpm.asl > +++ b/SecurityPkg/Tcg/TcgSmm/Tpm.asl > @@ -3,6 +3,7 @@ > and MemoryClear. >=20 > Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
> +Copyright (c) Microsoft Corporation.
> SPDX-License-Identifier: BSD-2-Clause-Patent >=20 > **/ > @@ -41,10 +42,10 @@ DefinitionBlock ( > // > // Operational region for Smi port access > // > - OperationRegion (SMIP, SystemIO, 0xB2, 1) > + OperationRegion (SMIP, SystemIO, FixedPcdGet16 > + (PcdSmiCommandIoPort), 1) > Field (SMIP, ByteAcc, NoLock, Preserve) > { > - IOB2, 8 > + IOPN, 8 > } >=20 > // > @@ -96,7 +97,7 @@ DefinitionBlock ( > // > // Trigger the SMI interrupt > // > - Store (MCIN, IOB2) > + Store (MCIN, IOPN) > } > } > Return (0) > @@ -196,7 +197,7 @@ DefinitionBlock ( > // > // Trigger the SMI interrupt > // > - Store (PPIN, IOB2) > + Store (PPIN, IOPN) > Return (FRET) >=20 >=20 > @@ -227,7 +228,7 @@ DefinitionBlock ( > // > // Trigger the SMI interrupt > // > - Store (PPIN, IOB2) > + Store (PPIN, IOPN) >=20 > Store (LPPR, Index (TPM3, 0x01)) > Store (PPRP, Index (TPM3, 0x02)) @@ -255,7 +256,7 @@ > DefinitionBlock ( > // > // Trigger the SMI interrupt > // > - Store (PPIN, IOB2) > + Store (PPIN, IOPN) > Return (FRET) > } > Case (8) > @@ -269,7 +270,7 @@ DefinitionBlock ( > // > // Trigger the SMI interrupt > // > - Store (PPIN, IOB2) > + Store (PPIN, IOPN) >=20 > Return (FRET) > } > @@ -308,7 +309,7 @@ DefinitionBlock ( > // > // Trigger the SMI interrupt > // > - Store (MCIN, IOB2) > + Store (MCIN, IOPN) > Return (MRET) > } > Default {BreakPoint} > -- > 2.16.3.windows.1 >=20 >=20 >=20