x86/tdx: Wrap r11 argument of decompression hypercall with hcall_func
Subsystems (2)
PATCH 1/1 x86/tdx: Wrap r11 argument of decompression hypercall with hcall_func
This just unifies the decompression tdx-related code with the rest of the code which invokes tdx hypercalls. No functional changes.
Signed-off-by Nikolay Borisov <[email protected]>
--- arch/x86/boot/compressed/tdx.c | 4 ++-- arch/x86/coco/tdx/tdx.c | 11 ----------- arch/x86/include/asm/shared/tdx.h | 11 +++++++++++ 3 files changed, 13 insertions(+), 13 deletions(-)
arch/x86/boot/compressed/tdx.c +2 -2
@@ -20,7 +20,7 @@ static inline unsigned int tdx_io_in(int size, u16 port) {struct tdx_hypercall_args args = { .r10 =TDX_HYPERCALL_STANDARD , - .r11 =EXIT_REASON_IO_INSTRUCTION , + .r11 =hcall_func (EXIT_REASON_IO_INSTRUCTION ), .r12 = size, .r13 =0 , .r14 = port,
@@ -36,7 +36,7 @@ static inline void tdx_io_out(int size, u16 port, u32 value) {struct tdx_hypercall_args args = { .r10 =TDX_HYPERCALL_STANDARD , - .r11 =EXIT_REASON_IO_INSTRUCTION , + .r11 =hcall_func (EXIT_REASON_IO_INSTRUCTION ), .r12 = size, .r13 =1 , .r14 = port,
arch/x86/coco/tdx/tdx.c +0 -11
@@ -76,17 +76,6 @@ noinstr void __tdx_hypercall_failed(void)panic ("TDVMCALL failed. TDX module bug?" ); } -/* -* The TDG.VP.VMCALL-Instruction-execution sub-functions are defined -* independently from but are currently matched 1:1 with VMX EXIT_REASONs. -* Reusing the KVM EXIT_REASON macros makes it easier to connect the host and -* guest sides of these calls. -*/ -static __always_inline u64 hcall_func(u64 exit_reason) -{ -return exit_reason; -} -#ifdef CONFIG_KVM_GUEST long tdx_kvm_hypercall (unsigned int nr,unsigned long p1,unsigned long p2,unsigned long p3,unsigned long p4)
arch/x86/include/asm/shared/tdx.h +11 -0
@@ -40,5 +40,16 @@ u64 __tdx_hypercall_ret(struct tdx_hypercall_args *args);/* Called from __tdx_hypercall() for unrecoverable failure */ void __tdx_hypercall_failed (void ); +/* +* The TDG.VP.VMCALL-Instruction-execution sub-functions are defined +* independently from but are currently matched 1:1 with VMX EXIT_REASONs. +* Reusing the KVM EXIT_REASON macros makes it easier to connect the host and +* guest sides of these calls. +*/ +static __always_inline u64 hcall_func(u64 exit_reason) +{ +return exit_reason; +} +#endif /* !__ASSEMBLY__ */ #endif /* _ASM_X86_SHARED_TDX_H */
Signature · 1 line
2.34.1
Quoted 2 lines · Nikolay Borisov
This just unifies the decompression tdx-related code with the rest of the code which invokes tdx hypercalls. No functional changes.
Maybe s/tdx/TDX/g ?
Quoted 1 line
Signed-off-by Nikolay Borisov <[email protected]>
Signature · 1 line
Kiryl Shutsemau / Kirill A. Shutemov