From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mx.groups.io with SMTP id smtpd.web12.2487.1646357804428918628 for ; Thu, 03 Mar 2022 17:36:44 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=iS1A9+BP; spf=pass (domain: intel.com, ip: 192.55.52.115, mailfrom: jian.j.wang@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646357804; x=1677893804; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=zAmmWRSYkRzWoXdRZE/q2pOlo94CZ33bjh+aV0jm6VA=; b=iS1A9+BPh0J/ak4VDDG/qZQeHhmEtAv0mYmZHcbETdujpSMztO0gXRC9 kClujSHS+jFq0R/6G9K1BTje3BtXm3ODZb0VHGayHMT4w2pdWwAV+/Q9H +tGXqeuYojbOVAvxbgvuSLFYivoCUKAskzVMoTuqDPfwfPBLfVlVB/d2f tczEUKkK/CfwPF8z32A0ZyhnrKU+t3fDRtKmTBjZ5+CA4ewwxk399i5oZ u0xuTS2IQQZft27vm3S2qJSVPV9T0PVMNGxNUWx1T2n2Qy6P3xqVU5NDF RBG0QnQdMFWth9mDtQjtJtBRlnhhtEzeEv/UPeCf+hujvTXhIbhSngQGD A==; X-IronPort-AV: E=McAfee;i="6200,9189,10275"; a="254058612" X-IronPort-AV: E=Sophos;i="5.90,153,1643702400"; d="scan'208";a="254058612" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2022 17:36:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,153,1643702400"; d="scan'208";a="810109461" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga005.fm.intel.com with ESMTP; 03 Mar 2022 17:36:43 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 3 Mar 2022 17:36:43 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 3 Mar 2022 17:36:42 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Thu, 3 Mar 2022 17:36:42 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Thu, 3 Mar 2022 17:36:42 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A0n2iBaOl1BC/CHw0AC+1+jiR34l0sa/a8mIXtugafIxfAX40DixhRX+sUMVRbQlv6g05d2+3uQTZpcihOWzTINGHJfh2ihyVhHPtqpJwl5fmC5jp2b5cJSF04SBGjt8HQBDKXE/lGYlNN9NubvcZojsael4xVvOY24XWabqTYWNtrVKvx7LjUW99bD9dMVx8vgjQzjrmEvhAsPBJafR4DWRE4kPVc3y7P+NXg0FSuaT8+3fIM5M6Or0Wy/HQS+Zl8FEIBivAySJcR7z30YvRURfV4AmY3aVriU2NqrE46HBFRaDVwpUExdVXL7MkCmdh8QOiLKj98DYPEF/+qqbCQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PUkPB9a+GPMycMOH5NPlGWqsZYuNUx4nVxpKZegmDZc=; b=INBEuSA6K+jPro7kB4YkyA9X+Cp3+aznFYXc1hq2mH3kBUm7tJbu7MW6HV8Q7+nxDxgvoRtuHJvhq4wnz8kdZu2cPlgCPNtDKDttQidZjYRDStLmT37IQsj1J0Je3DgEevwlYYj0Ffx38vsHyiLlx9r2EZ04S01+PZaQUn4JcdKVLv44NJTOZwMWoyabDaBF6eFSUd4z23oqd8frSFqigdkIpfFSvoIHDCieEAtjp5zCtyBV3zbLsjD3YCD8/JwXSbTw9nAR7LidgakHmJRKMqWYg8Heb5riNEvZSEDsIiJWf3+5b/lTX56rWrp1McnhE2k66SViVZCwXPwbDjnmyg== 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 Received: from CO1PR11MB4945.namprd11.prod.outlook.com (2603:10b6:303:9c::8) by BL1PR11MB5238.namprd11.prod.outlook.com (2603:10b6:208:313::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.13; Fri, 4 Mar 2022 01:36:39 +0000 Received: from CO1PR11MB4945.namprd11.prod.outlook.com ([fe80::c9d4:be7:7abc:48c0]) by CO1PR11MB4945.namprd11.prod.outlook.com ([fe80::c9d4:be7:7abc:48c0%4]) with mapi id 15.20.5038.016; Fri, 4 Mar 2022 01:36:39 +0000 From: "Wang, Jian J" To: "Xu, Min M" , "devel@edk2.groups.io" CC: "Wu, Hao A" , Brijesh Singh , "Aktas, Erdem" , James Bottomley , "Yao, Jiewen" , Tom Lendacky , Gerd Hoffmann Subject: Re: [PATCH V7 25/37] MdeModulePkg: EFER should not be changed in TDX Thread-Topic: [PATCH V7 25/37] MdeModulePkg: EFER should not be changed in TDX Thread-Index: AQHYLHP4WVHlFBPgZkOI6nY/jREcn6ys/lJwgAFjpQCAABTFQA== Date: Fri, 4 Mar 2022 01:36:39 +0000 Message-ID: References: <639b222086067437c7613d942f36adf0636376b0.1646031165.git.min.m.xu@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.401.20 dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 16c69f2f-7590-47e1-c3b0-08d9fd7f6dfc x-ms-traffictypediagnostic: BL1PR11MB5238:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ll1b/uiADtifCYe8Br+/Vryk37zimaH8uux/9Xod0NwjWy4hBfcOi6t2dT7I5i9toVVxCz9/HaNE71DP6S5aQ+AMsMQg9DV1gutkVESsz0cm7Thwqt+BxiJkomQ0Ql8xNsM8zaoEUJqeEdwz1kPsOwS07Ttca2ygb85eqQhub2HjDYquOWm7nB0bOqr0GAqw/CbDsLxc0vGR5rb8UEPRtvpnqi39T8UN3zQOcnq8xuA5IEhDIi5cKv9/MdQVW0q8ejqF9S5DAxS0ibJRQaJ0A7ctzVWpDY9aL8OJwKTZT9YDJ7FrIiCEgTqTridprEvg36vOrjPkKHtB3S4sPNc+dwBD45O+W28M/67Pr2cUHW4CGVmU4Cixb6IOOA3Ob6MuNwZELWoJfkeKwNIi1p2nQSAxESGSCKK+6WVD69Z1eLkiGFGNZFU+AzaHGDF0gqdSMcTmnXDLQ1K7lKGgCUgC88Oe9rvWg9c+YOY4RkoNONBFYfZgMwq0pqJN+Wnql13Q73YIsHaf/NHNzi+jYcZ/YVUWk8j93ARHT3jGMurlrN2Y9U1fJiXWniPwo743/JI+a4LQzjxDxyT87N+wEKt/wkfJrLuhZ5Q0gpwSdzExo0V2Bxb7texOfLwGqR80hrvAY4qhhpBz9pSYj92oWtmDlGws0JIvMqup/RZ4uYGbaqEVgguf7W1rVVFOoMavQLH9aujwBU28n46mJCtfwDQrwCmaTvbiVtB25iWnTWMawYLLpFfaQKPxkK/qCwGi7oXleY4J06ILWRdGV84suxDyNgG5RLJLMrIbOwmN+la0nrE= x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CO1PR11MB4945.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(66556008)(66946007)(64756008)(66446008)(66476007)(4326008)(9686003)(53546011)(55016003)(966005)(71200400001)(7696005)(6506007)(76116006)(5660300002)(8676002)(83380400001)(2906002)(38070700005)(38100700002)(122000001)(8936002)(82960400001)(86362001)(52536014)(33656002)(316002)(186003)(26005)(508600001)(54906003)(110136005);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?z7rgmcePDm9w5B+AaOSPpAy8lmoN/S9friB6fJaNQcS8t1dw0mKHP8kFu/Z8?= =?us-ascii?Q?et6SBgCxdvLyhLTOLU+xloOy7t2Mh5/2xu5WrpVNdjp8UNwr6Z8EbV9KFalr?= =?us-ascii?Q?PhcHlYBEurJDV9KgUtCtotXOv6g/dgQ8m+aE0k1dAy/2myD4zOaq7eMj4JBS?= =?us-ascii?Q?Zh9R1oLm5OdnFj7kDi6sM7Fw3EOzQxbT+zSCT6HeGzJhWbf7y5F73A1Dse6H?= =?us-ascii?Q?OhOphGDS1QX2KAVfjT6Yamq72MksIIUmMAJtNk6DQh536HkCSNST0wHYsG88?= =?us-ascii?Q?OP67GmWZoWrsy5gWw60nD3aLzv9y+b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K?= =?us-ascii?Q?A1vhTL4lRrOghobii8OY5meYofPjjjcdalu+myy+BHx0XfLSUNUIqxMYZo+0?= =?us-ascii?Q?G2g4s/iAtvxqDbRVgYz4RHMkEHBe6PWHYvZ2RVjnsfX1dkaZPmCYJ3ikjreA?= =?us-ascii?Q?19v9F+eZUtEIZ01q/p49QMY0130/VqhsJ8SPMDNd/HAFqemUZYCawcYOJ0yw?= =?us-ascii?Q?iYupqEm56F6tsncGytlYWRv7wxKZkFKZ41fXYWq9+kAkPwEqTJicmAEufa5r?= =?us-ascii?Q?oD6s8sl62NG78B8jODebXiJp1NkjWI3Z2jeOESS3Mzhgq0g4oxEn0Xt3S+xe?= =?us-ascii?Q?KJc+s/a0lhFcTWcmKG7NOSgOdmReLXxJ53PeCUG6Ze0AHj05KX4St6e5Jlrm?= =?us-ascii?Q?A5fLT4En8RS6JCsRtonT8N+AS8E1byJARXfg5uiJj0CU9bT7cVJAhWPoSKCy?= =?us-ascii?Q?6E9mj3AQ/QTWlpCBBYYZLXM=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CO1PR11MB4945.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 16c69f2f-7590-47e1-c3b0-08d9fd7f6dfc X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Mar 2022 01:36:39.5727 (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: Hs2ltaBthqY3Q5p1vYX7jxKL3DKH+LKSeR1IyURx+UiRWIAf6vBtjHyiz0wtmCUq859ZnG2vIv5G9qwzUOXelA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5238 Return-Path: jian.j.wang@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Ok for me. Regards, Jian > -----Original Message----- > From: Xu, Min M > Sent: Friday, March 04, 2022 8:19 AM > To: Wang, Jian J ; devel@edk2.groups.io > Cc: Wu, Hao A ; Brijesh Singh = ; > Aktas, Erdem ; James Bottomley > ; Yao, Jiewen ; Tom Lendacky > ; Gerd Hoffmann > Subject: RE: [PATCH V7 25/37] MdeModulePkg: EFER should not be changed in > TDX >=20 > On March 3, 2022 11:12 AM, Wang Jian wrote: > > > > Hi Min, > > > > I think the PCD should not be dynamic. Dynamic PCD is used for those > > features which can be changed at boot time. But, for Intel processor, i= t > > should always stay as FALSE. So there's no need to make it dynamic. > > FixedAtBuild should be fine. > > > I realize this PCD is not necessary. According to [TDX] Sec 10.1.5, > IA32_EFER.NXE is initialized to 1. So in the function EnableExecuteDisabl= eBit @ > MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c, we can check if BIT11 > is set before calling AsmWriteMsr64. It looks like: > VOID EnableExecuteDisableBit ( VOID ) > { > UINT64 MsrRegisters; >=20 > MsrRegisters =3D AsmReadMsr64 (0xC0000080); > if ((MsrRegisters & BIT11) =3D=3D 0) { > MsrRegisters |=3D BIT11; > AsmWriteMsr64 (0xC0000080, MsrRegisters); > } > } >=20 > [TDX] > https://www.intel.com/content/dam/develop/external/us/en/documents/tdx- > module-1.0-public-spec-v0.931.pdf >=20 > Thanks > Min