KVM: s390: vsie: support guest-PER-enhancement
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>
Tue, 24 Nov 2015 15:32:35 +0000 (16:32 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 21 Jun 2016 07:43:40 +0000 (09:43 +0200)
We can easily forward the guest-PER-enhancement facility to guest 2 if
available.

Acked-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/include/uapi/asm/kvm.h
arch/s390/kvm/kvm-s390.c
arch/s390/kvm/vsie.c

index 1d2e820f763d409c000b0d657920acd05e839d5f..98526ac114bfd7b19d8ae135ef67a61524b40c64 100644 (file)
@@ -101,6 +101,7 @@ struct kvm_s390_vm_cpu_machine {
 #define KVM_S390_VM_CPU_FEAT_SIEF2     1
 #define KVM_S390_VM_CPU_FEAT_64BSCAO   2
 #define KVM_S390_VM_CPU_FEAT_SIIF      3
+#define KVM_S390_VM_CPU_FEAT_GPERE     4
 struct kvm_s390_vm_cpu_feat {
        __u64 feat[16];
 };
index d735612f908101a478d198c72c06bb73e90c1401..175752877c0d73e79e3aae2c0b03b954b17132fa 100644 (file)
@@ -269,6 +269,8 @@ static void kvm_s390_cpu_feat_init(void)
                allow_cpu_feat(KVM_S390_VM_CPU_FEAT_64BSCAO);
        if (sclp.has_siif)
                allow_cpu_feat(KVM_S390_VM_CPU_FEAT_SIIF);
+       if (sclp.has_gpere)
+               allow_cpu_feat(KVM_S390_VM_CPU_FEAT_GPERE);
 }
 
 int kvm_arch_init(void *opaque)
index 1615ed37f7dad05007be7b4a9816a2baa890e4bc..b8792ef0103077dc9518d1ed6bcc4f0934dd9e43 100644 (file)
@@ -107,6 +107,8 @@ static int prepare_cpuflags(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
                        return set_validity_icpt(scb_s, 0x0001U);
                newflags |= CPUSTAT_GED2;
        }
+       if (test_kvm_cpu_feat(vcpu->kvm, KVM_S390_VM_CPU_FEAT_GPERE))
+               newflags |= cpuflags & CPUSTAT_P;
 
        atomic_set(&scb_s->cpuflags, newflags);
        return 0;