]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
s390/kvm: fix psw rewinding in handle_skey
authorMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 17 May 2013 12:41:32 +0000 (14:41 +0200)
committerGleb Natapov <gleb@redhat.com>
Tue, 21 May 2013 08:55:18 +0000 (11:55 +0300)
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>
arch/s390/kvm/priv.c

index 6bbd7b5a0bbee36d483e7deba484ce96e3176dfb..ecc58a694df7516b7aed8cd89768e9236c08ea0f 100644 (file)
@@ -105,7 +105,8 @@ static int handle_store_cpu_address(struct kvm_vcpu *vcpu)
 static int handle_skey(struct kvm_vcpu *vcpu)
 {
        vcpu->stat.instruction_storage_key++;
-       vcpu->arch.sie_block->gpsw.addr -= 4;
+       vcpu->arch.sie_block->gpsw.addr =
+               __rewind_psw(vcpu->arch.sie_block->gpsw, 4);
        VCPU_EVENT(vcpu, 4, "%s", "retrying storage key operation");
        return 0;
 }