]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
KVM: Drop arch hardware (un)setup hooks
authorSean Christopherson <seanjc@google.com>
Wed, 30 Nov 2022 23:08:53 +0000 (23:08 +0000)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 13 Jan 2023 15:47:14 +0000 (10:47 -0500)
Drop kvm_arch_hardware_setup() and kvm_arch_hardware_unsetup() now that
all implementations are nops.

No functional change intended.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Reviewed-by: Eric Farman <farman@linux.ibm.com> # s390
Acked-by: Anup Patel <anup@brainfault.org>
Message-Id: <20221130230934.1014142-10-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
12 files changed:
arch/arm64/include/asm/kvm_host.h
arch/arm64/kvm/arm.c
arch/mips/include/asm/kvm_host.h
arch/mips/kvm/mips.c
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kvm/powerpc.c
arch/riscv/include/asm/kvm_host.h
arch/riscv/kvm/main.c
arch/s390/kvm/kvm-s390.c
arch/x86/kvm/x86.c
include/linux/kvm_host.h
virt/kvm/kvm_main.c

index 001c8abe87fc85d60b9b70f9d18e608bcd306b2f..1ed1f510f490354ce718630e67876aded7710f9e 100644 (file)
@@ -933,7 +933,6 @@ static inline bool kvm_system_needs_idmapped_vectors(void)
 
 void kvm_arm_vcpu_ptrauth_trap(struct kvm_vcpu *vcpu);
 
-static inline void kvm_arch_hardware_unsetup(void) {}
 static inline void kvm_arch_sync_events(struct kvm *kvm) {}
 static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {}
 
index 9c5573bc4614569ac62ea80457d13173f3db11fa..e6c21b804c13aa6b96828b170148c06585e3eda7 100644 (file)
@@ -63,11 +63,6 @@ int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
        return kvm_vcpu_exiting_guest_mode(vcpu) == IN_GUEST_MODE;
 }
 
-int kvm_arch_hardware_setup(void *opaque)
-{
-       return 0;
-}
-
 int kvm_arch_check_processor_compat(void *opaque)
 {
        return 0;
index 5cedb28e8a4086a9f5808b0170a264ebc502a909..28f0ba97db71351201a555285a8af023cae6840f 100644 (file)
@@ -888,7 +888,6 @@ extern unsigned long kvm_mips_get_ramsize(struct kvm *kvm);
 extern int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu,
                             struct kvm_mips_interrupt *irq);
 
-static inline void kvm_arch_hardware_unsetup(void) {}
 static inline void kvm_arch_sync_events(struct kvm *kvm) {}
 static inline void kvm_arch_free_memslot(struct kvm *kvm,
                                         struct kvm_memory_slot *slot) {}
index a25e0b73ee7042c761b3c02b2cefde9b885c4e50..af29490d9740c26828f9c7ebe8bbf469be942020 100644 (file)
@@ -135,11 +135,6 @@ void kvm_arch_hardware_disable(void)
        kvm_mips_callbacks->hardware_disable();
 }
 
