KVM: s390: fix diagnose code extraction
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 11 Nov 2013 12:56:47 +0000 (13:56 +0100)
committerCornelia Huck <cornelia.huck@de.ibm.com>
Thu, 28 Nov 2013 10:08:15 +0000 (11:08 +0100)
The diagnose code to be used is the contents of the base register (if not
zero), plus the displacement. The current code ignores the base register
contents. So let's fix that...

Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: stable@vger.kernel.org
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
arch/s390/kvm/diag.c

index 78d967f180f4adc088aea609df1cc664ad57b917..5ff29be7d87a2e92c1b6b944b7b10bc82fb7a46e 100644 (file)
@@ -137,7 +137,7 @@ static int __diag_virtio_hypercall(struct kvm_vcpu *vcpu)
 
 int kvm_s390_handle_diag(struct kvm_vcpu *vcpu)
 {
-       int code = (vcpu->arch.sie_block->ipb & 0xfff0000) >> 16;
+       int code = kvm_s390_get_base_disp_rs(vcpu) & 0xffff;
 
        if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
                return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);