diff options
author | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-05-17 08:41:32 -0400 |
---|---|---|
committer | Gleb Natapov <gleb@redhat.com> | 2013-05-21 04:55:18 -0400 |
commit | dfcf7dc64237dbe1acc2147ad3552f793003874b (patch) | |
tree | 024f9b943d766bdc67990588643034887c7db135 /arch/s390/kvm/priv.c | |
parent | eed3b1e55be07a057ee41a24f04abffeda7b885f (diff) |
s390/kvm: fix psw rewinding in handle_skey
The PSW can wrap if the guest has been running in the 24 bit or 31 bit
addressing mode. Use __rewind_psw to find the correct address.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/s390/kvm/priv.c')
-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 6bbd7b5a0bbe..ecc58a694df7 100644 --- a/arch/s390/kvm/priv.c +++ b/arch/s390/kvm/priv.c | |||
@@ -105,7 +105,8 @@ static int handle_store_cpu_address(struct kvm_vcpu *vcpu) | |||
105 | static int handle_skey(struct kvm_vcpu *vcpu) | 105 | static int handle_skey(struct kvm_vcpu *vcpu) |
106 | { | 106 | { |
107 | vcpu->stat.instruction_storage_key++; | 107 | vcpu->stat.instruction_storage_key++; |
108 | vcpu->arch.sie_block->gpsw.addr -= 4; | 108 | vcpu->arch.sie_block->gpsw.addr = |
109 | __rewind_psw(vcpu->arch.sie_block->gpsw, 4); | ||
109 | VCPU_EVENT(vcpu, 4, "%s", "retrying storage key operation"); | 110 | VCPU_EVENT(vcpu, 4, "%s", "retrying storage key operation"); |
110 | return 0; | 111 | return 0; |
111 | } | 112 | } |