KVM: s390: we are always in czam mode
authorDavid Hildenbrand <david@redhat.com>
Tue, 29 Aug 2017 14:31:08 +0000 (16:31 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 29 Aug 2017 14:50:20 +0000 (16:50 +0200)
Independent of the underlying hardware, kvm will now always handle
SIGP SET ARCHITECTURE as if czam were enabled. Therefore, let's not
only forward that bit but always set it.

While at it, add a comment regarding STHYI.

Signed-off-by: David Hildenbrand <david@redhat.com>
Message-Id: <20170829143108.14703-1-david@redhat.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/kvm-s390.c
arch/s390/tools/gen_facilities.c

index 84c069afc02f415d58732c9f20fb4de3f8f4ed07..39115f5a38df2b6cd52463ff9f0557427395d88f 100644 (file)
@@ -1927,6 +1927,10 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
        memcpy(kvm->arch.model.fac_list, kvm->arch.model.fac_mask,
               S390_ARCH_FAC_LIST_SIZE_BYTE);
 
+       /* we are always in czam mode - even on pre z14 machines */
+       set_kvm_facility(kvm->arch.model.fac_mask, 138);
+       set_kvm_facility(kvm->arch.model.fac_list, 138);
+       /* we emulate STHYI in kvm */
        set_kvm_facility(kvm->arch.model.fac_mask, 74);
        set_kvm_facility(kvm->arch.model.fac_list, 74);
        if (MACHINE_HAS_TLB_GUEST) {
index 601bfcf99e2a9ecd871a21861d6a083d58ef84ce..19f12cef5bdfbace38ad6c258348d806f86ebb42 100644 (file)
@@ -80,7 +80,6 @@ static struct facility_def facility_defs[] = {
                        78, /* enhanced-DAT 2 */
                        130, /* instruction-execution-protection */
                        131, /* enhanced-SOP 2 and side-effect */
-                       138, /* configuration z/architecture mode (czam) */
                        139, /* multiple epoch facility */
                        146, /* msa extension 8 */
                        -1  /* END */