KVM: svm/avic: Drop "struct kvm_x86_ops" for avic_hardware_setup()
PATCH 1/1 KVM: svm/avic: Drop "struct kvm_x86_ops" for avic_hardware_setup()
From: Like Xu <[email protected]>
Even in commit 4bdec12aa8d6 ("KVM: SVM: Detect X2APIC virtualization (x2AVIC) support"), where avic_hardware_setup() was first introduced, its only pass-in parameter "struct kvm_x86_ops *ops" is not used at all. Clean it up a bit to avoid compiler ranting from LLVM toolchain.
--- arch/x86/kvm/svm/avic.c | 2 +- arch/x86/kvm/svm/svm.c | 2 +- arch/x86/kvm/svm/svm.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kvm/svm/avic.c +1 -1
@@ -1161,7 +1161,7 @@ void avic_vcpu_unblocking(struct kvm_vcpu *vcpu)* - Hypervisor can support both xAVIC and x2AVIC in the same guest. * - The mode can be switched at run-time. */ -bool avic_hardware_setup (struct kvm_x86_ops *x86_ops) +bool avic_hardware_setup (void ) {if (!npt_enabled)return false;
arch/x86/kvm/svm/svm.c +1 -1
@@ -5038,7 +5038,7 @@ static __init int svm_hardware_setup(void) nrips = false; } - enable_apicv = avic = avic &&avic_hardware_setup (&svm_x86_ops); + enable_apicv = avic = avic &&avic_hardware_setup ();if (!enable_apicv) { svm_x86_ops.vcpu_blocking =NULL ;
arch/x86/kvm/svm/svm.h +1 -1
@@ -427,7 +427,7 @@ extern struct kvm_x86_nested_ops svm_nested_ops;/* avic.c */ -bool avic_hardware_setup (struct kvm_x86_ops *ops); +bool avic_hardware_setup (void );int avic_ga_log_notifier (u32 ga_tag);void avic_vm_destroy (struct kvm *kvm);int avic_vm_init (struct kvm *kvm);
Signature · 1 line
2.38.1
+Maxim
Quoted 5 lines · Like Xu
From: Like Xu <[email protected]>
Even in commit
4bdec12aa8d6("KVM: SVM: Detect X2APIC virtualization (x2AVIC) support"), whereavic_hardware_setup()was first introduced, its only pass-in parameter "structkvm_x86_ops*ops" is not used at all.
I assume the intent was to fill the AVIC ops so that they don't need to be exposed outside of avic.c. I like the idea in theory, but unlike vmx_nested_ops they wouldn't be fully contained, which IMO would make the code as a whole more difficult to follow.
Maxim, any objection?
Quoted 4 lines
Clean it up a bit to avoid compiler ranting from LLVM toolchain.
Signed-off-by Like Xu <[email protected]>---
Quoted 6 lines · Like Xu
Even in commit
4bdec12aa8d6("KVM: SVM: Detect X2APIC virtualization (x2AVIC) support"), whereavic_hardware_setup()was first introduced, its only pass-in parameter "structkvm_x86_ops*ops" is not used at all. Clean it up a bit to avoid compiler ranting from LLVM toolchain.
Applied to kvm-x86 svm, thanks!
[1/1] KVM: svm/avic: Drop "struct kvm_x86_ops" for avic_hardware_setup()
https://github.com/kvm-x86/linux/commit/6e66dcbdfe90
--
https://github.com/kvm-x86/linux/tree/next
https://github.com/kvm-x86/linux/tree/fixes