Re: [PATCH v4 9/9] KVM: VMX: Consolidate the exit handler for VMX and TDX
From: Nikolay Borisov
Date: Wed Aug 26 2026 - 07:04:13 EST
On 8/26/26 13:43, Xiaoyao Li wrote:
On 8/26/2026 6:03 PM, Nikolay Borisov wrote:
@@ -960,7 +978,7 @@ struct kvm_x86_ops vt_x86_ops __initdata = {
.vcpu_needs_initialization = vt_op_tdx_only(vcpu_needs_initialization),
.vcpu_run = vt_op(vcpu_run),
- .handle_exit = vt_op(handle_exit),
+ .handle_exit = vt_handle_exit,
nit: Why isn't this vt_op() for the sake of consistency and introduce needless churn ?
I didn't see how to make vt_op() still work here while dedupping the code. Do you have a better idea?
Indeed, I saw that vt_op is actually different for the TDX/!TDX case. I guess that function is always bound to have some quirk - i.e it has an #ifdef guard inside even though is_td_vcpu() is defined for the !TDX case but tdx_handle_exit() isn't. It's named VT, even though it's defined in the "vmx section" ...
Oh well... My RB still stands.