Lines Matching +full:run +full:- +full:time
1 // SPDX-License-Identifier: GPL-2.0
14 #include <asm/virtio-ccw.h>
15 #include "kvm-s390.h"
17 #include "trace-s390.h"
25 start = vcpu->run->s.regs.gprs[(vcpu->arch.sie_block->ipa & 0xf0) >> 4]; in diag_release_pages()
26 end = vcpu->run->s.regs.gprs[vcpu->arch.sie_block->ipa & 0xf] + PAGE_SIZE; in diag_release_pages()
27 vcpu->stat.instruction_diagnose_10++; in diag_release_pages()
40 gmap_discard(vcpu->arch.gmap, start, end); in diag_release_pages()
48 gmap_discard(vcpu->arch.gmap, start, prefix); in diag_release_pages()
50 gmap_discard(vcpu->arch.gmap, 0, PAGE_SIZE); in diag_release_pages()
52 gmap_discard(vcpu->arch.gmap, PAGE_SIZE, 2 * PAGE_SIZE); in diag_release_pages()
53 gmap_discard(vcpu->arch.gmap, prefix + 2 * PAGE_SIZE, end); in diag_release_pages()
72 u16 rx = (vcpu->arch.sie_block->ipa & 0xf0) >> 4; in __diag_page_ref_service()
73 u16 ry = (vcpu->arch.sie_block->ipa & 0x0f); in __diag_page_ref_service()
76 vcpu->run->s.regs.gprs[rx]); in __diag_page_ref_service()
77 vcpu->stat.instruction_diagnose_258++; in __diag_page_ref_service()
78 if (vcpu->run->s.regs.gprs[rx] & 7) in __diag_page_ref_service()
80 rc = read_guest(vcpu, vcpu->run->s.regs.gprs[rx], rx, &parm, sizeof(parm)); in __diag_page_ref_service()
91 if (vcpu->arch.pfault_token != KVM_S390_PFAULT_TOKEN_INVALID) { in __diag_page_ref_service()
95 * decimal 8 instead, as mandated in SC24-6084. in __diag_page_ref_service()
97 vcpu->run->s.regs.gprs[ry] = 8; in __diag_page_ref_service()
105 if (kvm_is_error_gpa(vcpu->kvm, parm.token_addr)) in __diag_page_ref_service()
108 vcpu->arch.pfault_token = parm.token_addr; in __diag_page_ref_service()
109 vcpu->arch.pfault_select = parm.select_mask; in __diag_page_ref_service()
110 vcpu->arch.pfault_compare = parm.compare_mask; in __diag_page_ref_service()
111 vcpu->run->s.regs.gprs[ry] = 0; in __diag_page_ref_service()
125 vcpu->run->s.regs.gprs[ry] = 0; in __diag_page_ref_service()
128 * canceled SC24-6084 requests to return decimal 4. in __diag_page_ref_service()
130 if (vcpu->arch.pfault_token == KVM_S390_PFAULT_TOKEN_INVALID) in __diag_page_ref_service()
131 vcpu->run->s.regs.gprs[ry] = 4; in __diag_page_ref_service()
133 vcpu->arch.pfault_token = KVM_S390_PFAULT_TOKEN_INVALID; in __diag_page_ref_service()
138 rc = -EOPNOTSUPP; in __diag_page_ref_service()
147 VCPU_EVENT(vcpu, 5, "%s", "diag time slice end"); in __diag_time_slice_end()
148 vcpu->stat.instruction_diagnose_44++; in __diag_time_slice_end()
163 return forward_cnt-- <= 0 ? 1 : 0; in diag9c_forwarding_overrun()
171 tid = vcpu->run->s.regs.gprs[(vcpu->arch.sie_block->ipa & 0xf0) >> 4]; in __diag_time_slice_end_directed()
172 vcpu->stat.instruction_diagnose_9c++; in __diag_time_slice_end_directed()
175 if (tid == vcpu->vcpu_id) in __diag_time_slice_end_directed()
179 tcpu = kvm_get_vcpu_by_id(vcpu->kvm, tid); in __diag_time_slice_end_directed()
184 if (READ_ONCE(tcpu->cpu) >= 0) { in __diag_time_slice_end_directed()
189 if (!vcpu_is_preempted(tcpu->cpu)) in __diag_time_slice_end_directed()
191 smp_yield_cpu(tcpu->cpu); in __diag_time_slice_end_directed()
193 "diag time slice end directed to %d: yield forwarded", in __diag_time_slice_end_directed()
195 vcpu->stat.diag_9c_forward++; in __diag_time_slice_end_directed()
202 VCPU_EVENT(vcpu, 5, "diag time slice end directed to %d: done", tid); in __diag_time_slice_end_directed()
205 VCPU_EVENT(vcpu, 5, "diag time slice end directed to %d: ignored", tid); in __diag_time_slice_end_directed()
206 vcpu->stat.diag_9c_ignored++; in __diag_time_slice_end_directed()
212 unsigned int reg = vcpu->arch.sie_block->ipa & 0xf; in __diag_ipl_functions()
213 unsigned long subcode = vcpu->run->s.regs.gprs[reg] & 0xffff; in __diag_ipl_functions()
216 vcpu->stat.instruction_diagnose_308++; in __diag_ipl_functions()
219 vcpu->run->s390_reset_flags = KVM_S390_RESET_CLEAR; in __diag_ipl_functions()
222 vcpu->run->s390_reset_flags = 0; in __diag_ipl_functions()
225 return -EOPNOTSUPP; in __diag_ipl_functions()
232 if (!kvm_s390_user_cpu_state_ctrl(vcpu->kvm)) in __diag_ipl_functions()
234 vcpu->run->s390_reset_flags |= KVM_S390_RESET_SUBSYSTEM; in __diag_ipl_functions()
235 vcpu->run->s390_reset_flags |= KVM_S390_RESET_IPL; in __diag_ipl_functions()
236 vcpu->run->s390_reset_flags |= KVM_S390_RESET_CPU_INIT; in __diag_ipl_functions()
237 vcpu->run->exit_reason = KVM_EXIT_S390_RESET; in __diag_ipl_functions()
239 vcpu->run->s390_reset_flags); in __diag_ipl_functions()
240 trace_kvm_s390_request_resets(vcpu->run->s390_reset_flags); in __diag_ipl_functions()
241 return -EREMOTE; in __diag_ipl_functions()
248 vcpu->stat.instruction_diagnose_500++; in __diag_virtio_hypercall()
249 /* No virtio-ccw notification? Get out quickly. */ in __diag_virtio_hypercall()
250 if (!vcpu->kvm->arch.css_support || in __diag_virtio_hypercall()
251 (vcpu->run->s.regs.gprs[1] != KVM_S390_VIRTIO_CCW_NOTIFY)) in __diag_virtio_hypercall()
252 return -EOPNOTSUPP; in __diag_virtio_hypercall()
255 (u32) vcpu->run->s.regs.gprs[2], in __diag_virtio_hypercall()
256 (u32) vcpu->run->s.regs.gprs[3], in __diag_virtio_hypercall()
257 vcpu->run->s.regs.gprs[4]); in __diag_virtio_hypercall()
261 * - gpr 2 contains the subchannel id (passed as addr) in __diag_virtio_hypercall()
262 * - gpr 3 contains the virtqueue index (passed as datamatch) in __diag_virtio_hypercall()
263 * - gpr 4 contains the index on the bus (optionally) in __diag_virtio_hypercall()
266 vcpu->run->s.regs.gprs[2] & 0xffffffff, in __diag_virtio_hypercall()
267 8, &vcpu->run->s.regs.gprs[3], in __diag_virtio_hypercall()
268 vcpu->run->s.regs.gprs[4]); in __diag_virtio_hypercall()
274 if (ret != -EOPNOTSUPP) in __diag_virtio_hypercall()
275 vcpu->run->s.regs.gprs[2] = ret; in __diag_virtio_hypercall()
276 /* kvm_io_bus_write_cookie returns -EOPNOTSUPP if it found no match. */ in __diag_virtio_hypercall()
284 if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) in kvm_s390_handle_diag()
302 vcpu->stat.instruction_diagnose_other++; in kvm_s390_handle_diag()
303 return -EOPNOTSUPP; in kvm_s390_handle_diag()