aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm
diff options
context:
space:
mode:
authorDavid Hildenbrand <dahi@linux.vnet.ibm.com>2016-04-13 09:47:21 -0400
committerChristian Borntraeger <borntraeger@de.ibm.com>2016-06-10 06:07:29 -0400
commit2c26d1d23abd9a67d056c95a0823132a71edc477 (patch)
treeebc5b10f84d5750549851f3d9ad002d3f3fdf91b /arch/s390/kvm
parent9a68f0af8cd907452fa6c33343d38cdacff96294 (diff)
KVM: s390: pfmf: take care of amode when setting reg2
Depending on the addressing mode, we must not overwrite bit 0-31 of the register. In addition, 24 bit and 31 bit have to set certain bits to 0, which is guaranteed by converting the end address to an effective address. Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm')
-rw-r--r--arch/s390/kvm/priv.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index 5c926b74d7ca..71fa603034d0 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -733,8 +733,15 @@ static int handle_pfmf(struct kvm_vcpu *vcpu)
733 733
734 start += PAGE_SIZE; 734 start += PAGE_SIZE;
735 } 735 }
736 if (vcpu->run->s.regs.gprs[reg1] & PFMF_FSC) 736 if (vcpu->run->s.regs.gprs[reg1] & PFMF_FSC) {
737 vcpu->run->s.regs.gprs[reg2] = end; 737 if (psw_bits(vcpu->arch.sie_block->gpsw).eaba == PSW_AMODE_64BIT) {
738 vcpu->run->s.regs.gprs[reg2] = end;
739 } else {
740 vcpu->run->s.regs.gprs[reg2] &= ~0xffffffffUL;
741 end = kvm_s390_logical_to_effective(vcpu, end);
742 vcpu->run->s.regs.gprs[reg2] |= end;
743 }
744 }
738 return 0; 745 return 0;
739} 746}
740 747