On 11/15/23 03:02, Ni, Ray wrote:
> If only CpuSmm driver consumes these macros, can we move the macro
> definitions into CpuSmm driver folder?
Sounds like a good idea.
I'm unsure how we can put "UefiCpuPkg/PiSmmCpuDxeSmm/" on the include
path though, for assembly files located in
UefiCpuPkg/PiSmmCpuDxeSmm/Ia32 and UefiCpuPkg/PiSmmCpuDxeSmm/X64:
(1) "UefiCpuPkg.dec" says
[Includes]
Include
(2) "BaseTools/Conf/build_rule.template" seems to use NASM_INC as a
placeholder / macro for NASM-specific include directory
(3) From commit 073a76e66293 ("BaseTools: Add $(INC)-like support when
compiling .nasm files", 2018-12-19),
"BaseTools/Source/Python/AutoGen/GenMake.py" seems to replace NASM_INC
with a list of -I dir/ -I dir/ -I dir/ ... options for NASM, where "dir"
iterates through the elements of point (1).
... If we place the "Cet.inc" file under "UefiCpuPkg/PiSmmCpuDxeSmm/",
can we include it with
%include "../Cet.inc"
(note the "../" prefix), in the files
UefiCpuPkg/PiSmmCpuDxeSmm/Ia32/Cet.nasm
UefiCpuPkg/PiSmmCpuDxeSmm/X64/Cet.nasm?
Will that work on Windows too?
Laszlo
> ------------------------------------------------------------------------
> *From:* Sheng, W <[email protected]>
> *Sent:* Monday, November 13, 2023 2:22 PM
> *To:* [email protected] <[email protected]>
> *Cc:* Dong, Eric <[email protected]>; Ni, Ray <[email protected]>;
> Laszlo Ersek <[email protected]>; Wu, Jiaxin <[email protected]>; Tan,
> Dun <[email protected]>
> *Subject:* [PATCH v4 1/5] UefiCpuPkg: Add macro definitions for CET
> feature for NASM files.
>
> Signed-off-by: Sheng Wei <[email protected]>
> Cc: Eric Dong <[email protected]>
> Cc: Ray Ni <[email protected]>
> Cc: Laszlo Ersek <[email protected]>
> Cc: Wu Jiaxin <[email protected]>
> Cc: Tan Dun <[email protected]>
> ---
> UefiCpuPkg/Include/Cet.inc | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
> create mode 100644 UefiCpuPkg/Include/Cet.inc
>
> diff --git a/UefiCpuPkg/Include/Cet.inc b/UefiCpuPkg/Include/Cet.inc
> new file mode 100644
> index 0000000000..a4038a0682
> --- /dev/null
> +++ b/UefiCpuPkg/Include/Cet.inc
> @@ -0,0 +1,26 @@
> +;------------------------------------------------------------------------------
>
> +;
>
> +; Copyright (c) 2023, Intel Corporation. All rights reserved.<BR>
>
> +; SPDX-License-Identifier: BSD-2-Clause-Patent
>
> +;
>
> +; Abstract:
>
> +;
>
> +; This file provides macro definitions for CET feature for NASM files.
>
> +;
>
> +;------------------------------------------------------------------------------
>
> +
>
> +%define MSR_IA32_U_CET 0x6A0
>
> +%define MSR_IA32_S_CET 0x6A2
>
> +%define MSR_IA32_CET_SH_STK_EN 0x1
>
> +%define MSR_IA32_CET_WR_SHSTK_EN 0x2
>
> +%define MSR_IA32_CET_ENDBR_EN 0x4
>
> +%define MSR_IA32_CET_LEG_IW_EN 0x8
>
> +%define MSR_IA32_CET_NO_TRACK_EN 0x10
>
> +%define MSR_IA32_CET_SUPPRESS_DIS 0x20
>
> +%define MSR_IA32_CET_SUPPRESS 0x400
>
> +%define MSR_IA32_CET_TRACKER 0x800
>
> +%define MSR_IA32_PL0_SSP 0x6A4
>
> +%define MSR_IA32_INTERRUPT_SSP_TABLE_ADDR 0x6A8
>
> +
>
> +%define CR4_CET_BIT 23
>
> +%define CR4_CET 0x800000
>
> --
> 2.26.2.windows.1
>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#111250): https://edk2.groups.io/g/devel/message/111250
Mute This Topic: https://groups.io/mt/102556833/21656
Group Owner: [email protected]
Unsubscribe:
https://edk2.groups.io/g/devel/leave/9847357/21656/1706620634/xyzzy
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-