aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390')
-rw-r--r--arch/s390/kvm/kvm-s390.h1
-rw-r--r--arch/s390/kvm/priv.c5
2 files changed, 5 insertions, 1 deletions
diff --git a/arch/s390/kvm/kvm-s390.h b/arch/s390/kvm/kvm-s390.h
index c28423a3acc0..38b589d69951 100644
--- a/arch/s390/kvm/kvm-s390.h
+++ b/arch/s390/kvm/kvm-s390.h
@@ -142,6 +142,7 @@ void kvm_s390_reinject_io_int(struct kvm *kvm,
142int kvm_s390_mask_adapter(struct kvm *kvm, unsigned int id, bool masked); 142int kvm_s390_mask_adapter(struct kvm *kvm, unsigned int id, bool masked);
143 143
144/* implemented in priv.c */ 144/* implemented in priv.c */
145int is_valid_psw(psw_t *psw);
145int kvm_s390_handle_b2(struct kvm_vcpu *vcpu); 146int kvm_s390_handle_b2(struct kvm_vcpu *vcpu);
146int kvm_s390_handle_e5(struct kvm_vcpu *vcpu); 147int kvm_s390_handle_e5(struct kvm_vcpu *vcpu);
147int kvm_s390_handle_01(struct kvm_vcpu *vcpu); 148int kvm_s390_handle_01(struct kvm_vcpu *vcpu);
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index 07d0c1025cb9..d99f5f0305a0 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -365,7 +365,8 @@ static void handle_new_psw(struct kvm_vcpu *vcpu)
365#define PSW_ADDR_24 0x0000000000ffffffUL 365#define PSW_ADDR_24 0x0000000000ffffffUL
366#define PSW_ADDR_31 0x000000007fffffffUL 366#define PSW_ADDR_31 0x000000007fffffffUL
367 367
368static int is_valid_psw(psw_t *psw) { 368int is_valid_psw(psw_t *psw)
369{
369 if (psw->mask & PSW_MASK_UNASSIGNED) 370 if (psw->mask & PSW_MASK_UNASSIGNED)
370 return 0; 371 return 0;
371 if ((psw->mask & PSW_MASK_ADDR_MODE) == PSW_MASK_BA) { 372 if ((psw->mask & PSW_MASK_ADDR_MODE) == PSW_MASK_BA) {
@@ -376,6 +377,8 @@ static int is_valid_psw(psw_t *psw) {
376 return 0; 377 return 0;
377 if ((psw->mask & PSW_MASK_ADDR_MODE) == PSW_MASK_EA) 378 if ((psw->mask & PSW_MASK_ADDR_MODE) == PSW_MASK_EA)
378 return 0; 379 return 0;
380 if (psw->addr & 1)
381 return 0;
379 return 1; 382 return 1;
380} 383}
381 384