From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (NAM12-BN8-obe.outbound.protection.outlook.com [40.92.21.38]) by mx.groups.io with SMTP id smtpd.web11.80.1586198127739440033 for ; Mon, 06 Apr 2020 11:35:27 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@outlook.com header.s=selector1 header.b=jYiW40fI; spf=pass (domain: outlook.com, ip: 40.92.21.38, mailfrom: michael.kubacki@outlook.com) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U28fy2JoEoym96vUEcv2Bvt5e5P2+gEoWgRKEcTgK5pOdExHbms9TVoXPB5iMwgiuZqGLHgy2cUyN3N5FS6bCSyMXJe0+0g+8vPW0LNsdB5BBV4zkD/NEZNwqlHbvic6xDQ6VzhScfks3SLckaXct/Y3UEdkGmKxViISCF/h88izsd7I0/hipU2vMtRNgWaGkLbfuKczYewzB4YuyNPvL9rbthPCCU5hVG3CcVl2k0t4n1p5QX5xp8upeOMkCeOADnfjHpItzFiHk+KsCr87FCPz0+nkfiHJxBCCqTyDYwybWL7oNYUPV0RE7f6ZCbg+IF9jt8Byreph3qUVNSxrOQ== 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=s/FjYOaGPEtSiMKOXPIa7UCBaZoHPQdrUxam1Naxd1A=; b=k2dmpJAOo3D+Ep2WUh+/+1iCywFDRS/msDQa1D30mcSTOn0MhmPId0ocEwCGf9+X3ipfb/pAtpUxGP2u+uWJi4TJ6+ES9EFeIdQQH+mkySxciUaEaEoqeQDAbwyaLHV98vRuitPh18N7nPbKh57PH6usILVS1DelyDyApmgvIzDjSweKHSI7CQdVwLgbaQQvFAX9ySQK0mIyU8pA9vS6pYsKhgdGaTAkndVVTDDUrVhsvwvRuNok9wBpf/u56cq4M4/gSAqJrnOBNSWvnMHCSY7zXWn7ioDPGTI/p9oeK30UkjUj20ZPjZ5a09SJJRH2E1qM+so1o7dIg9crO+IUOg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=outlook.com; dmarc=pass action=none header.from=outlook.com; dkim=pass header.d=outlook.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outlook.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=s/FjYOaGPEtSiMKOXPIa7UCBaZoHPQdrUxam1Naxd1A=; b=jYiW40fIsvMfkL2wjZDkiWJ1HxephqfC7ZeKfCK4x0W9c2XMiHlWQ84AoSoCH2gA2w6qhg5G8TqglSWEt+2jXVoGUmkSV6Ve/2sFDRDJowSsUumOB8UN0DqoBWfdyPjLtdl9zEDTPXFRYGHtP0yOyd9PvfwxFpSRfwj0uO5cIfWk+wTlRqHAZrbe2WWfODAImliI258KtumwQRP8k6a7frUJWhegAkrH3fGSddLh/oSG8pKPdUMeKRD7+nHS1ggWuGGVXP80nE2mM489A3gifRhx2iDA89zqfcya/wmNNFqahXXX3IRz0w4YysEZScRuOGDFBVM2/P7Ucj4uLc4VFA== Received: from BN8NAM12FT066.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc66::52) by BN8NAM12HT012.eop-nam12.prod.protection.outlook.com (2a01:111:e400:fc66::210) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9; Mon, 6 Apr 2020 18:35:26 +0000 Received: from MWHPR07MB3440.namprd07.prod.outlook.com (2a01:111:e400:fc66::50) by BN8NAM12FT066.mail.protection.outlook.com (2a01:111:e400:fc66::317) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.9 via Frontend Transport; Mon, 6 Apr 2020 18:35:26 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:9500260F4FC93D1CCDEDB0308430684CAE1C5217CAD2679922BF4DAAC6D342AC;UpperCasedChecksum:AECF84DB375B8A5DEFCCDF3608CDEFB3CFAEBC8CC1AFBB631F7C73F86EB12EE4;SizeAsReceived:7802;Count:49 Received: from MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::f5a7:e51b:e22a:959f]) by MWHPR07MB3440.namprd07.prod.outlook.com ([fe80::f5a7:e51b:e22a:959f%7]) with mapi id 15.20.2878.014; Mon, 6 Apr 2020 18:35:26 +0000 From: "Michael Kubacki" To: devel@edk2.groups.io Cc: Kun Qin , Jian J Wang , Jiewen Yao , Chao Zhang Subject: [PATCH v1 2/2] SecurityPkg Tcg: Use SW SMI IO port PCD in Tpm.asl Date: Mon, 6 Apr 2020 11:34:22 -0700 Message-ID: X-Mailer: git-send-email 2.16.3.windows.1 In-Reply-To: <20200406183422.37140-1-michael.kubacki@outlook.com> References: <20200406183422.37140-1-michael.kubacki@outlook.com> X-ClientProxiedBy: MWHPR12CA0067.namprd12.prod.outlook.com (2603:10b6:300:103::29) To MWHPR07MB3440.namprd07.prod.outlook.com (2603:10b6:301:69::28) Return-Path: michael.kubacki@outlook.com X-Microsoft-Original-Message-ID: <20200406183422.37140-3-michael.kubacki@outlook.com> MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (2001:4898:80e8:1:461f:d88b:af08:9ab9) by MWHPR12CA0067.namprd12.prod.outlook.com (2603:10b6:300:103::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15 via Frontend Transport; Mon, 6 Apr 2020 18:35:24 +0000 X-Mailer: git-send-email 2.16.3.windows.1 X-Microsoft-Original-Message-ID: <20200406183422.37140-3-michael.kubacki@outlook.com> X-TMN: [hMuuTZgdrZQObDEV2ZlXQeiucMuAHpsDIAL302odSAJhgKtntOmojqeyTtxqX8V0] X-MS-PublicTrafficType: Email X-IncomingHeaderCount: 49 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-Correlation-Id: 4e6af437-2539-413a-d6a9-08d7da59458c X-MS-TrafficTypeDiagnostic: BN8NAM12HT012: X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QK3WxgYREVz05/70Ag65kZqwgf9u/+ugG2r9oDMgl2KB4obiIWyoEFSHVhWX1dyXzzi57VP8dqxYOO45PtoFVTGpkdnnwm+92PND9GKrMTNDXmYAHrE2aB3L+FoT40jT5PmwYhYYm7VHKs7bqbVv7nS8vMWOQmm1J2CsoH3MJqqQ/QpHWkA68d4ppUnhcXPeW8c0F9tyDTdagynRtV2pxIYwsqAS6aG73J/r+U9oCbs= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:0;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR07MB3440.namprd07.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:;DIR:OUT;SFP:1901; X-MS-Exchange-AntiSpam-MessageData: cCAHpdhyEzqdH8EvdqMfzqy8EAm4d2wIVBs9NDLFSyqw5Pca2P9GBtvhAru1/PG/BSmixn+5Vi1+lW5n1eCK/8CPAFXcC21hHm8eW7pu8mgaJBLEkiJ2o+LFAWvie6fDdLXrX1DxIrBsss3Jhp1hy2br6UjBCwwnoBykBvo8sF23Sstf9xilRZz88oH58yRz4pwKuR0EYGHATApI21CRpg== X-OriginatorOrg: outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4e6af437-2539-413a-d6a9-08d7da59458c X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Apr 2020 18:35:25.8311 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-FromEntityHeader: Internet X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8NAM12HT012 Content-Type: text/plain From: Michael Kubacki REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2416 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 if necessary. 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(-) 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 issue. # # 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 ## CONSUMES gEfiAcpiTableProtocolGuid ## CONSUMES +[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 @@ 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 **/ @@ -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 } // @@ -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) @@ -390,7 +390,7 @@ DefinitionBlock ( // // Trigger the SMI interrupt // - Store (PPIN, IOB2) + Store (PPIN, IOPN) 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) 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 issue. # # 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 +[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. Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.
+Copyright (c) Microsoft Corporation.
SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -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 } // @@ -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) @@ -227,7 +228,7 @@ DefinitionBlock ( // // Trigger the SMI interrupt // - Store (PPIN, IOB2) + Store (PPIN, IOPN) 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) 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