From 043615ae8b0df9635b509643fe1d5cedb6e1a64d Mon Sep 17 00:00:00 2001 From: Ceping Sun Date: Thu, 29 Aug 2024 21:21:48 -0400 Subject: [PATCH] MdePkg/BaseLib: Add NULL version Tdx functions for other architectures Currently, the NULL version Tdx functions are only built for Ia32. In BaseLib, the others architectures also need such NULL version Tdx functions. Cc: Liming Gao Cc: Michael D Kinney Cc: Zhiguang Liu Cc: Gerd Hoffmann Cc: Jiewen Yao Cc: Min Xu Signed-off-by: Ceping Sun --- MdePkg/Include/Library/BaseLib.h | 4 ---- MdePkg/Library/BaseLib/BaseLib.inf | 5 +++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/MdePkg/Include/Library/BaseLib.h b/MdePkg/Include/Library/BaseLib.h index eb817f131f..9658026d9c 100644 --- a/MdePkg/Include/Library/BaseLib.h +++ b/MdePkg/Include/Library/BaseLib.h @@ -5259,8 +5259,6 @@ SpeculationBarrier ( VOID ); -#if defined (MDE_CPU_X64) || defined (MDE_CPU_IA32) - /** The TDCALL instruction causes a VM exit to the Intel TDX module. It is used to call guest-side Intel TDX functions, either local or a TD exit @@ -5323,8 +5321,6 @@ TdIsEnabled ( VOID ); -#endif - #if defined (MDE_CPU_X64) // // The page size for the PVALIDATE instruction diff --git a/MdePkg/Library/BaseLib/BaseLib.inf b/MdePkg/Library/BaseLib/BaseLib.inf index e3336c5dfb..317d32cf68 100644 --- a/MdePkg/Library/BaseLib/BaseLib.inf +++ b/MdePkg/Library/BaseLib/BaseLib.inf @@ -339,6 +339,7 @@ Ebc/SpeculationBarrier.c Unaligned.c Math64.c + IntelTdxNull.c [Sources.ARM] Arm/InternalSwitchStack.c @@ -364,6 +365,7 @@ Arm/CpuBreakpoint.S | GCC Arm/MemoryFence.S | GCC Arm/SpeculationBarrier.S | GCC + IntelTdxNull.c [Sources.AARCH64] Arm/InternalSwitchStack.c @@ -391,6 +393,7 @@ AArch64/SpeculationBarrier.asm | MSFT AArch64/ArmReadCntPctReg.asm | MSFT AArch64/ArmReadIdAA64Isar0Reg.asm | MSFT + IntelTdxNull.c [Sources.RISCV64] Math64.c @@ -412,6 +415,7 @@ RiscV64/ReadTimer.S | GCC RiscV64/RiscVMmu.S | GCC RiscV64/SpeculationBarrier.S | GCC + IntelTdxNull.c [Sources.LOONGARCH64] Math64.c @@ -432,6 +436,7 @@ LoongArch64/ExceptionBase.S | GCC LoongArch64/Cpucfg.S | GCC LoongArch64/ReadStableCounter.S | GCC + IntelTdxNull.c [Packages] MdePkg/MdePkg.dec