diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2014-01-01 10:53:27 -0500 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2014-04-22 07:24:43 -0400 |
commit | 8b96de0e0359b731b1e5ec897f217f8bf7e5903f (patch) | |
tree | eb08362f8c6a72e7fbc11b8a1095e40d69ecd516 | |
parent | f748f4a7ec549febb76e86082d9445beff1e9b01 (diff) |
KVM: s390: convert handle_store_cpu_address()
Convert handle_store_cpu_address() 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>
-rw-r--r-- | arch/s390/kvm/priv.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/arch/s390/kvm/priv.c b/arch/s390/kvm/priv.c index 306caa27b962..36c34cf22889 100644 --- a/arch/s390/kvm/priv.c +++ b/arch/s390/kvm/priv.c | |||
@@ -134,23 +134,26 @@ static int handle_store_prefix(struct kvm_vcpu *vcpu) | |||
134 | 134 | ||
135 | static int handle_store_cpu_address(struct kvm_vcpu *vcpu) | 135 | static int handle_store_cpu_address(struct kvm_vcpu *vcpu) |
136 | { | 136 | { |
137 | u64 useraddr; | 137 | u16 vcpu_id = vcpu->vcpu_id; |
138 | u64 ga; | ||
139 | int rc; | ||
138 | 140 | ||
139 | vcpu->stat.instruction_stap++; | 141 | vcpu->stat.instruction_stap++; |
140 | 142 | ||
141 | if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) | 143 | if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) |
142 | return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP); | 144 | return kvm_s390_inject_program_int(vcpu, PGM_PRIVILEGED_OP); |
143 | 145 | ||
144 | useraddr = kvm_s390_get_base_disp_s(vcpu); | 146 | ga = kvm_s390_get_base_disp_s(vcpu); |
145 | 147 | ||
146 | if (useraddr & 1) | 148 | if (ga & 1) |
147 | return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); | 149 | return kvm_s390_inject_program_int(vcpu, PGM_SPECIFICATION); |
148 | 150 | ||
149 | if (put_guest(vcpu, vcpu->vcpu_id, (u16 __user *)useraddr)) | 151 | rc = write_guest(vcpu, ga, &vcpu_id, sizeof(vcpu_id)); |
150 | return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING); | 152 | if (rc) |
153 | return kvm_s390_inject_prog_cond(vcpu, rc); | ||
151 | 154 | ||
152 | VCPU_EVENT(vcpu, 5, "storing cpu address to %llx", useraddr); | 155 | VCPU_EVENT(vcpu, 5, "storing cpu address to %llx", ga); |
153 | trace_kvm_s390_handle_stap(vcpu, useraddr); | 156 | trace_kvm_s390_handle_stap(vcpu, ga); |
154 | return 0; | 157 | return 0; |
155 | } | 158 | } |
156 | 159 | ||