Reviewed-by: Jian J Wang <[email protected]>

Regards,
Jian

> -----Original Message-----
> From: Xu, Min M <[email protected]>
> Sent: Saturday, March 12, 2022 9:54 AM
> To: [email protected]
> Cc: Xu, Min M <[email protected]>; Wang, Jian J <[email protected]>;
> Wu, Hao A <[email protected]>; Brijesh Singh <[email protected]>;
> Aktas, Erdem <[email protected]>; James Bottomley
> <[email protected]>; Yao, Jiewen <[email protected]>; Tom Lendacky
> <[email protected]>; Gerd Hoffmann <[email protected]>
> Subject: [PATCH V8 35/47] MdeModulePkg: Skip setting IA32_ERER.NXE if it has
> already been set
> 
> RFC: https://bugzilla.tianocore.org/show_bug.cgi?id=3429
> 
> If IA32_ERER.NXE has already been set, skip setting it again.
> 
> Cc: Jian J Wang <[email protected]>
> Cc: Hao A Wu <[email protected]>
> Cc: Brijesh Singh <[email protected]>
> Cc: Erdem Aktas <[email protected]>
> Cc: James Bottomley <[email protected]>
> Cc: Jiewen Yao <[email protected]>
> Cc: Tom Lendacky <[email protected]>
> Cc: Gerd Hoffmann <[email protected]>
> Acked-by: Gerd Hoffmann <[email protected]>
> Signed-off-by: Min Xu <[email protected]>
> ---
>  MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> index 0700f310b203..bb426d0d0a6f 100644
> --- a/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> +++ b/MdeModulePkg/Core/DxeIplPeim/X64/VirtualMemory.c
> @@ -179,9 +179,11 @@ EnableExecuteDisableBit (
>  {
>    UINT64  MsrRegisters;
> 
> -  MsrRegisters  = AsmReadMsr64 (0xC0000080);
> -  MsrRegisters |= BIT11;
> -  AsmWriteMsr64 (0xC0000080, MsrRegisters);
> +  MsrRegisters = AsmReadMsr64 (0xC0000080);
> +  if ((MsrRegisters & BIT11) == 0) {
> +    MsrRegisters |= BIT11;
> +    AsmWriteMsr64 (0xC0000080, MsrRegisters);
> +  }
>  }
> 
>  /**
> --
> 2.29.2.windows.2



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#87562): https://edk2.groups.io/g/devel/message/87562
Mute This Topic: https://groups.io/mt/89725436/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to