KVM: s390: Add low-address protection to TEST BLOCK
authorThomas Huth <thuth@linux.vnet.ibm.com>
Fri, 7 Mar 2014 11:14:23 +0000 (12:14 +0100)
committerChristian Borntraeger <borntraeger@de.ibm.com>
Tue, 29 Apr 2014 13:01:53 +0000 (15:01 +0200)
TEST BLOCK is also subject to the low-address protection, so we need
to check the destination address in our handler.

Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
arch/s390/kvm/priv.c

index a47157bca8a6ddd53374c0df23b830239b02b211..07d0c1025cb9de9296da24068968aa8250a12339 100644 (file)
@@ -206,6 +206,9 @@ static int handle_test_block(struct kvm_vcpu *vcpu)
 
        kvm_s390_get_regs_rre(vcpu, NULL, &reg2);
        addr = vcpu->run->s.regs.gprs[reg2] & PAGE_MASK;
+       addr = kvm_s390_logical_to_effective(vcpu, addr);
+       if (kvm_s390_check_low_addr_protection(vcpu, addr))
+               return kvm_s390_inject_prog_irq(vcpu, &vcpu->arch.pgm);
        addr = kvm_s390_real_to_abs(vcpu, addr);
 
        if (kvm_is_error_gpa(vcpu->kvm, addr))