Lines Matching +full:ipa +full:- +full:reg
1 // SPDX-License-Identifier: GPL-2.0
17 #include "kvm-s390.h"
21 u64 *reg) in __sigp_sense() argument
31 *reg &= 0xffffffff00000000UL; in __sigp_sense()
33 *reg |= SIGP_STATUS_EXT_CALL_PENDING; in __sigp_sense()
35 *reg |= SIGP_STATUS_STOPPED; in __sigp_sense()
39 VCPU_EVENT(vcpu, 4, "sensed status of cpu %x rc %x", dst_vcpu->vcpu_id, in __sigp_sense()
49 .u.emerg.code = vcpu->vcpu_id, in __inject_sigp_emergency()
56 dst_vcpu->vcpu_id); in __inject_sigp_emergency()
68 u16 asn, u64 *reg) in __sigp_conditional_emergency() argument
76 psw = &dst_vcpu->arch.sie_block->gpsw; in __sigp_conditional_emergency()
77 p_asn = dst_vcpu->arch.sie_block->gcr[4] & 0xffff; /* Primary ASN */ in __sigp_conditional_emergency()
78 s_asn = dst_vcpu->arch.sie_block->gcr[3] & 0xffff; /* Secondary ASN */ in __sigp_conditional_emergency()
82 || (psw->mask & psw_int_mask) != psw_int_mask in __sigp_conditional_emergency()
83 || (idle && psw->addr != 0) in __sigp_conditional_emergency()
87 *reg &= 0xffffffff00000000UL; in __sigp_conditional_emergency()
88 *reg |= SIGP_STATUS_INCORRECT_STATE; in __sigp_conditional_emergency()
94 struct kvm_vcpu *dst_vcpu, u64 *reg) in __sigp_external_call() argument
98 .u.extcall.code = vcpu->vcpu_id, in __sigp_external_call()
103 if (rc == -EBUSY) { in __sigp_external_call()
104 *reg &= 0xffffffff00000000UL; in __sigp_external_call()
105 *reg |= SIGP_STATUS_EXT_CALL_PENDING; in __sigp_external_call()
109 dst_vcpu->vcpu_id); in __sigp_external_call()
123 if (rc == -EBUSY) in __sigp_stop()
127 dst_vcpu->vcpu_id); in __sigp_stop()
133 struct kvm_vcpu *dst_vcpu, u64 *reg) in __sigp_stop_and_store_status() argument
142 if (rc == -EBUSY) in __sigp_stop_and_store_status()
146 dst_vcpu->vcpu_id); in __sigp_stop_and_store_status()
158 kvm_for_each_vcpu(i, v, vcpu->kvm) { in __sigp_set_arch()
174 u32 address, u64 *reg) in __sigp_set_prefix() argument
187 if (kvm_is_error_gpa(vcpu->kvm, irq.u.prefix.address)) { in __sigp_set_prefix()
188 *reg &= 0xffffffff00000000UL; in __sigp_set_prefix()
189 *reg |= SIGP_STATUS_INVALID_PARAMETER; in __sigp_set_prefix()
194 if (rc == -EBUSY) { in __sigp_set_prefix()
195 *reg &= 0xffffffff00000000UL; in __sigp_set_prefix()
196 *reg |= SIGP_STATUS_INCORRECT_STATE; in __sigp_set_prefix()
205 u32 addr, u64 *reg) in __sigp_store_status_at_addr() argument
210 *reg &= 0xffffffff00000000UL; in __sigp_store_status_at_addr()
211 *reg |= SIGP_STATUS_INCORRECT_STATE; in __sigp_store_status_at_addr()
217 if (rc == -EFAULT) { in __sigp_store_status_at_addr()
218 *reg &= 0xffffffff00000000UL; in __sigp_store_status_at_addr()
219 *reg |= SIGP_STATUS_INVALID_PARAMETER; in __sigp_store_status_at_addr()
226 struct kvm_vcpu *dst_vcpu, u64 *reg) in __sigp_sense_running() argument
230 if (!test_kvm_facility(vcpu->kvm, 9)) { in __sigp_sense_running()
231 *reg &= 0xffffffff00000000UL; in __sigp_sense_running()
232 *reg |= SIGP_STATUS_INVALID_ORDER; in __sigp_sense_running()
241 *reg &= 0xffffffff00000000UL; in __sigp_sense_running()
242 *reg |= SIGP_STATUS_NOT_RUNNING; in __sigp_sense_running()
247 dst_vcpu->vcpu_id, rc); in __sigp_sense_running()
255 struct kvm_s390_local_interrupt *li = &dst_vcpu->arch.local_int; in __prepare_sigp_re_start()
257 int rc = -EOPNOTSUPP; in __prepare_sigp_re_start()
260 spin_lock(&li->lock); in __prepare_sigp_re_start()
263 spin_unlock(&li->lock); in __prepare_sigp_re_start()
272 return -EOPNOTSUPP; in __prepare_sigp_cpu_reset()
279 return -EOPNOTSUPP; in __prepare_sigp_unknown()
286 struct kvm_vcpu *dst_vcpu = kvm_get_vcpu_by_id(vcpu->kvm, cpu_addr); in handle_sigp_dst()
293 vcpu->stat.instruction_sigp_sense++; in handle_sigp_dst()
297 vcpu->stat.instruction_sigp_external_call++; in handle_sigp_dst()
301 vcpu->stat.instruction_sigp_emergency++; in handle_sigp_dst()
305 vcpu->stat.instruction_sigp_stop++; in handle_sigp_dst()
309 vcpu->stat.instruction_sigp_stop_store_status++; in handle_sigp_dst()
313 vcpu->stat.instruction_sigp_store_status++; in handle_sigp_dst()
318 vcpu->stat.instruction_sigp_prefix++; in handle_sigp_dst()
322 vcpu->stat.instruction_sigp_cond_emergency++; in handle_sigp_dst()
327 vcpu->stat.instruction_sigp_sense_running++; in handle_sigp_dst()
331 vcpu->stat.instruction_sigp_start++; in handle_sigp_dst()
335 vcpu->stat.instruction_sigp_restart++; in handle_sigp_dst()
339 vcpu->stat.instruction_sigp_init_cpu_reset++; in handle_sigp_dst()
343 vcpu->stat.instruction_sigp_cpu_reset++; in handle_sigp_dst()
347 vcpu->stat.instruction_sigp_unknown++; in handle_sigp_dst()
351 if (rc == -EOPNOTSUPP) in handle_sigp_dst()
353 "sigp order %u -> cpu %x: handled in user space", in handle_sigp_dst()
354 order_code, dst_vcpu->vcpu_id); in handle_sigp_dst()
362 if (!vcpu->kvm->arch.user_sigp) in handle_sigp_order_in_user_space()
374 vcpu->stat.instruction_sigp_stop++; in handle_sigp_order_in_user_space()
377 vcpu->stat.instruction_sigp_stop_store_status++; in handle_sigp_order_in_user_space()
380 vcpu->stat.instruction_sigp_store_status++; in handle_sigp_order_in_user_space()
383 vcpu->stat.instruction_sigp_store_adtl_status++; in handle_sigp_order_in_user_space()
386 vcpu->stat.instruction_sigp_prefix++; in handle_sigp_order_in_user_space()
389 vcpu->stat.instruction_sigp_start++; in handle_sigp_order_in_user_space()
392 vcpu->stat.instruction_sigp_restart++; in handle_sigp_order_in_user_space()
395 vcpu->stat.instruction_sigp_init_cpu_reset++; in handle_sigp_order_in_user_space()
398 vcpu->stat.instruction_sigp_cpu_reset++; in handle_sigp_order_in_user_space()
401 vcpu->stat.instruction_sigp_unknown++; in handle_sigp_order_in_user_space()
411 int r1 = (vcpu->arch.sie_block->ipa & 0x00f0) >> 4; in kvm_s390_handle_sigp()
412 int r3 = vcpu->arch.sie_block->ipa & 0x000f; in kvm_s390_handle_sigp()
414 u16 cpu_addr = vcpu->run->s.regs.gprs[r3]; in kvm_s390_handle_sigp()
419 if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_PSTATE) in kvm_s390_handle_sigp()
424 return -EOPNOTSUPP; in kvm_s390_handle_sigp()
427 parameter = vcpu->run->s.regs.gprs[r1]; in kvm_s390_handle_sigp()
429 parameter = vcpu->run->s.regs.gprs[r1 + 1]; in kvm_s390_handle_sigp()
434 vcpu->stat.instruction_sigp_arch++; in kvm_s390_handle_sigp()
436 &vcpu->run->s.regs.gprs[r1]); in kvm_s390_handle_sigp()
441 &vcpu->run->s.regs.gprs[r1]); in kvm_s390_handle_sigp()
462 int r3 = vcpu->arch.sie_block->ipa & 0x000f; in kvm_s390_handle_sigp_pei()
463 u16 cpu_addr = vcpu->run->s.regs.gprs[r3]; in kvm_s390_handle_sigp_pei()
470 dest_vcpu = kvm_get_vcpu_by_id(vcpu->kvm, cpu_addr); in kvm_s390_handle_sigp_pei()
478 return -EOPNOTSUPP; in kvm_s390_handle_sigp_pei()