diff options
author | Sean Christopherson <sean.j.christopherson@intel.com> | 2019-12-18 13:54:57 -0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2020-01-24 09:18:59 +0100 |
commit | c50bfbdc38ec56cf8e53afb4f9ebb600dfcabd49 (patch) | |
tree | 1d517af077dbc9c6a067d73a83998b330fdd0b51 /arch/powerpc/kvm/book3s.c | |
parent | 3ec8ca29647078db11a820ab22855dd64d9a4897 (diff) | |
download | linux-rt-c50bfbdc38ec56cf8e53afb4f9ebb600dfcabd49.tar.gz |
KVM: PPC: Allocate vcpu struct in common PPC code
Move allocation of all flavors of PPC vCPUs to common PPC code. All
variants either allocate 'struct kvm_vcpu' directly, or require that
the embedded 'struct kvm_vcpu' member be located at offset 0, i.e.
guarantee that the allocation can be directly interpreted as a 'struct
kvm_vcpu' object.
Remove the message from the build-time assertion regarding placement of
the struct, as compatibility with the arch usercopy region is no longer
the sole dependent on 'struct kvm_vcpu' being at offset zero.
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/powerpc/kvm/book3s.c')
-rw-r--r-- | arch/powerpc/kvm/book3s.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c index 58a59ee998e2..13385656b90d 100644 --- a/arch/powerpc/kvm/book3s.c +++ b/arch/powerpc/kvm/book3s.c @@ -789,9 +789,10 @@ void kvmppc_decrementer_func(struct kvm_vcpu *vcpu) kvm_vcpu_kick(vcpu); } -struct kvm_vcpu *kvmppc_core_vcpu_create(struct kvm *kvm, unsigned int id) +int kvmppc_core_vcpu_create(struct kvm *kvm, struct kvm_vcpu *vcpu, + unsigned int id) { - return kvm->arch.kvm_ops->vcpu_create(kvm, id); + return kvm->arch.kvm_ops->vcpu_create(kvm, vcpu, id); } void kvmppc_core_vcpu_free(struct kvm_vcpu *vcpu) |