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_real(vcpu, vcpu->run->s.regs.gprs[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_gpa_in_memslot(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()
172 tid = vcpu->run->s.regs.gprs[(vcpu->arch.sie_block->ipa & 0xf0) >> 4]; in __diag_time_slice_end_directed()
173 vcpu->stat.instruction_diagnose_9c++; in __diag_time_slice_end_directed()
176 if (tid == vcpu->vcpu_id) in __diag_time_slice_end_directed()
180 tcpu = kvm_get_vcpu_by_id(vcpu->kvm, tid); in __diag_time_slice_end_directed()
185 tcpu_cpu = READ_ONCE(tcpu->cpu); in __diag_time_slice_end_directed()
195 "diag time slice end directed to %d: yield forwarded", in __diag_time_slice_end_directed()
197 vcpu->stat.diag_9c_forward++; in __diag_time_slice_end_directed()
204 VCPU_EVENT(vcpu, 5, "diag time slice end directed to %d: done", tid); in __diag_time_slice_end_directed()
207 VCPU_EVENT(vcpu, 5, "diag time slice end directed to %d: ignored", tid); in __diag_time_slice_end_directed()
208 vcpu->stat.diag_9c_ignored++; in __diag_time_slice_end_directed()
214 unsigned int reg = vcpu->arch.sie_block->ipa & 0xf; in __diag_ipl_functions()
215 unsigned long subcode = vcpu->run->s.regs.gprs[reg] & 0xffff; in __diag_ipl_functions()
218 vcpu->stat.instruction_diagnose_308++; in __diag_ipl_functions()
221 vcpu->run->s390_reset_flags = KVM_S390_RESET_CLEAR; in __diag_ipl_functions()
224 vcpu->run->s390_reset_flags = 0; in __diag_ipl_functions()
227 return -EOPNOTSUPP; in __diag_ipl_functions()
234 if (!kvm_s390_user_cpu_state_ctrl(vcpu->kvm)) in __diag_ipl_functions()
236 vcpu->run->s390_reset_flags |= KVM_S390_RESET_SUBSYSTEM; in __diag_ipl_functions()
237 vcpu->run->s390_reset_flags |= KVM_S390_RESET_IPL; in __diag_ipl_functions()
238 vcpu->run->s390_reset_flags |= KVM_S390_RESET_CPU_INIT; in __diag_ipl_functions()
239 vcpu->run->exit_reason = KVM_EXIT_S390_RESET; in __diag_ipl_functions()
241 vcpu->run->s390_reset_flags); in __diag_ipl_functions()
242 trace_kvm_s390_request_resets(vcpu->run->s390_reset_flags); in __diag_ipl_functions()
243 return -EREMOTE; in __diag_ipl_functions()
250 vcpu->stat.instruction_diagnose_500++; in __diag_virtio_hypercall()
251 /* No virtio-ccw notification? Get out quickly. */ in __diag_virtio_hypercall()
252 if (!vcpu->kvm->arch.css_support || in __diag_virtio_hypercall()
253 (vcpu->run->s.regs.gprs[1] != KVM_S390_VIRTIO_CCW_NOTIFY)) in __diag_virtio_hypercall()
254 return -EOPNOTSUPP; in __diag_virtio_hypercall()
257 (u32) vcpu->run->s.regs.gprs[2], in __diag_virtio_hypercall()
258 (u32) vcpu->run->s.regs.gprs[3], in __diag_virtio_hypercall()
259 vcpu->run->s.regs.gprs[4]); in __diag_virtio_hypercall()
263 * - gpr 2 contains the subchannel id (passed as addr) in __diag_virtio_hypercall()
264 * - gpr 3 contains the virtqueue index (passed as datamatch) in __diag_virtio_hypercall()
265 * - gpr 4 contains the index on the bus (optionally) in __diag_virtio_hypercall()
268 vcpu->run->s.regs.gprs[2] & 0xffffffff, in __diag_virtio_hypercall()
269 8, &vcpu->run->s.regs.gprs[3], in __diag_virtio_hypercall()
270 vcpu->run->s.regs.gprs[4]); in __diag_virtio_hypercall()
276 if (ret != -EOPNOTSUPP) in __diag_virtio_hypercall()
277 vcpu->run->s.regs.gprs[2] = ret; in __diag_virtio_hypercall()
278 /* kvm_io_bus_write_cookie returns -EOPNOTSUPP if it found no match. */ in __diag_virtio_hypercall()
286 if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) in kvm_s390_handle_diag()
304 vcpu->stat.instruction_diagnose_other++; in kvm_s390_handle_diag()
305 return -EOPNOTSUPP; in kvm_s390_handle_diag()