s390: kvm: Cpu model support for msa6, msa7 and msa8
authorJason J. Herne <jjherne@linux.vnet.ibm.com>
Mon, 20 Mar 2017 13:57:42 +0000 (09:57 -0400)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Wed, 26 Apr 2017 12:19:01 +0000 (14:19 +0200)
msa6 and msa7 require no changes.
msa8 adds kma instruction and feature area.

Signed-off-by: Jason J. Herne <jjherne@linux.vnet.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Documentation/virtual/kvm/devices/vm.txt
arch/s390/include/uapi/asm/kvm.h
arch/s390/kvm/kvm-s390.c
arch/s390/tools/gen_facilities.c
tools/arch/s390/include/uapi/asm/kvm.h

index b6cda49f2ba418010a5813fe001f1c70ba43a075..575ccb022aacd98ce87a28fc1cbb9eb11c27d6b2 100644 (file)
@@ -140,7 +140,8 @@ struct kvm_s390_vm_cpu_subfunc {
        u8 kmo[16];           # valid with Message-Security-Assist-Extension 4
        u8 pcc[16];           # valid with Message-Security-Assist-Extension 4
        u8 ppno[16];          # valid with Message-Security-Assist-Extension 5
-       u8 reserved[1824];    # reserved for future instructions
+       u8 kma[16];           # valid with Message-Security-Assist-Extension 8
+       u8 reserved[1808];    # reserved for future instructions
 };
 
 Parameters: address of a buffer to load the subfunction blocks from.
index bf9267930939fefd79422d08776a205acf71f1a7..3dd2a1d308dd0b92c36c3c5ca5276fd19838f252 100644 (file)
@@ -141,7 +141,8 @@ struct kvm_s390_vm_cpu_subfunc {
        __u8 kmo[16];           /* with MSA4 */
        __u8 pcc[16];           /* with MSA4 */
        __u8 ppno[16];          /* with MSA5 */
-       __u8 reserved[1824];
+       __u8 kma[16];           /* with MSA8 */
+       __u8 reserved[1808];
 };
 
 /* kvm attributes for crypto */
index 8771fef112a1be41a2d01c395370dc9de9ffc314..7eb1275cc265899d9c6e9c5f0f0f9cc1f139dcc1 100644 (file)
@@ -276,6 +276,10 @@ static void kvm_s390_cpu_feat_init(void)
                __cpacf_query(CPACF_PPNO, (cpacf_mask_t *)
                              kvm_s390_available_subfunc.ppno);
 
+       if (test_facility(146)) /* MSA8 */
+               __cpacf_query(CPACF_KMA, (cpacf_mask_t *)
+                             kvm_s390_available_subfunc.kma);
+
        if (MACHINE_HAS_ESOP)
                allow_cpu_feat(KVM_S390_VM_CPU_FEAT_ESOP);
        /*
index 0cf802de52a1d2d6917f93858bd4feae22d4abeb..be63fbd699fd65be53478cc89d9204c7aea1b3f2 100644 (file)
@@ -82,6 +82,7 @@ static struct facility_def facility_defs[] = {
                        78, /* enhanced-DAT 2 */
                        130, /* instruction-execution-protection */
                        131, /* enhanced-SOP 2 and side-effect */
+                       146, /* msa extension 8 */
                        -1  /* END */
                }
        },
index a2ffec4139ad1cb8cebe816a9f0b3e261cd97d42..7f4fd65e9208514b99112c51f0e018f3f441712f 100644 (file)
@@ -131,7 +131,8 @@ struct kvm_s390_vm_cpu_subfunc {
        __u8 kmo[16];           /* with MSA4 */
        __u8 pcc[16];           /* with MSA4 */
        __u8 ppno[16];          /* with MSA5 */
-       __u8 reserved[1824];
+       __u8 kma[16];           /* with MSA8 */
+       __u8 reserved[1808];
 };
 
 /* kvm attributes for crypto */