KVM: PPC: Book3S HV: check the IRQ controller type
Subsystems (2)
RFC PATCH 3/16 KVM: PPC: Book3S HV: check the IRQ controller type
We will have different KVM devices for interrupts, one for the XICS-over-XIVE mode and one for the XIVE native exploitation mode. Let's add some checks to make sure we are not mixing the interfaces in KVM.
Signed-off-by Cédric Le Goater <[email protected]>
--- arch/powerpc/kvm/book3s_xive.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/powerpc/kvm/book3s_xive.c +6 -0
@@ -751,6 +751,9 @@ u64 kvmppc_xive_get_icp(struct kvm_vcpu *vcpu) {struct kvmppc_xive_vcpu *xc = vcpu->arch.xive_vcpu; +if (!kvmppc_xics_enabled (vcpu)) +return -EPERM ; +if (!xc)return 0 ;
@@ -767,6 +770,9 @@ int kvmppc_xive_set_icp(struct kvm_vcpu *vcpu, u64 icpval)u8 cppr, mfrr;u32 xisr; +if (!kvmppc_xics_enabled (vcpu)) +return -EPERM ; +if (!xc || !xive)return -ENOENT ;
Signature · 1 line
2.13.6