aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2016-12-15 09:58:14 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2017-01-30 05:17:27 -0500
commita679c547d19ded9b7d1a88e17cf5e5b69ac619b6 (patch)
treeeaa8446c695ae11123c7b1bdb011e3c76d7f9191
parent49def1853334396f948dcb4cedb9347abb318df5 (diff)
KVM: s390: gaccess: add ESOP2 handling
When we access guest memory and run into a protection exception, we need to pass the exception data to the guest. ESOP2 provides detailed information about all protection exceptions which ESOP1 only partially provided. The gaccess changes make sure, that the guest always gets all available information. Signed-off-by: Janosch Frank <frankja@linux.vnet.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
-rw-r--r--arch/s390/kvm/gaccess.c12
-rw-r--r--arch/s390/tools/gen_facilities.c1
2 files changed, 10 insertions, 3 deletions
diff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c
index 4aa8a7e2a1da..6e94705efd4e 100644
--- a/arch/s390/kvm/gaccess.c
+++ b/arch/s390/kvm/gaccess.c
@@ -465,7 +465,9 @@ static int ar_translation(struct kvm_vcpu *vcpu, union asce *asce, ar_t ar,
465struct trans_exc_code_bits { 465struct trans_exc_code_bits {
466 unsigned long addr : 52; /* Translation-exception Address */ 466 unsigned long addr : 52; /* Translation-exception Address */
467 unsigned long fsi : 2; /* Access Exception Fetch/Store Indication */ 467 unsigned long fsi : 2; /* Access Exception Fetch/Store Indication */
468 unsigned long : 6; 468 unsigned long : 2;
469 unsigned long b56 : 1;
470 unsigned long : 3;
469 unsigned long b60 : 1; 471 unsigned long b60 : 1;
470 unsigned long b61 : 1; 472 unsigned long b61 : 1;
471 unsigned long as : 2; /* ASCE Identifier */ 473 unsigned long as : 2; /* ASCE Identifier */
@@ -497,14 +499,18 @@ static int trans_exc(struct kvm_vcpu *vcpu, int code, unsigned long gva,
497 switch (code) { 499 switch (code) {
498 case PGM_PROTECTION: 500 case PGM_PROTECTION:
499 switch (prot) { 501 switch (prot) {
502 case PROT_TYPE_LA:
503 tec->b56 = 1;
504 break;
505 case PROT_TYPE_KEYC:
506 tec->b60 = 1;
507 break;
500 case PROT_TYPE_ALC: 508 case PROT_TYPE_ALC:
501 tec->b60 = 1; 509 tec->b60 = 1;
502 /* FALL THROUGH */ 510 /* FALL THROUGH */
503 case PROT_TYPE_DAT: 511 case PROT_TYPE_DAT:
504 tec->b61 = 1; 512 tec->b61 = 1;
505 break; 513 break;
506 default: /* LA and KEYC set b61 to 0, other params undefined */
507 return code;
508 } 514 }
509 /* FALL THROUGH */ 515 /* FALL THROUGH */
510 case PGM_ASCE_TYPE: 516 case PGM_ASCE_TYPE:
diff --git a/arch/s390/tools/gen_facilities.c b/arch/s390/tools/gen_facilities.c
index 8cc53b1e6d03..b6ac8dfee001 100644
--- a/arch/s390/tools/gen_facilities.c
+++ b/arch/s390/tools/gen_facilities.c
@@ -80,6 +80,7 @@ static struct facility_def facility_defs[] = {
80 76, /* msa extension 3 */ 80 76, /* msa extension 3 */
81 77, /* msa extension 4 */ 81 77, /* msa extension 4 */
82 78, /* enhanced-DAT 2 */ 82 78, /* enhanced-DAT 2 */
83 131, /* enhanced-SOP 2 and side-effect */
83 -1 /* END */ 84 -1 /* END */
84 } 85 }
85 }, 86 },