[edk2-devel] [PATCH v4 0/5] UefiCpuPkg: Add macro definitions for CET feature for NASM files.

Sheng Wei posted 5 patches 5 months, 2 weeks ago
Failed in applying to current master (apply log)
UefiCpuPkg/Include/Cet.inc                   | 26 +++++++++++++
UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm      |  5 ++-
UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm | 39 +++++++++++--------
UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm       |  5 ++-
UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm  | 40 +++++++++++---------
5 files changed, 78 insertions(+), 37 deletions(-)
create mode 100644 UefiCpuPkg/Include/Cet.inc
[edk2-devel] [PATCH v4 0/5] UefiCpuPkg: Add macro definitions for CET feature for NASM files.
Posted by Sheng Wei 5 months, 2 weeks ago
Patch V4:
  Separate the changes to 5 patches.
    1) Add macro definitions for CET feature for NASM files.
    2) Use macro CR4_CET_BIT to replace hard code value in Cet.nasm.
    3) Use CET macro definitions in Cet.inc for SmiEntry.nasm files.
    4) Only change CR4.CET bit for enable/disable CET.
    5) Backup and Restore MSR IA32_U_CET in SMI handler.
  Remove some unused code.
    It is no need to clear MSR IA32_S_CET,
     because clear CR4.CET bit will disable all CET functions.
    Since CET is disabled between clear CR4.CET and run 'rsm',
     it is no need to delay MSR IA32_S_CET restoration.

Patch V3:
  Remove the 3rd patch. mSmmInterruptSspTables is a global variable.
  It is unnecessary to initializ it to zero manually.

Patch V2:
  No function change with Patch V1.
  Split the patch to into 3 separate patches.

Sheng Wei (5):
  UefiCpuPkg: Add macro definitions for CET feature for NASM files.
  UefiCpuPkg: Use macro CR4_CET_BIT to replace hard code value in
    Cet.nasm.
  UefiCpuPkg: Use CET macro definitions in Cet.inc for SmiEntry.nasm
    files.
  UefiCpuPkg: Only change CR4.CET bit for enable and disable CET.
  UefiCpuPkg: Backup and Restore MSR IA32_U_CET in SMI handler.

 UefiCpuPkg/Include/Cet.inc                   | 26 +++++++++++++
 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm      |  5 ++-
 UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm | 39 +++++++++++--------
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm       |  5 ++-
 UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm  | 40 +++++++++++---------
 5 files changed, 78 insertions(+), 37 deletions(-)
 create mode 100644 UefiCpuPkg/Include/Cet.inc

-- 
2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111122): https://edk2.groups.io/g/devel/message/111122
Mute This Topic: https://groups.io/mt/102556832/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH v4 0/5] UefiCpuPkg: Add macro definitions for CET feature for NASM files.
Posted by Laszlo Ersek 5 months, 2 weeks ago
On 11/13/23 07:22, Sheng Wei wrote:
> Patch V4:
>   Separate the changes to 5 patches.
>     1) Add macro definitions for CET feature for NASM files.
>     2) Use macro CR4_CET_BIT to replace hard code value in Cet.nasm.
>     3) Use CET macro definitions in Cet.inc for SmiEntry.nasm files.
>     4) Only change CR4.CET bit for enable/disable CET.
>     5) Backup and Restore MSR IA32_U_CET in SMI handler.
>   Remove some unused code.
>     It is no need to clear MSR IA32_S_CET,
>      because clear CR4.CET bit will disable all CET functions.
>     Since CET is disabled between clear CR4.CET and run 'rsm',
>      it is no need to delay MSR IA32_S_CET restoration.
> 
> Patch V3:
>   Remove the 3rd patch. mSmmInterruptSspTables is a global variable.
>   It is unnecessary to initializ it to zero manually.
> 
> Patch V2:
>   No function change with Patch V1.
>   Split the patch to into 3 separate patches.
> 
> Sheng Wei (5):
>   UefiCpuPkg: Add macro definitions for CET feature for NASM files.
>   UefiCpuPkg: Use macro CR4_CET_BIT to replace hard code value in
>     Cet.nasm.
>   UefiCpuPkg: Use CET macro definitions in Cet.inc for SmiEntry.nasm
>     files.
>   UefiCpuPkg: Only change CR4.CET bit for enable and disable CET.
>   UefiCpuPkg: Backup and Restore MSR IA32_U_CET in SMI handler.
> 
>  UefiCpuPkg/Include/Cet.inc                   | 26 +++++++++++++
>  UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm      |  5 ++-
>  UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm | 39 +++++++++++--------
>  UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm       |  5 ++-
>  UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm  | 40 +++++++++++---------
>  5 files changed, 78 insertions(+), 37 deletions(-)
>  create mode 100644 UefiCpuPkg/Include/Cet.inc
> 

series
Reviewed-by: Laszlo Ersek <lersek@redhat.com>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111173): https://edk2.groups.io/g/devel/message/111173
Mute This Topic: https://groups.io/mt/102556832/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/leave/3901457/1787277/102458076/xyzzy [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-