Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e7a3f94 authored by Heiko Carstens's avatar Heiko Carstens Committed by Christian Borntraeger
Browse files

KVM: s390: convert handle_set_clock()



Convert handle_set_clock() to new guest access functions.

Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: default avatarThomas Huth <thuth@linux.vnet.ibm.com>
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
parent 665170cb
Loading
Loading
Loading
Loading
+4 −3
Original line number Original line Diff line number Diff line
@@ -35,8 +35,8 @@ static int handle_set_clock(struct kvm_vcpu *vcpu)
{
{
	struct kvm_vcpu *cpup;
	struct kvm_vcpu *cpup;
	s64 hostclk, val;
	s64 hostclk, val;
	int i, rc;
	u64 op2;
	u64 op2;
	int i;


	if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
	if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE)
		return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);
		return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP);
@@ -44,8 +44,9 @@ static int handle_set_clock(struct kvm_vcpu *vcpu)
	op2 = kvm_s390_get_base_disp_s(vcpu);
	op2 = kvm_s390_get_base_disp_s(vcpu);
	if (op2 & 7)	/* Operand must be on a doubleword boundary */
	if (op2 & 7)	/* Operand must be on a doubleword boundary */
		return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
		return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION);
	if (get_guest(vcpu, val, (u64 __user *) op2))
	rc = read_guest(vcpu, op2, &val, sizeof(val));
		return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
	if (rc)
		return kvm_s390_inject_prog_cond(vcpu, rc);


	if (store_tod_clock(&hostclk)) {
	if (store_tod_clock(&hostclk)) {
		kvm_s390_set_psw_cc(vcpu, 3);
		kvm_s390_set_psw_cc(vcpu, 3);