From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 9E99674003E for ; Tue, 21 Nov 2023 07:54:35 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=TgjCO+m2jmIvmDaMqkNzSP4lswIaoy4D+nMVV3VsBB8=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1700553274; v=1; b=KCyQK32zrm+T7eak0wB9VQjfHlJN/hfZmyHjzyDpdsidnryqHADTdoO1mC2/br7a7fz8NaNk a0bQU7RcLT/6W4QbFjyW9hLeWs199rEhlN1eVW4zqHs4+RFOSiv7PYVhylsUorNq1zjaRebjueE 7O+Lu29q7hP8PBxQc3mzZV18= X-Received: by 127.0.0.2 with SMTP id 2Y7FYY7687511xfH4nyC789n; Mon, 20 Nov 2023 23:54:34 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web11.30957.1700553273546074013 for ; Mon, 20 Nov 2023 23:54:33 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="382182281" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="382182281" X-Received: from orviesa001.jf.intel.com ([10.64.159.141]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 23:54:12 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="14425827" X-Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orviesa001.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 20 Nov 2023 23:54:12 -0800 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2507.34; Mon, 20 Nov 2023 23:54:12 -0800 X-Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.2507.34; Mon, 20 Nov 2023 23:54:11 -0800 X-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.2507.34 via Frontend Transport; Mon, 20 Nov 2023 23:54:11 -0800 X-Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) 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.2507.34; Mon, 20 Nov 2023 23:54:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=l10Fd/44bQrJNBTfFfbjBeEoG5sWz1C8Jt+aHrUDFDpeXxGVTco3DoaPiEncSvpL/xOj+7ooaL7Aa+0NmD6/05H4oUtNBF73ke8RFUTlDnayN4MHpZH1bHWvqTAZc+cMN1qtmxUxbw7AowHG4gg3D+OR/3fyKHFogcYN+eN05Z2JsG1dz7VYmaD8iHP3trOC7IVzqfuXlgEkGQNZVb42OqDcX6UHVr/IKr64o4UjRP7nlgWu7WitJUOc5wl+Z/d885m2NVwhxi26QMYsg/ZDC3Fhf/5dhD0yU7TFoecPyVps3b+tqWvWtkLcxB72OVyOael7Hu040P6RAVHr8pw1VA== 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=0rX8W8ZjQ99brXyFtdgTh+mj99mj4IjoZbs2kW1U2Zo=; b=Z+8WvDhxeM6Vac2o80LyeiDc3XrWn/aqcHOFGW5QOhZVU4MLsWOYEEbjSmomdC67DSHzDT0WF0HCHRQx9p3RzG8r90hu2iCoDgs+qU92vsgQq1oKwflinyfSUHxLi8rXZWkkIGobEqqb5Bx3czdUC50ryj7c5ERn9TlWmTBupzZpuiYjKqiAn14sMEby9gCfeUq6r3BeJUJRIb9A/xGzl/fzVKlEANU3piPipr3nWtlvs+3ZK9VbBw8pxO62S0YpA+9i6TDomKUYEzB+jNKPRYaja71Vh19RMU0HeLoD/kjVHX4L7WESaCfzGYVJSMDxeWw+j7kylqrUkVcG+Sat2Q== 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 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com (2603:10b6:208:470::14) by BN0PR11MB5695.namprd11.prod.outlook.com (2603:10b6:408:163::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.18; Tue, 21 Nov 2023 07:54:09 +0000 X-Received: from MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::b614:1f5e:8b0c:9858]) by MN6PR11MB8244.namprd11.prod.outlook.com ([fe80::b614:1f5e:8b0c:9858%4]) with mapi id 15.20.7002.028; Tue, 21 Nov 2023 07:54:09 +0000 From: "Ni, Ray" To: "Sheng, W" , "devel@edk2.groups.io" CC: "Dong, Eric" , Laszlo Ersek , "Wu, Jiaxin" , "Tan, Dun" Subject: Re: [edk2-devel] [PATCH v6 6/6] MdePkg: Use macro CR4_CET_BIT to replace hard code value. Thread-Topic: [PATCH v6 6/6] MdePkg: Use macro CR4_CET_BIT to replace hard code value. Thread-Index: AQHaHEjKjb0sAA9XF0iQxBeqwVS0a7CEZw9w Date: Tue, 21 Nov 2023 07:54:09 +0000 Message-ID: References: <20231121070246.505-1-w.sheng@intel.com> <20231121070246.505-7-w.sheng@intel.com> In-Reply-To: <20231121070246.505-7-w.sheng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8244:EE_|BN0PR11MB5695:EE_ x-ms-office365-filtering-correlation-id: 55a34865-fbba-414c-a4ed-08dbea670b81 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: otYy012/pQ4XVMQj6/shH8RlnjjRLGg28x/08GOO12Qd9vB3w4qaG8/J8671DU4jP+KVpvsaP7lkCpse4atGnr/T5e/23eRyyBPEengzO73i86ZRavRrnQRxCiPXxkBLCudiC2IudA/go85vF7CTVkvAID5J27f5EAs/UdfWLjIDZumfSFWHSxz16rvEAMazkqpAjTHToNMPk0U3FrxioAvJBqUL8dRuq9sJkbSujkMxClMy4v1VvEMM6BRWGdKCaFfB/YdnY80kheFhe6DJzKYGAkrUGr0cnwnvOgA3ZmW/slA7veesOtI3ODvlMJW16/+OQAhXYy2eYt9yOYsW+vBDf3ABIrLGPzK+x3fMmUlLaCs6ygKa67QB+2R0YJqQ+x8263fhmQdbLeP6AhJ65856hGHa0yb10rA/rHL7sblIcOXMFItZzBpnRqc5v9xOhkPZTavnqznNHcwO0vZ+Mrd3Gov/H/gJUDD13BJao87hHeprnC5ovmeCh1HWpMRim+hR/NZ59iokFgDnDGieLXaok227wv8PLqnuB9YBjkDg5V+ACnz44tgdxCvaWRL31GiCvacB+ga6iBp6U3EFdprBk/RSt+rpgBrsAS1/yT7lDuGJ1Z5DLYIfszBqc3Zu x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?8C6mAAAjzOEyB2COZrKD+OBDVgyUmcRRnx1KB8MotF/5CH0k5RRydQqQGH6y?= =?us-ascii?Q?WEVTx17qCj6va1hclT2MnRWhBKFzcAI2R/BHKfdgu/X5VFgiVzA6e6zVr8Ue?= =?us-ascii?Q?Pjf0t8/fsViVXmZ0mBzZX/sQRXyGvr4e7t/eYWIOHjy72D8cdrHULhDHR/cL?= =?us-ascii?Q?olwk22zvaXf8Xoenbu0vQme+hw2+HJC2hAv8Cxfu/crrEOr8wrqMEg1wU7lc?= =?us-ascii?Q?LWqcJq34HlJRDgp3KFI8mHCZQrbTTSgb/COLggZbCNav01mk9Sckj+tAXK+z?= =?us-ascii?Q?PG5YuuR+K3SSYALmwJmFo9hxLiGHSo0ibg4cYjB9bfqDJkroAo8fhHP86Cw9?= =?us-ascii?Q?P/xMcjo3WkMehE0YF5q+K/ze3lNRlYx9vXkxxxIKP/vMIZFV5dAldm+wuT8G?= =?us-ascii?Q?g9056KfkcvbJnwsEiPsAyVeD32Wn3lC0qzCXMVpsCTVnKlG1yBJhaUSUUIN4?= =?us-ascii?Q?MfGbHsdQju74tCkJnkn51lYfph24ocRneyTc3ZaBzUgF+qx48PKnW3VIEjPH?= =?us-ascii?Q?lcXcZ3Xo07P5lmfSYwcZAxcj039j9ZZJVCPtohLrf8ODzNrs0wjFKTXvbRwP?= =?us-ascii?Q?aPS+ptLyBR20d9V7m3Tz9nM/137PBbO7fBog+TlcfbcueIvAMBgBKRoFc3tl?= =?us-ascii?Q?IL1KZKG1JZK9XJ+84jp4h6UlG47M8+T5c6JBiqrUzVz+K3XAfqpYuOalEXDh?= =?us-ascii?Q?HiGegbLfAHfnkMZZ+M0HtoEiDhy2QLaWe78RCdAmottc311WnoLYDq6St5aQ?= =?us-ascii?Q?7+uQQNn2f2+h1/e0CdZH/rJdu21TShwHnR7oORD5bsSPCIOkUzhASZTyjUOJ?= =?us-ascii?Q?jcJYkOQajV3eSCGK2njlfe2Pgcwtr2HRF5zm8IBDdCAK0HjSo5bjPpTOzlJd?= =?us-ascii?Q?tCAi7tWJYl5pY+hb8Xcu5gZj6i+HxcG2PUpLql8sBNfj+7bM9nKSMUgwUnvV?= =?us-ascii?Q?wYQy9dBh0vP5AwGgtttnT+/DKX4s0A7sjxYhfYRp2w5vBVlcxdkIxD29vTWx?= =?us-ascii?Q?Toc4B6NKsCD6rDc84joYmpWTHH7qpK/4fB9Ju9teROgPluAJHNK9BiDTQi+i?= =?us-ascii?Q?UCLZxrXwsPv06PivF3bA0Nxt3WORIKNmCg5M9m5G7cvogUILuCtFzRREl79r?= =?us-ascii?Q?iMmQ5eRnycNsh78PZrRYIxYRr6imRS8X/+u/4k9mwjHPQnaT/7BnafnJTa8o?= =?us-ascii?Q?SH5a5ij/iKwoQSp+De0TqfUiuyS3IIA36zIM2vJ3jmLUw2eozVb32PONNlZp?= =?us-ascii?Q?Gf0nbXY1Qp+IEIrAuc16Rk2PMXhaeNQtkniKFXPsLQJ4MwJ62JYCa4jU8HF/?= =?us-ascii?Q?uToonBp9PcBbmMXJ77EfmXFlU94GK/OXH8/+ZD81kCgmfUh5z9imnC3EAgIT?= =?us-ascii?Q?UTxavK8gmgQ01ACehz/KBLRwAQ5shS5m/G2plRwrRYOZX88RREwwJovyRVYb?= =?us-ascii?Q?8IF3JNFauWa6OL5Rrel4M6MBvHzJ1gwvHAtP5AlOoLXFWf18p5TZfzZ3i0G5?= =?us-ascii?Q?gRnkjDHg8rp+LSsXNtY96eLHoBHiFUiHM7V0CsdkdPF6C8qrNoT4RVQsXzJm?= =?us-ascii?Q?6r2c9EbMV7SGdmexIOs=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8244.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 55a34865-fbba-414c-a4ed-08dbea670b81 X-MS-Exchange-CrossTenant-originalarrivaltime: 21 Nov 2023 07:54:09.8124 (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: ZNWCArWYXyfcJmCOSMisDQUa0dxuxQVTdOwLwuRibVHMOletWeMopJenwUbobV5QHt7APGaO+IK7pGjdqUeEww== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN0PR11MB5695 X-OriginatorOrg: intel.com Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ray.ni@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: nrBr2B86JXQFaTN1qVHdSnkOx7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=KCyQK32z; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Reviewed-by: Ray Ni Thanks, Ray > -----Original Message----- > From: Sheng, W > Sent: Tuesday, November 21, 2023 3:03 PM > To: devel@edk2.groups.io > Cc: Dong, Eric ; Ni, Ray ; Laszlo > Ersek ; Wu, Jiaxin ; Tan, Dun > > Subject: [PATCH v6 6/6] MdePkg: Use macro CR4_CET_BIT to replace hard > code value. >=20 > The macro is used in file LongJump.nasm and SetJump.nasm. >=20 > Signed-off-by: Sheng Wei > Cc: Eric Dong > Cc: Ray Ni > Cc: Laszlo Ersek > Cc: Wu Jiaxin > Cc: Tan Dun > Reviewed-by: Laszlo Ersek > --- > MdePkg/Library/BaseLib/Ia32/LongJump.nasm | 3 ++- > MdePkg/Library/BaseLib/Ia32/SetJump.nasm | 3 ++- > MdePkg/Library/BaseLib/X64/LongJump.nasm | 3 ++- > MdePkg/Library/BaseLib/X64/SetJump.nasm | 3 ++- > 4 files changed, 8 insertions(+), 4 deletions(-) >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/LongJump.nasm > b/MdePkg/Library/BaseLib/Ia32/LongJump.nasm > index 6c13dfe307..df1bf9749e 100644 > --- a/MdePkg/Library/BaseLib/Ia32/LongJump.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/LongJump.nasm > @@ -14,6 +14,7 @@ > ;-----------------------------------------------------------------------= ------- >=20 >=20 >=20 > %include "Nasm.inc" >=20 > +%include "Cet.inc" >=20 >=20 >=20 > SECTION .text >=20 >=20 >=20 > @@ -34,7 +35,7 @@ ASM_PFX(InternalLongJump): > test eax, eax >=20 > jz CetDone >=20 > mov eax, cr4 >=20 > - bt eax, 23 ; check if CET is enabled >=20 > + bt eax, CR4_CET_BIT ; check if CET is enabled >=20 > jnc CetDone >=20 >=20 >=20 > mov edx, [esp + 4] ; edx =3D JumpBuffer >=20 > diff --git a/MdePkg/Library/BaseLib/Ia32/SetJump.nasm > b/MdePkg/Library/BaseLib/Ia32/SetJump.nasm > index 2577373241..0c484f6852 100644 > --- a/MdePkg/Library/BaseLib/Ia32/SetJump.nasm > +++ b/MdePkg/Library/BaseLib/Ia32/SetJump.nasm > @@ -14,6 +14,7 @@ > ;-----------------------------------------------------------------------= ------- >=20 >=20 >=20 > %include "Nasm.inc" >=20 > +%include "Cet.inc" >=20 >=20 >=20 > SECTION .text >=20 >=20 >=20 > @@ -42,7 +43,7 @@ ASM_PFX(SetJump): > test eax, eax >=20 > jz CetDone >=20 > mov eax, cr4 >=20 > - bt eax, 23 ; check if CET is enabled >=20 > + bt eax, CR4_CET_BIT ; check if CET is enabled >=20 > jnc CetDone >=20 >=20 >=20 > mov eax, 1 >=20 > diff --git a/MdePkg/Library/BaseLib/X64/LongJump.nasm > b/MdePkg/Library/BaseLib/X64/LongJump.nasm > index 2002f65cba..021b49e855 100644 > --- a/MdePkg/Library/BaseLib/X64/LongJump.nasm > +++ b/MdePkg/Library/BaseLib/X64/LongJump.nasm > @@ -14,6 +14,7 @@ > ;-----------------------------------------------------------------------= ------- >=20 >=20 >=20 > %include "Nasm.inc" >=20 > +%include "Cet.inc" >=20 >=20 >=20 > DEFAULT REL >=20 > SECTION .text >=20 > @@ -35,7 +36,7 @@ ASM_PFX(InternalLongJump): > test eax, eax >=20 > jz CetDone >=20 > mov rax, cr4 >=20 > - bt eax, 23 ; check if CET is enabled >=20 > + bt eax, CR4_CET_BIT ; check if CET is enabled >=20 > jnc CetDone >=20 >=20 >=20 > push rdx ; save rdx >=20 > diff --git a/MdePkg/Library/BaseLib/X64/SetJump.nasm > b/MdePkg/Library/BaseLib/X64/SetJump.nasm > index 5943a5ebe5..d2c0991e66 100644 > --- a/MdePkg/Library/BaseLib/X64/SetJump.nasm > +++ b/MdePkg/Library/BaseLib/X64/SetJump.nasm > @@ -14,6 +14,7 @@ > ;-----------------------------------------------------------------------= ------- >=20 >=20 >=20 > %include "Nasm.inc" >=20 > +%include "Cet.inc" >=20 >=20 >=20 > DEFAULT REL >=20 > SECTION .text >=20 > @@ -44,7 +45,7 @@ ASM_PFX(SetJump): > test eax, eax >=20 > jz CetDone >=20 > mov rax, cr4 >=20 > - bt eax, 23 ; check if CET is enabled >=20 > + bt eax, CR4_CET_BIT ; check if CET is enabled >=20 > jnc CetDone >=20 >=20 >=20 > mov rax, 1 >=20 > -- > 2.26.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#111530): https://edk2.groups.io/g/devel/message/111530 Mute This Topic: https://groups.io/mt/102724277/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/19134562= 12/xyzzy [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-