Skip to content

Commit

Permalink
KVM: Drop arch hardware (un)setup hooks
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Eric Farman <[email protected]>	# s390
Acked-by: Anup Patel <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
  • Loading branch information
sean-jc authored and bonzini committed Dec 29, 2022
1 parent b748338 commit 63a1bd8
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 53 deletions.
1 change: 0 additions & 1 deletion arch/arm64/include/asm/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,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) {}

Expand Down
5 changes: 0 additions & 5 deletions arch/arm64/kvm/arm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion arch/mips/include/asm/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down
5 changes: 0 additions & 5 deletions arch/mips/kvm/mips.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion arch/powerpc/include/asm/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -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) {}
Expand Down
5 changes: 0 additions & 5 deletions arch/powerpc/kvm/powerpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion arch/riscv/include/asm/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,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) {}

Expand Down
5 changes: 0 additions & 5 deletions arch/riscv/kvm/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
10 changes: 0 additions & 10 deletions arch/s390/kvm/kvm-s390.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
10 changes: 0 additions & 10 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 0 additions & 2 deletions include/linux/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -1447,8 +1447,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);
Expand Down
7 changes: 0 additions & 7 deletions virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5931,10 +5931,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;
Expand Down Expand Up @@ -6027,8 +6023,6 @@ int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
out_free_2:
free_cpumask_var(cpus_hardware_enabled);
err_hw_enabled:
kvm_arch_hardware_unsetup();
err_hw_setup:
kvm_arch_exit();
return r;
}
Expand Down Expand Up @@ -6057,7 +6051,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);
Expand Down

0 comments on commit 63a1bd8

Please sign in to comment.