-int kvm_arch_hardware_setup(void *opaque)
-{
-       return 0;
-}
-
 int kvm_arch_check_processor_compat(void *opaque)
 {
        return 0;
index caea15dcb91dd0d192100615315fd863f22b3b03..5d2c3a487e7302fe9206ffe183d8fc8f6e018082 100644 (file)
@@ -877,7 +877,6 @@ struct kvm_vcpu_arch {
 #define __KVM_HAVE_CREATE_DEVICE
 
 static inline void kvm_arch_hardware_disable(void) {}
-static inline void kvm_arch_hardware_unsetup(void) {}
 static inline void kvm_arch_sync_events(struct kvm *kvm) {}
 static inline void kvm_arch_memslots_updated(struct kvm *kvm, u64 gen) {}
 static inline void kvm_arch_flush_shadow_all(struct kvm *kvm) {}
index 04494a4fb37a0ad4026dde26ec7b11e285137f1f..5faf69421f13c426c6e5b4ca773df06ec9e17498 100644 (file)
@@ -440,11 +440,6 @@ int kvm_arch_hardware_enable(void)
        return 0;
 }
 
-int kvm_arch_hardware_setup(void *opaque)
-{
-       return 0;
-}
-
 int kvm_arch_check_processor_compat(void *opaque)
 {
        return kvmppc_core_check_processor_compat();
index dbbf43d526234822d396e26d6e0c18a2ecca9699..8c771fc4f5d29ea877f3ab73f2b41af1be1ebd8d 100644 (file)
@@ -229,7 +229,6 @@ struct kvm_vcpu_arch {
        bool pause;
 };
 
-static inline void kvm_arch_hardware_unsetup(void) {}
 static inline void kvm_arch_sync_events(struct kvm *kvm) {}
 static inline void kvm_arch_sched_in(struct kvm_vcpu *vcpu, int cpu) {}
 
index df2d8716851f20cd226419dca6a35c2bf9595aef..a146fa0ce4d2ba245d26ee272dac2791a619645d 100644 (file)
@@ -25,11 +25,6 @@ int kvm_arch_check_processor_compat(void *opaque)
        return 0;
 }
 
-int kvm_arch_hardware_setup(void *opaque)
-{
-       return 0;
-}
-
 int kvm_arch_hardware_enable(void)
 {
        unsigned long hideleg, hedeleg;
index 97c7ccd189ebd5162e167b441b5a5b9695d7a9f4..829e6e0460036d38d69ab050a04bdfb03cca40b9 100644 (file)
@@ -329,16 +329,6 @@ static struct notifier_block kvm_clock_notifier = {
        .notifier_call = kvm_clock_sync,
 };
 
-int kvm_arch_hardware_setup(void *opaque)
-{
-       return 0;
-}
-
-void kvm_arch_hardware_unsetup(void)
-{
-
-}
-
 static void allow_cpu_feat(unsigned long nr)
 {
        set_bit_inv(nr, kvm_s390_available_cpu_feat);
index f5b326a94258f1054c70f3319dad30b191d6b673..34acca644138dbb4299ffd0befba55e962fbf60c 100644 (file)
@@ -12033,16 +12033,6 @@ void kvm_arch_hardware_disable(void)
        drop_user_return_notifiers();
 }
 
-int kvm_arch_hardware_setup(void *opaque)
-{
-       return 0;
-}
-
-void kvm_arch_hardware_unsetup(void)
-{
-
-}
-
 int kvm_arch_check_processor_compat(void *opaque)
 {
        struct cpuinfo_x86 *c = &cpu_data(smp_processor_id());
index f16c4689322b29b4957f4fb19f3333dda3b9aa2c..2d713c030fd753269a416d45f2cdf419e112b5a5 100644 (file)
@@ -1446,8 +1446,6 @@ static inline void kvm_create_vcpu_debugfs(struct kvm_vcpu *vcpu) {}
 
 int kvm_arch_hardware_enable(void);
 void kvm_arch_hardware_disable(void);
-int kvm_arch_hardware_setup(void *opaque);
-void kvm_arch_hardware_unsetup(void);
 int kvm_arch_check_processor_compat(void *opaque);
 int kvm_arch_vcpu_runnable(struct kvm_vcpu *vcpu);
 bool kvm_arch_vcpu_in_kernel(struct kvm_vcpu *vcpu);
index 285f18c2e5df39bc425a53c18f17d528e5b78d95..69bf6652a1d5723cbca5c0ed2d1cbd4e09ea3705 100644 (file)
@@ -5899,10 +5899,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
        if (r)
                return r;
 
-       r = kvm_arch_hardware_setup(opaque);
-       if (r < 0)
-               goto err_hw_setup;
-
        if (!zalloc_cpumask_var(&cpus_hardware_enabled, GFP_KERNEL)) {
                r = -ENOMEM;
                goto err_hw_enabled;
@@ -5995,8 +5991,6 @@ out_free_3:
 out_free_2:
        free_cpumask_var(cpus_hardware_enabled);
 err_hw_enabled:
-       kvm_arch_hardware_unsetup();
-err_hw_setup:
        kvm_arch_exit();
        return r;
 }
@@ -6025,7 +6019,6 @@ void kvm_exit(void)
        on_each_cpu(hardware_disable_nolock, NULL, 1);
        kvm_irqfd_exit();
        free_cpumask_var(cpus_hardware_enabled);
-       kvm_arch_hardware_unsetup();
        kvm_arch_exit();
 }
 EXPORT_SYMBOL_GPL(kvm_exit);