Lines Matching +full:ipa +full:- +full:reg
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.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.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()
148 vcpu->stat.diagnose_44++; in __diag_time_slice_end()
158 tid = vcpu->run->s.regs.gprs[(vcpu->arch.sie_block->ipa & 0xf0) >> 4]; in __diag_time_slice_end_directed()
159 vcpu->stat.diagnose_9c++; in __diag_time_slice_end_directed()
162 if (tid == vcpu->vcpu_id) in __diag_time_slice_end_directed()
166 tcpu = kvm_get_vcpu_by_id(vcpu->kvm, tid); in __diag_time_slice_end_directed()
171 if (READ_ONCE(tcpu->cpu) >= 0) in __diag_time_slice_end_directed()
181 vcpu->stat.diagnose_9c_ignored++; in __diag_time_slice_end_directed()
187 unsigned int reg = vcpu->arch.sie_block->ipa & 0xf; in __diag_ipl_functions() local
188 unsigned long subcode = vcpu->run->s.regs.gprs[reg] & 0xffff; in __diag_ipl_functions()
191 vcpu->stat.diagnose_308++; in __diag_ipl_functions()
194 vcpu->run->s390_reset_flags = KVM_S390_RESET_CLEAR; in __diag_ipl_functions()
197 vcpu->run->s390_reset_flags = 0; in __diag_ipl_functions()
200 return -EOPNOTSUPP; in __diag_ipl_functions()
207 if (!kvm_s390_user_cpu_state_ctrl(vcpu->kvm)) in __diag_ipl_functions()
209 vcpu->run->s390_reset_flags |= KVM_S390_RESET_SUBSYSTEM; in __diag_ipl_functions()
210 vcpu->run->s390_reset_flags |= KVM_S390_RESET_IPL; in __diag_ipl_functions()
211 vcpu->run->s390_reset_flags |= KVM_S390_RESET_CPU_INIT; in __diag_ipl_functions()
212 vcpu->run->exit_reason = KVM_EXIT_S390_RESET; in __diag_ipl_functions()
214 vcpu->run->s390_reset_flags); in __diag_ipl_functions()
215 trace_kvm_s390_request_resets(vcpu->run->s390_reset_flags); in __diag_ipl_functions()
216 return -EREMOTE; in __diag_ipl_functions()
223 vcpu->stat.diagnose_500++; in __diag_virtio_hypercall()
224 /* No virtio-ccw notification? Get out quickly. */ in __diag_virtio_hypercall()
225 if (!vcpu->kvm->arch.css_support || in __diag_virtio_hypercall()
226 (vcpu->run->s.regs.gprs[1] != KVM_S390_VIRTIO_CCW_NOTIFY)) in __diag_virtio_hypercall()
227 return -EOPNOTSUPP; in __diag_virtio_hypercall()
230 (u32) vcpu->run->s.regs.gprs[2], in __diag_virtio_hypercall()
231 (u32) vcpu->run->s.regs.gprs[3], in __diag_virtio_hypercall()
232 vcpu->run->s.regs.gprs[4]); in __diag_virtio_hypercall()
236 * - gpr 2 contains the subchannel id (passed as addr) in __diag_virtio_hypercall()
237 * - gpr 3 contains the virtqueue index (passed as datamatch) in __diag_virtio_hypercall()
238 * - gpr 4 contains the index on the bus (optionally) in __diag_virtio_hypercall()
241 vcpu->run->s.regs.gprs[2] & 0xffffffff, in __diag_virtio_hypercall()
242 8, &vcpu->run->s.regs.gprs[3], in __diag_virtio_hypercall()
243 vcpu->run->s.regs.gprs[4]); in __diag_virtio_hypercall()
249 if (ret != -EOPNOTSUPP) in __diag_virtio_hypercall()
250 vcpu->run->s.regs.gprs[2] = ret; in __diag_virtio_hypercall()
251 /* kvm_io_bus_write_cookie returns -EOPNOTSUPP if it found no match. */ in __diag_virtio_hypercall()
259 if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) in kvm_s390_handle_diag()
277 vcpu->stat.diagnose_other++; in kvm_s390_handle_diag()
278 return -EOPNOTSUPP; in kvm_s390_handle_diag()