1111#include <linux/err.h>
1212#include <linux/pgtable.h>
1313#include <linux/bitfield.h>
14-
14+ #include <asm/fault.h>
1515#include <asm/gmap.h>
1616#include "kvm-s390.h"
1717#include "gaccess.h"
@@ -466,23 +466,6 @@ static int ar_translation(struct kvm_vcpu *vcpu, union asce *asce, u8 ar,
466466 return 0 ;
467467}
468468
469- struct trans_exc_code_bits {
470- unsigned long addr : 52 ; /* Translation-exception Address */
471- unsigned long fsi : 2 ; /* Access Exception Fetch/Store Indication */
472- unsigned long : 2 ;
473- unsigned long b56 : 1 ;
474- unsigned long : 3 ;
475- unsigned long b60 : 1 ;
476- unsigned long b61 : 1 ;
477- unsigned long as : 2 ; /* ASCE Identifier */
478- };
479-
480- enum {
481- FSI_UNKNOWN = 0 , /* Unknown whether fetch or store */
482- FSI_STORE = 1 , /* Exception was due to store operation */
483- FSI_FETCH = 2 /* Exception was due to fetch operation */
484- };
485-
486469enum prot_type {
487470 PROT_TYPE_LA = 0 ,
488471 PROT_TYPE_KEYC = 1 ,
@@ -497,11 +480,11 @@ static int trans_exc_ending(struct kvm_vcpu *vcpu, int code, unsigned long gva,
497480 enum gacc_mode mode , enum prot_type prot , bool terminate )
498481{
499482 struct kvm_s390_pgm_info * pgm = & vcpu -> arch .pgm ;
500- struct trans_exc_code_bits * tec ;
483+ union teid * teid ;
501484
502485 memset (pgm , 0 , sizeof (* pgm ));
503486 pgm -> code = code ;
504- tec = (struct trans_exc_code_bits * )& pgm -> trans_exc_code ;
487+ teid = (union teid * )& pgm -> trans_exc_code ;
505488
506489 switch (code ) {
507490 case PGM_PROTECTION :
@@ -511,25 +494,25 @@ static int trans_exc_ending(struct kvm_vcpu *vcpu, int code, unsigned long gva,
511494 WARN_ON_ONCE (1 );
512495 break ;
513496 case PROT_TYPE_IEP :
514- tec -> b61 = 1 ;
497+ teid -> b61 = 1 ;
515498 fallthrough ;
516499 case PROT_TYPE_LA :
517- tec -> b56 = 1 ;
500+ teid -> b56 = 1 ;
518501 break ;
519502 case PROT_TYPE_KEYC :
520- tec -> b60 = 1 ;
503+ teid -> b60 = 1 ;
521504 break ;
522505 case PROT_TYPE_ALC :
523- tec -> b60 = 1 ;
506+ teid -> b60 = 1 ;
524507 fallthrough ;
525508 case PROT_TYPE_DAT :
526- tec -> b61 = 1 ;
509+ teid -> b61 = 1 ;
527510 break ;
528511 }
529512 if (terminate ) {
530- tec -> b56 = 0 ;
531- tec -> b60 = 0 ;
532- tec -> b61 = 0 ;
513+ teid -> b56 = 0 ;
514+ teid -> b60 = 0 ;
515+ teid -> b61 = 0 ;
533516 }
534517 fallthrough ;
535518 case PGM_ASCE_TYPE :
@@ -543,9 +526,9 @@ static int trans_exc_ending(struct kvm_vcpu *vcpu, int code, unsigned long gva,
543526 * exc_access_id has to be set to 0 for some instructions. Both
544527 * cases have to be handled by the caller.
545528 */
546- tec -> addr = gva >> PAGE_SHIFT ;
547- tec -> fsi = mode == GACC_STORE ? FSI_STORE : FSI_FETCH ;
548- tec -> as = psw_bits (vcpu -> arch .sie_block -> gpsw ).as ;
529+ teid -> addr = gva >> PAGE_SHIFT ;
530+ teid -> fsi = mode == GACC_STORE ? TEID_FSI_STORE : TEID_FSI_FETCH ;
531+ teid -> as = psw_bits (vcpu -> arch .sie_block -> gpsw ).as ;
549532 fallthrough ;
550533 case PGM_ALEN_TRANSLATION :
551534 case PGM_ALE_SEQUENCE :
0 commit comments