Reviewed-by: Ray Ni <ray...@intel.com> Thanks, Ray > -----Original Message----- > From: Sheng, W <w.sh...@intel.com> > Sent: Tuesday, November 21, 2023 3:03 PM > To: devel@edk2.groups.io > Cc: Dong, Eric <eric.d...@intel.com>; Ni, Ray <ray...@intel.com>; Laszlo > Ersek <ler...@redhat.com>; Wu, Jiaxin <jiaxin...@intel.com>; Tan, Dun > <dun....@intel.com> > Subject: [PATCH v6 6/6] MdePkg: Use macro CR4_CET_BIT to replace hard > code value. > > The macro is used in file LongJump.nasm and SetJump.nasm. > > Signed-off-by: Sheng Wei <w.sh...@intel.com> > Cc: Eric Dong <eric.d...@intel.com> > Cc: Ray Ni <ray...@intel.com> > Cc: Laszlo Ersek <ler...@redhat.com> > Cc: Wu Jiaxin <jiaxin...@intel.com> > Cc: Tan Dun <dun....@intel.com> > Reviewed-by: Laszlo Ersek <ler...@redhat.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 > > -- > 2.26.2.windows.1
-=-=-=-=-=-=-=-=-=-=-=- 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/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-