diff options
author | Thomas Huth <thuth@linux.vnet.ibm.com> | 2014-11-10 09:59:32 -0500 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2014-11-28 06:32:38 -0500 |
commit | a02689fecdbc36503b1496a5d36707bb4559db63 (patch) | |
tree | 225175dd04de2c0eb5b7432ff8fcc79ab3c8b06d /arch/s390/kvm | |
parent | b65d6e17fe2239c9b2051727903955d922083fbf (diff) |
KVM: s390: Small fixes for the PFMF handler
This patch includes two small fixes for the PFMF handler: First, the
start address for PFMF has to be masked according to the current
addressing mode, which is now done with kvm_s390_logical_to_effective().
Second, the protection exceptions have a lower priority than the
specification exceptions, so the check for low-address protection
has to be moved after the last spot where we inject a specification
exception.
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>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r-- | arch/s390/kvm/priv.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c index 9bde32f66eb5..04f70fde9636 100644 --- a/arch/s390/kvm/priv.c +++ b/arch/s390/kvm/priv.c | |||
@@ -646,10 +646,7 @@ static int handle_pfmf(struct kvm_vcpu *vcpu) | |||
646 | return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); | 646 | return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); |
647 | 647 | ||
648 | start = vcpu->run->s.regs.gprs[reg2] & PAGE_MASK; | 648 | start = vcpu->run->s.regs.gprs[reg2] & PAGE_MASK; |
649 | if (vcpu->run->s.regs.gprs[reg1] & PFMF_CF) { | 649 | start = kvm_s390_logical_to_effective(vcpu, start); |
650 | if (kvm_s390_check_low_addr_protection(vcpu, start)) | ||
651 | return kvm_s390_inject_prog_irq(vcpu, &vcpu->arch.pgm); | ||
652 | } | ||
653 | 650 | ||
654 | switch (vcpu->run->s.regs.gprs[reg1] & PFMF_FSC) { | 651 | switch (vcpu->run->s.regs.gprs[reg1] & PFMF_FSC) { |
655 | case 0x00000000: | 652 | case 0x00000000: |
@@ -665,6 +662,12 @@ static int handle_pfmf(struct kvm_vcpu *vcpu) | |||
665 | default: | 662 | default: |
666 | return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); | 663 | return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); |
667 | } | 664 | } |
665 | |||
666 | if (vcpu->run->s.regs.gprs[reg1] & PFMF_CF) { | ||
667 | if (kvm_s390_check_low_addr_protection(vcpu, start)) | ||
668 | return kvm_s390_inject_prog_irq(vcpu, &vcpu->arch.pgm); | ||
669 | } | ||
670 | |||
668 | while (start < end) { | 671 | while (start < end) { |
669 | unsigned long useraddr, abs_addr; | 672 | unsigned long useraddr, abs_addr; |
670 | 673 | ||