]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
KVM: s390: generate facility mask from readable list
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Tue, 16 Aug 2016 08:31:10 +0000 (10:31 +0200)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Thu, 25 Aug 2016 20:47:03 +0000 (22:47 +0200)
Automatically generate the KVM facility mask out of a readable list.
Manually changing the masks is very error prone, especially if the
special IBM bit numbering has to be considered.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/include/asm/facilities_src.h
arch/s390/kvm/kvm-s390.c

index 4917728e582858995f4a2ae1e86cf7b91202c97a..3b758f66e48b0c659e44dcd5f3e75602a6de34a4 100644 (file)
@@ -55,4 +55,28 @@ static struct facility_def facility_defs[] = {
                        -1 /* END */
                }
        },
+       {
+               .name = "FACILITIES_KVM",
+               .bits = (int[]){
+                       0,  /* N3 instructions */
+                       1,  /* z/Arch mode installed */
+                       2,  /* z/Arch mode active */
+                       3,  /* DAT-enhancement */
+                       4,  /* idte segment table */
+                       5,  /* idte region table */
+                       6,  /* ASN-and-LX reuse */
+                       7,  /* stfle */
+                       8,  /* enhanced-DAT 1 */
+                       9,  /* sense-running-status */
+                       10, /* conditional sske */
+                       13, /* ipte-range */
+                       14, /* nonquiescing key-setting */
+                       73, /* transactional execution */
+                       75, /* access-exception-fetch/store indication */
+                       76, /* msa extension 3 */
+                       77, /* msa extension 4 */
+                       78, /* enhanced-DAT 2 */
+                       -1  /* END */
+               }
+       },
 };
index 3f3ae4865d579e8a9420cc22c6c2b39f37e70a9f..4f484e09eeb91d52f62004c5a5ff8c6e30e3fa00 100644 (file)
@@ -132,10 +132,7 @@ module_param(nested, int, S_IRUGO);
 MODULE_PARM_DESC(nested, "Nested virtualization support");
 
 /* upper facilities limit for kvm */
-unsigned long kvm_s390_fac_list_mask[16] = {
-       0xffe6000000000000UL,
-       0x005e000000000000UL,
-};
+unsigned long kvm_s390_fac_list_mask[16] = { FACILITIES_KVM };
 
 unsigned long kvm_s390_fac_list_mask_size(void)
 {