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>
This commit is contained in:
Heiko Carstens 2014-01-01 16:53:49 +01:00 коммит произвёл Christian Borntraeger
Родитель 8b96de0e03
Коммит ef23e7790e
1 изменённых файлов: 2 добавлений и 4 удалений

Просмотреть файл

@ -198,7 +198,6 @@ static int handle_ipte_interlock(struct kvm_vcpu *vcpu)
static int handle_test_block(struct kvm_vcpu *vcpu) static int handle_test_block(struct kvm_vcpu *vcpu)
{ {
unsigned long hva;
gpa_t addr; gpa_t addr;
int reg2; int reg2;
@ -209,14 +208,13 @@ static int handle_test_block(struct kvm_vcpu *vcpu)
addr = vcpu->run->s.regs.gprs[reg2] & PAGE_MASK; addr = vcpu->run->s.regs.gprs[reg2] & PAGE_MASK;
addr = kvm_s390_real_to_abs(vcpu, addr); addr = kvm_s390_real_to_abs(vcpu, addr);
hva = gfn_to_hva(vcpu->kvm, gpa_to_gfn(addr)); if (kvm_is_error_gpa(vcpu->kvm, addr))
if (kvm_is_error_hva(hva))
return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
/* /*
* We don't expect errors on modern systems, and do not care * We don't expect errors on modern systems, and do not care
* about storage keys (yet), so let's just clear the page. * about storage keys (yet), so let's just clear the page.
*/ */
if (clear_user((void __user *)hva, PAGE_SIZE) != 0) if (kvm_clear_guest(vcpu->kvm, addr, PAGE_SIZE))
return -EFAULT; return -EFAULT;
kvm_s390_set_psw_cc(vcpu, 0); kvm_s390_set_psw_cc(vcpu, 0);
vcpu->run->s.regs.gprs[0] = 0; vcpu->run->s.regs.gprs[0] = 0;