public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Ni, Ray" <ray.ni@intel.com>
To: "Sheng, W" <w.sheng@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Dong, Eric" <eric.dong@intel.com>,
	Laszlo Ersek <lersek@redhat.com>,
	"Wu, Jiaxin" <jiaxin.wu@intel.com>,
	"Tan, Dun" <dun.tan@intel.com>
Subject: Re: [edk2-devel] [PATCH v6 2/6] UefiCpuPkg: Use macro CR4_CET_BIT to replace hard code value in Cet.nasm.
Date: Tue, 21 Nov 2023 07:53:37 +0000	[thread overview]
Message-ID: <MN6PR11MB824449AD7787CD458D683EE68CBBA@MN6PR11MB8244.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20231121070246.505-3-w.sheng@intel.com>

Reviewed-by: Ray Ni <ray.ni@intel.com>

Thanks,
Ray
> -----Original Message-----
> From: Sheng, W <w.sheng@intel.com>
> Sent: Tuesday, November 21, 2023 3:03 PM
> To: devel@edk2.groups.io
> Cc: Dong, Eric <eric.dong@intel.com>; Ni, Ray <ray.ni@intel.com>; Laszlo
> Ersek <lersek@redhat.com>; Wu, Jiaxin <jiaxin.wu@intel.com>; Tan, Dun
> <dun.tan@intel.com>
> Subject: [PATCH v6 2/6] UefiCpuPkg: Use macro CR4_CET_BIT to replace
> hard code value in Cet.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>
> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
> ---
>  UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm | 5 +++--
>  UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm  | 5 +++--
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm
> b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm
> index 9d66b9c5da..3d07da1cd4 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm
> @@ -5,6 +5,7 @@
>  ;-------------------------------------------------------------------------------
> 
> 
> 
>  %include "Nasm.inc"
> 
> +%include "Cet.inc"
> 
> 
> 
>  SECTION .text
> 
> 
> 
> @@ -16,7 +17,7 @@ ASM_PFX(DisableCet):
>      incsspd eax
> 
> 
> 
>      mov     eax, cr4
> 
> -    btr     eax, 23                      ; clear CET
> 
> +    btr     eax, CR4_CET_BIT             ; clear CET
> 
>      mov     cr4, eax
> 
>      ret
> 
> 
> 
> @@ -24,7 +25,7 @@ global ASM_PFX(EnableCet)
>  ASM_PFX(EnableCet):
> 
> 
> 
>      mov     eax, cr4
> 
> -    bts     eax, 23                      ; set CET
> 
> +    bts     eax, CR4_CET_BIT             ; set CET
> 
>      mov     cr4, eax
> 
> 
> 
>      ; use jmp to skip the check for ret
> 
> diff --git a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm
> b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm
> index 8bbdbb31cc..700aef4703 100644
> --- a/UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm
> +++ b/UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm
> @@ -5,6 +5,7 @@
>  ;-------------------------------------------------------------------------------
> 
> 
> 
>  %include "Nasm.inc"
> 
> +%include "Cet.inc"
> 
> 
> 
>  DEFAULT REL
> 
>  SECTION .text
> 
> @@ -17,7 +18,7 @@ ASM_PFX(DisableCet):
>      incsspq rax
> 
> 
> 
>      mov     rax, cr4
> 
> -    btr     eax, 23                      ; clear CET
> 
> +    btr     eax, CR4_CET_BIT             ; clear CET
> 
>      mov     cr4, rax
> 
>      ret
> 
> 
> 
> @@ -25,7 +26,7 @@ global ASM_PFX(EnableCet)
>  ASM_PFX(EnableCet):
> 
> 
> 
>      mov     rax, cr4
> 
> -    bts     eax, 23                      ; set CET
> 
> +    bts     eax, CR4_CET_BIT             ; set CET
> 
>      mov     cr4, rax
> 
> 
> 
>      ; use jmp to skip the check for ret
> 
> --
> 2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111526): https://edk2.groups.io/g/devel/message/111526
Mute This Topic: https://groups.io/mt/102724273/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/12367111/7686176/1913456212/xyzzy [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2023-11-21  7:53 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-21  7:02 [edk2-devel] [PATCH v6 0/6] MdePkg: Add macro definitions for CET feature for NASM files Sheng Wei
2023-11-21  7:02 ` [edk2-devel] [PATCH v6 1/6] " Sheng Wei
2023-11-21  7:53   ` Ni, Ray
2023-11-22 16:51     ` Laszlo Ersek
2023-11-24  7:54       ` Ni, Ray
2023-11-21  7:02 ` [edk2-devel] [PATCH v6 2/6] UefiCpuPkg: Use macro CR4_CET_BIT to replace hard code value in Cet.nasm Sheng Wei
2023-11-21  7:53   ` Ni, Ray [this message]
2023-11-21  7:02 ` [edk2-devel] [PATCH v6 3/6] UefiCpuPkg: Use CET macro definitions in Cet.inc for SmiEntry.nasm files Sheng Wei
2023-11-21  7:53   ` Ni, Ray
2023-11-21  7:02 ` [edk2-devel] [PATCH v6 4/6] UefiCpuPkg: Only change CR4.CET bit for enable and disable CET Sheng Wei
2023-11-21  7:53   ` Ni, Ray
2023-11-21  7:02 ` [edk2-devel] [PATCH v6 5/6] UefiCpuPkg: Backup and Restore MSR IA32_U_CET in SMI handler Sheng Wei
2023-11-21  7:53   ` Ni, Ray
2023-11-21  7:02 ` [edk2-devel] [PATCH v6 6/6] MdePkg: Use macro CR4_CET_BIT to replace hard code value Sheng Wei
2023-11-21  7:54   ` Ni, Ray

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=MN6PR11MB824449AD7787CD458D683EE68CBBA@MN6PR11MB8244.namprd11.prod.outlook.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