Commit 441f7bfa authored by Sean Christopherson's avatar Sean Christopherson Committed by Paolo Bonzini
Browse files

KVM: Opt out of generic hardware enabling on s390 and PPC



Allow architectures to opt out of the generic hardware enabling logic,
and opt out on both s390 and PPC, which don't need to manually enable
virtualization as it's always on (when available).

In addition to letting s390 and PPC drop a bit of dead code, this will
hopefully also allow ARM to clean up its related code, e.g. ARM has its
own per-CPU flag to track which CPUs have enable hardware due to the
need to keep hardware enabled indefinitely when pKVM is enabled.

Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
Acked-by: default avatarAnup Patel <anup@brainfault.org>
Message-Id: <20221130230934.1014142-50-seanjc@google.com>
Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
parent 35774a9f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ if VIRTUALIZATION
menuconfig KVM
	bool "Kernel-based Virtual Machine (KVM) support"
	depends on HAVE_KVM
	select KVM_GENERIC_HARDWARE_ENABLING
	select MMU_NOTIFIER
	select PREEMPT_NOTIFIERS
	select HAVE_KVM_CPU_RELAX_INTERCEPT
+1 −0
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ config KVM
	select MMU_NOTIFIER
	select SRCU
	select INTERVAL_TREE
	select KVM_GENERIC_HARDWARE_ENABLING
	help
	  Support for hosting Guest kernels.

+0 −1
Original line number Diff line number Diff line
@@ -876,7 +876,6 @@ struct kvm_vcpu_arch {
#define __KVM_HAVE_ARCH_WQP
#define __KVM_HAVE_CREATE_DEVICE

static inline void kvm_arch_hardware_disable(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) {}
+0 −5
Original line number Diff line number Diff line
@@ -435,11 +435,6 @@ int kvmppc_ld(struct kvm_vcpu *vcpu, ulong *eaddr, int size, void *ptr,
}
EXPORT_SYMBOL_GPL(kvmppc_ld);

int kvm_arch_hardware_enable(void)
{
	return 0;
}

int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
{
	struct kvmppc_ops *kvm_ops = NULL;
+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ if VIRTUALIZATION
config KVM
	tristate "Kernel-based Virtual Machine (KVM) support (EXPERIMENTAL)"
	depends on RISCV_SBI && MMU
	select KVM_GENERIC_HARDWARE_ENABLING
	select MMU_NOTIFIER
	select PREEMPT_NOTIFIERS
	select KVM_MMIO
Loading