aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/priv.c
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2014-01-01 10:53:49 -0500
committerChristian Borntraeger <borntraeger@de.ibm.com>2014-04-22 07:24:44 -0400
commitef23e7790e148041d159c1f710bee2b7b2f0d8cd (patch)
tree22db21eebd91beb50f2e9656d8fc3f00f6cdca8e /arch/s390/kvm/priv.c
parent8b96de0e0359b731b1e5ec897f217f8bf7e5903f (diff)
KVM: s390: convert handle_test_block()
Convert handle_test_block() to new guest access functions. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/priv.c')
-rw-r--r--arch/s390/kvm/priv.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c
index 36c34cf22889..5abfd531a8f1 100644
--- a/arch/s390/kvm/priv.c
+++ b/arch/s390/kvm/priv.c
@@ -198,7 +198,6 @@ static int handle_ipte_interlock(struct kvm_vcpu *vcpu)
198 198
199static int handle_test_block(struct kvm_vcpu *vcpu) 199static int handle_test_block(struct kvm_vcpu *vcpu)
200{ 200{
201 unsigned long hva;
202 gpa_t addr; 201 gpa_t addr;
203 int reg2; 202 int reg2;
204 203
@@ -209,14 +208,13 @@ static int handle_test_block(struct kvm_vcpu *vcpu)
209 addr = vcpu->run->s.regs.gprs[reg2] & PAGE_MASK; 208 addr = vcpu->run->s.regs.gprs[reg2] & PAGE_MASK;
210 addr = kvm_s390_real_to_abs(vcpu, addr); 209 addr = kvm_s390_real_to_abs(vcpu, addr);
211 210
212 hva = gfn_to_hva(vcpu->kvm, gpa_to_gfn(addr)); 211 if (kvm_is_error_gpa(vcpu->kvm, addr))
213 if (kvm_is_error_hva(hva))
214 return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); 212 return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
215 /* 213 /*
216 * We don't expect errors on modern systems, and do not care 214 * We don't expect errors on modern systems, and do not care
217 * about storage keys (yet), so let's just clear the page. 215 * about storage keys (yet), so let's just clear the page.
218 */ 216 */
219 if (clear_user((void __user *)hva, PAGE_SIZE) != 0) 217 if (kvm_clear_guest(vcpu->kvm, addr, PAGE_SIZE))
220 return -EFAULT; 218 return -EFAULT;
221 kvm_s390_set_psw_cc(vcpu, 0); 219 kvm_s390_set_psw_cc(vcpu, 0);
222 vcpu->run->s.regs.gprs[0] = 0; 220 vcpu->run->s.regs.gprs[0] = 0;