diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2013-03-25 12:22:50 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-04-02 09:14:31 -0400 |
commit | ace5058763b72d128efcbe27969e89226c9c593a (patch) | |
tree | ea540d2e137bb80d476df5fe29ec8e4e2ec119df /arch/s390 | |
parent | d21683ea1f1b03823928a98b6380332b9385e3a7 (diff) |
KVM: s390: fix psw conversion in lpsw handler
When converting a 64 bit psw to a 128 bit psw the addressing mode bit of
the "addr" part of the 64 bit psw must be moved to the basic addressing
mode bit of the "mask" part of the 128 bit psw.
In addition the addressing mode bit must be cleared when moved to the "addr"
part of the 128 bit psw.
Otherwise an invalid psw would be generated if the orginal psw was in the
31 bit addressing mode.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/kvm/priv.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c index 7b397b37d11a..844a2b986112 100644 --- a/arch/s390/kvm/priv.c +++ b/arch/s390/kvm/priv.c | |||
@@ -286,7 +286,8 @@ int kvm_s390_handle_lpsw(struct kvm_vcpu *vcpu) | |||
286 | 286 | ||
287 | vcpu->arch.sie_block->gpsw.mask = | 287 | vcpu->arch.sie_block->gpsw.mask = |
288 | (new_psw.mask & ~PSW32_MASK_BASE) << 32; | 288 | (new_psw.mask & ~PSW32_MASK_BASE) << 32; |
289 | vcpu->arch.sie_block->gpsw.addr = new_psw.addr; | 289 | vcpu->arch.sie_block->gpsw.mask |= new_psw.addr & PSW32_ADDR_AMODE; |
290 | vcpu->arch.sie_block->gpsw.addr = new_psw.addr & ~PSW32_ADDR_AMODE; | ||
290 | 291 | ||
291 | if ((vcpu->arch.sie_block->gpsw.mask & PSW_MASK_UNASSIGNED) || | 292 | if ((vcpu->arch.sie_block->gpsw.mask & PSW_MASK_UNASSIGNED) || |
292 | (!(vcpu->arch.sie_block->gpsw.mask & PSW_MASK_ADDR_MODE) && | 293 | (!(vcpu->arch.sie_block->gpsw.mask & PSW_MASK_ADDR_MODE) && |