From: "Laszlo Ersek" <lersek@redhat.com>
To: devel@edk2.groups.io, w.sheng@intel.com
Cc: Eric Dong <eric.dong@intel.com>, Ray Ni <ray.ni@intel.com>,
Wu Jiaxin <jiaxin.wu@intel.com>, Tan Dun <dun.tan@intel.com>
Subject: Re: [edk2-devel] [PATCH v5 6/6] MdePkg: Use macro CR4_CET_BIT to replace hard code value.
Date: Wed, 15 Nov 2023 11:37:22 +0100 [thread overview]
Message-ID: <ca190791-aa60-0785-bf4c-a77425424cba@redhat.com> (raw)
In-Reply-To: <20231115041216.2016-7-w.sheng@intel.com>
On 11/15/23 05:12, Sheng Wei wrote:
> The macro is used in file LongJump.nasm and SetJump.nasm.
>
> Signed-off-by: Sheng Wei <w.sheng@intel.com>
> Cc: Eric Dong <eric.dong@intel.com>
> Cc: Ray Ni <ray.ni@intel.com>
> Cc: Laszlo Ersek <lersek@redhat.com>
> Cc: Wu Jiaxin <jiaxin.wu@intel.com>
> Cc: Tan Dun <dun.tan@intel.com>
> ---
> 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/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 @@
> ;------------------------------------------------------------------------------
>
> %include "Nasm.inc"
> +%include "Cet.inc"
>
> SECTION .text
>
> @@ -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
>
> mov edx, [esp + 4] ; edx = JumpBuffer
> 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 @@
> ;------------------------------------------------------------------------------
>
> %include "Nasm.inc"
> +%include "Cet.inc"
>
> SECTION .text
>
> @@ -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
>
> mov eax, 1
> 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 @@
> ;------------------------------------------------------------------------------
>
> %include "Nasm.inc"
> +%include "Cet.inc"
>
> 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
>
> push rdx ; save rdx
> 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 @@
> ;------------------------------------------------------------------------------
>
> %include "Nasm.inc"
> +%include "Cet.inc"
>
> 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
>
> mov rax, 1
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111251): https://edk2.groups.io/g/devel/message/111251
Mute This Topic: https://groups.io/mt/102599356/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
prev parent reply other threads:[~2023-11-15 10:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-15 4:12 [edk2-devel] [PATCH v5 0/6] MdePkg: Add macro definitions for CET feature for NASM files Sheng Wei
2023-11-15 4:12 ` [edk2-devel] [PATCH v5 1/6] " Sheng Wei
2023-11-15 10:38 ` Laszlo Ersek
2023-11-21 5:31 ` Ni, Ray
2023-11-15 4:12 ` [edk2-devel] [PATCH v5 2/6] UefiCpuPkg: Use macro CR4_CET_BIT to replace hard code value in Cet.nasm Sheng Wei
2023-11-15 4:12 ` [edk2-devel] [PATCH v5 3/6] UefiCpuPkg: Use CET macro definitions in Cet.inc for SmiEntry.nasm files Sheng Wei
2023-11-15 4:12 ` [edk2-devel] [PATCH v5 4/6] UefiCpuPkg: Only change CR4.CET bit for enable and disable CET Sheng Wei
2023-11-15 4:12 ` [edk2-devel] [PATCH v5 5/6] UefiCpuPkg: Backup and Restore MSR IA32_U_CET in SMI handler Sheng Wei
2023-11-15 4:12 ` [edk2-devel] [PATCH v5 6/6] MdePkg: Use macro CR4_CET_BIT to replace hard code value Sheng Wei
2023-11-15 10:37 ` Laszlo Ersek [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ca190791-aa60-0785-bf4c-a77425424cba@redhat.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox