From nobody Mon Feb 9 06:00:25 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+111520+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111520+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1700550184; cv=none; d=zohomail.com; s=zohoarc; b=K7qMMSEzNV4023xBTM1jUhaaRf7TqDg9B2onWkCLi22CxOkX3Ar2aDYHZMJZNoZVgZ/tlOCUf+FM5+hEpjDNWNp1OaGtLE+UX39oldgYVqjK+47S5kPZFFtfoEehqCS732t4AIhWI81mmfSXoilpzrcmlAXZNTxb21RD5d1q3rs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700550184; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=xyS4BYZG3DoNLQc/DgiIBJOjsGx5Hv1hS99dGdNhLJ8=; b=Ej+GLPsKf5ZRJJMiz44b1PThr9F6yRY1gFcY8fsH35aNEOL8zB89XV1LmC5adY9f0v76jef7LuSgNku79y4sljXAa6pHD0ce0D849KPIOGJRRjKj2RGobKToSx924VdIODr0FQKHuWbZ3htsbjtrreum3tSoZjT3V9RlLkdHOmo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+111520+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1700550184522471.6519415285808; Mon, 20 Nov 2023 23:03:04 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=jaWJbwPhVPZwhNFlsxd/blBW/riP+Z+4zCqwv0OU2O8=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1700550183; v=1; b=kXf0clarXi1dPwcb6NGLZi2YWJzYUT2mLTEB52exP4NTFY32iGls/vGy1SSm35q8Gg4WPn0Q MAy9O1km0bBTr1OWnNUUe5H8CuhTqHbvgEbT0dHoVqtiFujDWKJYqsNWbui+bz6YxKM7Ld5yfuu iZHMaRn5gXqilOR6CggbXIC0= X-Received: by 127.0.0.2 with SMTP id SjUmYY1788612x8pO83a01VU; Mon, 20 Nov 2023 23:03:03 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.120]) by mx.groups.io with SMTP id smtpd.web10.30512.1700550170171771930 for ; Mon, 20 Nov 2023 23:03:02 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="390633425" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="390633425" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Nov 2023 23:03:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10900"; a="795705010" X-IronPort-AV: E=Sophos;i="6.04,215,1695711600"; d="scan'208";a="795705010" X-Received: from shwdesssddpdwei.ccr.corp.intel.com ([10.239.157.28]) by orsmga008.jf.intel.com with ESMTP; 20 Nov 2023 23:03:00 -0800 From: "Sheng Wei" To: devel@edk2.groups.io Cc: Eric Dong , Ray Ni , Laszlo Ersek , Wu Jiaxin , Tan Dun Subject: [edk2-devel] [PATCH v6 6/6] MdePkg: Use macro CR4_CET_BIT to replace hard code value. Date: Tue, 21 Nov 2023 15:02:46 +0800 Message-Id: <20231121070246.505-7-w.sheng@intel.com> In-Reply-To: <20231121070246.505-1-w.sheng@intel.com> References: <20231121070246.505-1-w.sheng@intel.com> MIME-Version: 1.0 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,w.sheng@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: EELZmPaqegHXv7slTfAxaP5Nx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1700550186922100001 Content-Type: text/plain; charset="utf-8" The macro is used in file LongJump.nasm and SetJump.nasm. Signed-off-by: Sheng Wei Cc: Eric Dong Cc: Ray Ni Cc: Laszlo Ersek Cc: Wu Jiaxin Cc: Tan Dun Reviewed-by: Laszlo Ersek Reviewed-by: Ray Ni --- 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(-) diff --git a/MdePkg/Library/BaseLib/Ia32/LongJump.nasm b/MdePkg/Library/Bas= eLib/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 %include "Nasm.inc" +%include "Cet.inc" =20 SECTION .text =20 @@ -34,7 +35,7 @@ ASM_PFX(InternalLongJump): test eax, eax jz CetDone mov eax, cr4 - bt eax, 23 ; check if CET is enabled + bt eax, CR4_CET_BIT ; check if CET is enabled jnc CetDone =20 mov edx, [esp + 4] ; edx =3D JumpBuffer diff --git a/MdePkg/Library/BaseLib/Ia32/SetJump.nasm b/MdePkg/Library/Base= Lib/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 %include "Nasm.inc" +%include "Cet.inc" =20 SECTION .text =20 @@ -42,7 +43,7 @@ ASM_PFX(SetJump): test eax, eax jz CetDone mov eax, cr4 - bt eax, 23 ; check if CET is enabled + bt eax, CR4_CET_BIT ; check if CET is enabled jnc CetDone =20 mov eax, 1 diff --git a/MdePkg/Library/BaseLib/X64/LongJump.nasm b/MdePkg/Library/Base= Lib/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 %include "Nasm.inc" +%include "Cet.inc" =20 DEFAULT REL SECTION .text @@ -35,7 +36,7 @@ ASM_PFX(InternalLongJump): test eax, eax jz CetDone mov rax, cr4 - bt eax, 23 ; check if CET is enabled + bt eax, CR4_CET_BIT ; check if CET is enabled jnc CetDone =20 push rdx ; save rdx diff --git a/MdePkg/Library/BaseLib/X64/SetJump.nasm b/MdePkg/Library/BaseL= ib/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 %include "Nasm.inc" +%include "Cet.inc" =20 DEFAULT REL SECTION .text @@ -44,7 +45,7 @@ ASM_PFX(SetJump): test eax, eax jz CetDone mov rax, cr4 - bt eax, 23 ; check if CET is enabled + bt eax, CR4_CET_BIT ; check if CET is enabled jnc CetDone =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 (#111520): https://edk2.groups.io/g/devel/message/111520 Mute This Topic: https://groups.io/mt/102724277/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-