From: "Sheng Wei" <w.sheng@intel.com>
To: devel@edk2.groups.io
Subject: [edk2-devel] [PATCH v6 0/6] MdePkg: Add macro definitions for CET feature for NASM files.
Date: Tue, 21 Nov 2023 15:02:40 +0800 [thread overview]
Message-ID: <20231121070246.505-1-w.sheng@intel.com> (raw)
Patch V6:
Cet.inc only contains definitions for x86 CPU.
Move the file to \Ia32 and \X64 folder.
Refine code for cet.inc.
Patch V5:
File cet.inc will be used in both MdePkg UefiCpuPkg.
Move cet.inc file from UefiCpuPkg to MdePkg.
Use macro CR4_CET_BIT to replace hard code value for
both LongJump.nasm and SetJump.nasm.
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 (6):
MdePkg: 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.
MdePkg: Use macro CR4_CET_BIT to replace hard code value.
MdePkg/Include/Ia32/Cet.inc | 26 +++++++++++++
MdePkg/Include/X64/Cet.inc | 26 +++++++++++++
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 +-
UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm | 5 ++-
UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/SmiEntry.nasm | 39 +++++++++++--------
UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm | 5 ++-
UefiCpuPkg/PiSmmCpuDxeSmm/X64/SmiEntry.nasm | 40 +++++++++++---------
10 files changed, 112 insertions(+), 41 deletions(-)
create mode 100644 MdePkg/Include/Ia32/Cet.inc
create mode 100644 MdePkg/Include/X64/Cet.inc
--
2.26.2.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111514): https://edk2.groups.io/g/devel/message/111514
Mute This Topic: https://groups.io/mt/102724271/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next reply other threads:[~2023-11-21 7:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-21 7:02 Sheng Wei [this message]
2023-11-21 7:02 ` [edk2-devel] [PATCH v6 1/6] MdePkg: Add macro definitions for CET feature for NASM files 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
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=20231121070246.505-1-w.sheng@intel.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