Skip to content

Commit e4aa6f6

Browse files
yamahatabonzini
authored andcommitted
KVM: TDX: Add helper functions to print TDX SEAMCALL error
Add helper functions to print out errors from the TDX module in a uniform manner. Signed-off-by: Isaku Yamahata <[email protected]> Co-developed-by: Tony Lindgren <[email protected]> Signed-off-by: Tony Lindgren <[email protected]> Signed-off-by: Rick Edgecombe <[email protected]> Reviewed-by: Binbin Wu <[email protected]> Reviewed-by: Yuan Yao <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 1001d98 commit e4aa6f6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

arch/x86/kvm/vmx/tdx.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@
1010
#undef pr_fmt
1111
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
1212

13+
#define pr_tdx_error(__fn, __err) \
14+
pr_err_ratelimited("SEAMCALL %s failed: 0x%llx\n", #__fn, __err)
15+
16+
#define __pr_tdx_error_N(__fn_str, __err, __fmt, ...) \
17+
pr_err_ratelimited("SEAMCALL " __fn_str " failed: 0x%llx, " __fmt, __err, __VA_ARGS__)
18+
19+
#define pr_tdx_error_1(__fn, __err, __rcx) \
20+
__pr_tdx_error_N(#__fn, __err, "rcx 0x%llx\n", __rcx)
21+
22+
#define pr_tdx_error_2(__fn, __err, __rcx, __rdx) \
23+
__pr_tdx_error_N(#__fn, __err, "rcx 0x%llx, rdx 0x%llx\n", __rcx, __rdx)
24+
25+
#define pr_tdx_error_3(__fn, __err, __rcx, __rdx, __r8) \
26+
__pr_tdx_error_N(#__fn, __err, "rcx 0x%llx, rdx 0x%llx, r8 0x%llx\n", __rcx, __rdx, __r8)
27+
1328
bool enable_tdx __ro_after_init;
1429
module_param_named(tdx, enable_tdx, bool, 0444);
1530

0 commit comments

Comments
 (0)