]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
KVM: x86: align the code with kvm_x86_call()
authorJun Miao <jun.miao@intel.com>
Mon, 5 Jan 2026 06:54:23 +0000 (14:54 +0800)
committerSean Christopherson <seanjc@google.com>
Wed, 14 Jan 2026 01:36:44 +0000 (17:36 -0800)
The use of static_call_cond() is essentially the same as static_call() on
x86 (e.g. static_call() now handles a NULL pointer as a NOP), and then the
kvm_x86_call() is added to improve code readability and maintainability
for keeping consistent code style.

Fixes 8d032b683c29 ("KVM: TDX: create/destroy VM structure")

Link: https://lore.kernel.org/all/3916caa1dcd114301a49beafa5030eca396745c1.1679456900.git.jpoimboe@kernel.org/
Link: https://lore.kernel.org/r/20240507133103.15052-3-wei.w.wang@intel.com
Signed-off-by: Jun Miao <jun.miao@intel.com>
Link: https://patch.msgid.link/20260105065423.1870622-1-jun.miao@intel.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
arch/x86/kvm/x86.c

index fe9d324da72ab7049eacedde40af939359778c7f..386cdb775fd483cec96ac12748ddc7f87ac49127 100644 (file)
@@ -13307,7 +13307,7 @@ void kvm_arch_pre_destroy_vm(struct kvm *kvm)
 #endif
 
        kvm_mmu_pre_destroy_vm(kvm);
-       static_call_cond(kvm_x86_vm_pre_destroy)(kvm);
+       kvm_x86_call(vm_pre_destroy)(kvm);
 }
 
 void kvm_arch_destroy_vm(struct kvm *kvm)