From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web08.7388.1647321406514768603 for ; Mon, 14 Mar 2022 22:16:46 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=eYPh/XF5; spf=pass (domain: intel.com, ip: 192.55.52.120, 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=1647321406; x=1678857406; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=AJ8Z9Jv/74EQuzdtijNsts1G8TRiPpV073T7exMwtuY=; b=eYPh/XF5J944AVW9Q1tmKuKWMRwb2Y8MgAlRyL8uByf1GeQ6E/gNrMqb PwmYFCts7GJPQd8HcU/nHV9anAzEWbpZaASUzrKMApeVUlIMtLxQWr+C6 E9grpsyuaa65ShHn6/M54dqp0wlk3Mn+eOhNQaV7SHDN7iU0s+eImzmh+ 5XVjdt4z9B7P9bXN5SzwqwwNzWS4ScV9Th1Gu6m9cAbNOO5rQP2c5PReN NkyWf09DhsEkEiVRw2LBy5XBIJcjqMPgoaKlMxqjT0vWzakcLM4y0CH/s +du9YUDnsYAjvl+ActszDdTqbxJsClVfDGWcZBZfgl/3yCnmWFJDLxaez w==; X-IronPort-AV: E=McAfee;i="6200,9189,10286"; a="255045628" X-IronPort-AV: E=Sophos;i="5.90,182,1643702400"; d="scan'208";a="255045628" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Mar 2022 22:16:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,182,1643702400"; d="scan'208";a="556762398" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga008.jf.intel.com with ESMTP; 14 Mar 2022 22:16:45 -0700 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 14 Mar 2022 22:16:45 -0700 Received: from orsmsx605.amr.corp.intel.com (10.22.229.18) by ORSMSX608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Mon, 14 Mar 2022 22:16:45 -0700 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) 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 via Frontend Transport; Mon, 14 Mar 2022 22:16:45 -0700 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.170) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Mon, 14 Mar 2022 22:16:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LuM+j311BTqVQVET3KcB6kR5T046xI61GTwCJ4WCVPIT0cK7mD54MY68sJeYDnIjBkXNJpfd8UZGej0Fz3PcQh7JNuS3LALzO8tMhEAAZfMJKXExErbjMfQiU6xXvXe9u+jWGdIkawgAAZxKtZk1HkaFrjbkKZWa2LguY3EQ2RnlkF22DQNksCED0+TSIew7Ahup2pkTwxauxgTdZ1/g06izqgBjC+5bS0RPyX1B2ocuU/y94281uS4CxY1SVIb8cRYJhsfizLHijbZZNFiuD+hKuFArhXCt2cTBeL20zjWHnf5YlnbTCMXcuFRk6EuuW15hDfg0KuO4iX+ZmL5Ryw== 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=sSojhv7B/u6bGFZceXTHxeVm0fy8rLLXKcKK9Rm+PIk=; b=hR8Z1t7x9lb0FgEqBeABr9uRxZSe7fVQ0+DCvrA13+wKR5HESgKp82dCx/h46lISB9AxST1FJ2METmLQaMwwemxrBk47tvnDZe8/mPMUcoLpL5oUVFEUAEEeyVEiWMY6hjiFC2VdDdJk1EcRf5/zAnLTCXslGCxdGl0wvIbd8LD9E4Hquwdw/RwcvxFsebf6i7LwTLTwNICDCH/pqvBa8qo9iHFXsS1Jbl2j98rpNEZW03LZpAtupNH5nrjwHcsz2PUnDywUpDmuyzCyU8OUmOJdUnMr6ADV0lgBiPxE7Jvaz3h/r+h7CmDf9vqRHR26Wler61G9EcqZa1uVBje9Bw== 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 MN2PR11MB3824.namprd11.prod.outlook.com (2603:10b6:208:f4::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5081.14; Tue, 15 Mar 2022 05:16:42 +0000 Received: from CO1PR11MB4945.namprd11.prod.outlook.com ([fe80::2598:e534:2ebb:782a]) by CO1PR11MB4945.namprd11.prod.outlook.com ([fe80::2598:e534:2ebb:782a%4]) with mapi id 15.20.5061.029; Tue, 15 Mar 2022 05:16:42 +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 V8 35/47] MdeModulePkg: Skip setting IA32_ERER.NXE if it has already been set Thread-Topic: [PATCH V8 35/47] MdeModulePkg: Skip setting IA32_ERER.NXE if it has already been set Thread-Index: AQHYNbRdzh2Smty+MEmY9PP6dNxD+6y/7D+w Date: Tue, 15 Mar 2022 05:16:42 +0000 Message-ID: References: <1360ca9d6b825d8f445643b76d49ceb8ca629a80.1647047482.git.min.m.xu@intel.com> In-Reply-To: <1360ca9d6b825d8f445643b76d49ceb8ca629a80.1647047482.git.min.m.xu@intel.com> 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: 96affd2f-2444-4475-ed52-08da0642fde8 x-ms-traffictypediagnostic: MN2PR11MB3824: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: SHQZ2kqOO98qoPWocXK+b9lB87Cp21eRUMuCslwPt9fCwnKRIZ4OoyyxXMAlim43IEYBI4rUjN+SUPq4YpyzOqx/dXL23dNsOeNLKfxV+rzNhNryjiJuQxH6fq5QrjGaYZUlvietMKKbRnVvma2lYXRN7HpILo82xTiFWHaY3w6tDsFDw3bQ2S4bPTWVce0dEuOz6vn/IMFOnxBKYZeIe/tZBlszAPmbfF9KGqcN4PN3EmpgBCvNnKKo3yrthDUP0YOz+2T+91/3CaK2Y72ECdOT2SDzGCrx6O0Kr2qx9Vwl7CgkCF6hLDnyB7akt6QjiS7NFtw7EvvqmCIKGW/JryVVirOIcyHGnA97rhNdDDAwn7uAcOdp8+D0cwqGAN3T5LjNT5xR2cbQsjfQeP/7pPUfaRjWpVTVeanvNdW3SWPmUV1OZqiUVo6zd+xWRVPtaVWxilpVAkZBgjwubPImPBGCONsl2LSvuZGUARvEqbCSWuNTrVz3vsE6E4adrZm8s8MbLW1B9IR0QG/dPmzLGBoHAGM7YGYqLsRnAktLgU3lax/R2eyM8ofMi130mhTlDAMDiFf3525mYpm+glGFrtpfcUYHeG2iysIpvhdh3nkhlq4WdQz19u468LLkDoSW7aUR+4ILtw+7mb9xtD7WSl5OnYJMb+SKC8Q2v77NkibbU9n2hHd0D1BNC/UXLfHqEup64Oe/DikPXlVvs7VS8/qkNsKsCdJ++falzP5TwHeW6XtXeKlDz2fmyDTxRQCKAQAI8m9VBwn2pAee08Hj0zAHd1Okt+rYcLwUDJZ1J/M= 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)(6506007)(53546011)(7696005)(83380400001)(9686003)(76116006)(52536014)(33656002)(110136005)(5660300002)(8936002)(54906003)(122000001)(38100700002)(86362001)(316002)(966005)(19627235002)(71200400001)(4326008)(66946007)(8676002)(26005)(186003)(38070700005)(508600001)(2906002)(66556008)(66476007)(66446008)(64756008)(55016003)(82960400001);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?OPUbl1jyj4xyD3L1JU5HX3Ovu41xYzcn1PokROVguViPVxOQUHuQRMlp1NiY?= =?us-ascii?Q?m9VzdOKGqCootXSLTPZKdWyOssAVqE2F0W7XpSLS00v+7yAFTim5DjeQA1mG?= =?us-ascii?Q?mUP22ZvuLzQCvfy2yPWgtCxHXj4b/7LID7rfpGC+aps3kAnlQ2nuao4uMEt5?= =?us-ascii?Q?MutDgwvonyACQmG1xKS32UMFDDNF0mnTYXGHLAub0X+DImT9qkFFWqZ7UBMM?= =?us-ascii?Q?B8QEqQWPCHbrcRx0CDPVkrJFnUH0y13QNjDA1/+H8OdBLXAlh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BqxNq2ScrXNd+gcQh8VtABG+mVSyg828ZlT6t7rkczhnq?= =?us-ascii?Q?piYMdCKlE/X8KaWmaHW9EdsUfkJyxyKdtMxZTiHoiSQu/oTrYsirdEIng7Ue?= =?us-ascii?Q?VhGNyZNHiGh78CM9VxchfoHdB9+AcUAMa+JA0EubE/7k15Y8mb1Xhn3pgmD7?= =?us-ascii?Q?nQl0a+215fw00QmgfGAUcRkixs8Dd8LrA9gfnZb2zZN1Qy4qU1ELbXeA+y+2?= =?us-ascii?Q?jynPfvE90pHxN6i7DqdhxOVrOkSkgKf+1nphz4w8kMs4v9X+Yol9kLUQK4vM?= =?us-ascii?Q?tmpd+rETDYWGeQddlVqIb/98QxLDLPIT?= 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: 96affd2f-2444-4475-ed52-08da0642fde8 X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Mar 2022 05:16:42.2605 (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: ZBY752OaqXFC1oYYuJlJtVHFhS6QZ9qJPrHu+8j8Dp70zymcZunOhyAhtIys+AWQEyosZtEga7PyaTLnS2nMlg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3824 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 Reviewed-by: Jian J Wang Regards, Jian > -----Original Message----- > From: Xu, Min M > Sent: Saturday, March 12, 2022 9:54 AM > To: devel@edk2.groups.io > Cc: Xu, Min M ; Wang, Jian J ; > Wu, Hao A ; Brijesh Singh ; > Aktas, Erdem ; James Bottomley > ; Yao, Jiewen ; Tom Lendacky > ; Gerd Hoffmann > Subject: [PATCH V8 35/47] MdeModulePkg: Skip setting IA32_ERER.NXE if it = has > already been set >=20 > RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3429 >=20 > If IA32_ERER.NXE has already been set, skip setting it again. >=20 > Cc: Jian J Wang > Cc: Hao A Wu > Cc: Brijesh Singh > Cc: Erdem Aktas > Cc: James Bottomley > Cc: Jiewen Yao > Cc: Tom Lendacky > Cc: Gerd Hoffmann > Acked-by: Gerd Hoffmann > Signed-off-by: Min Xu > --- > MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 8 +++++--- > 1 file changed, 5 insertions(+), 3 deletions(-) >=20 > diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > index 0700f310b203..bb426d0d0a6f 100644 > --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c > @@ -179,9 +179,11 @@ EnableExecuteDisableBit ( > { > UINT64 MsrRegisters; >=20 > - MsrRegisters =3D AsmReadMsr64 (0xC0000080); > - MsrRegisters |=3D BIT11; > - AsmWriteMsr64 (0xC0000080, MsrRegisters); > + MsrRegisters =3D AsmReadMsr64 (0xC0000080); > + if ((MsrRegisters & BIT11) =3D=3D 0) { > + MsrRegisters |=3D BIT11; > + AsmWriteMsr64 (0xC0000080, MsrRegisters); > + } > } >=20 > /** > -- > 2.29.2.windows.2