Skip to content

Commit 55560b6

Browse files
committed
KVM: TDX: Derive error argument names from the local variable names
When printing SEAMCALL errors, use the name of the variable holding an error parameter instead of the register from whence it came, so that flows which use descriptive variable names will similarly print descriptive error messages. Suggested-by: Rick Edgecombe <rick.p.edgecombe@intel.com> Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com> Reviewed-by: Yan Zhao <yan.y.zhao@intel.com> Tested-by: Yan Zhao <yan.y.zhao@intel.com> Tested-by: Kai Huang <kai.huang@intel.com> Link: https://patch.msgid.link/20251030200951.3402865-20-seanjc@google.com Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 597d706 commit 55560b6

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

arch/x86/kvm/vmx/tdx.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,15 @@
4141
#define TDX_BUG_ON(__err, __fn, __kvm) \
4242
__TDX_BUG_ON(__err, #__fn, __kvm, "%s", "")
4343

44-
#define TDX_BUG_ON_1(__err, __fn, __rcx, __kvm) \
45-
__TDX_BUG_ON(__err, #__fn, __kvm, ", rcx 0x%llx", __rcx)
44+
#define TDX_BUG_ON_1(__err, __fn, a1, __kvm) \
45+
__TDX_BUG_ON(__err, #__fn, __kvm, ", " #a1 " 0x%llx", a1)
4646

47-
#define TDX_BUG_ON_2(__err, __fn, __rcx, __rdx, __kvm) \
48-
__TDX_BUG_ON(__err, #__fn, __kvm, ", rcx 0x%llx, rdx 0x%llx", __rcx, __rdx)
47+
#define TDX_BUG_ON_2(__err, __fn, a1, a2, __kvm) \
48+
__TDX_BUG_ON(__err, #__fn, __kvm, ", " #a1 " 0x%llx, " #a2 " 0x%llx", a1, a2)
4949

50-
#define TDX_BUG_ON_3(__err, __fn, __rcx, __rdx, __r8, __kvm) \
51-
__TDX_BUG_ON(__err, #__fn, __kvm, ", rcx 0x%llx, rdx 0x%llx, r8 0x%llx", __rcx, __rdx, __r8)
50+
#define TDX_BUG_ON_3(__err, __fn, a1, a2, a3, __kvm) \
51+
__TDX_BUG_ON(__err, #__fn, __kvm, ", " #a1 " 0x%llx, " #a2 ", 0x%llx, " #a3 " 0x%llx", \
52+
a1, a2, a3)
5253

5354

5455
bool enable_tdx __ro_after_init;

0 commit comments

Comments
 (0)