KVM: Force PPC to define its own rcuwait object
authorSean Christopherson <seanjc@google.com>
Sat, 9 Oct 2021 02:11:57 +0000 (19:11 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Wed, 8 Dec 2021 09:24:46 +0000 (04:24 -0500)
commit510958e997217e39a16b47afb5a44dfa39013964
tree16592511358ed082554d278cc95e27e437922dd1
parent6f390916c4fb359507d9ac4bf1b28a4f8abee5c0
KVM: Force PPC to define its own rcuwait object

Do not define/reference kvm_vcpu.wait if __KVM_HAVE_ARCH_WQP is true, and
instead force the architecture (PPC) to define its own rcuwait object.
Allowing common KVM to directly access vcpu->wait without a guard makes
it all too easy to introduce potential bugs, e.g. kvm_vcpu_block(),
kvm_vcpu_on_spin(), and async_pf_execute() all operate on vcpu->wait, not
the result of kvm_arch_vcpu_get_wait(), and so may do the wrong thing for
PPC.

Due to PPC's shenanigans with respect to callbacks and waits (it switches
to the virtual core's wait object at KVM_RUN!?!?), it's not clear whether
or not this fixes any bugs.

Signed-off-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211009021236.4122790-5-seanjc@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/powerpc/include/asm/kvm_host.h
arch/powerpc/kvm/powerpc.c
include/linux/kvm_host.h
virt/kvm/async_pf.c
virt/kvm/kvm_main.c