]> git.karo-electronics.de Git - linux-beck.git/commitdiff
KVM: s390: support NQ only if the facility is enabled for the guest
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Fri, 4 Mar 2016 10:08:09 +0000 (11:08 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Wed, 4 May 2016 08:57:39 +0000 (10:57 +0200)
While we can not fully fence of the Nonquiescing Key-Setting facility,
we should as try our best to hide it.

Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/priv.c

index 3561119f99d65422b70ef029a8fb66e9da0b7526..313747917574ed0bad6254f260d99fe916bedc7f 100644 (file)
@@ -670,8 +670,9 @@ static int handle_pfmf(struct kvm_vcpu *vcpu)
        if (vcpu->run->s.regs.gprs[reg1] & PFMF_RESERVED)
                return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
 
-       /* Only provide non-quiescing support if the host supports it */
-       if (vcpu->run->s.regs.gprs[reg1] & PFMF_NQ && !test_facility(14))
+       /* Only provide non-quiescing support if enabled for the guest */
+       if (vcpu->run->s.regs.gprs[reg1] & PFMF_NQ &&
+           !test_kvm_facility(vcpu->kvm, 14))
                return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
 
        /* No support for conditional-SSKE */