Lines Matching full:run

153 	int (*func)(struct kvm_vcpu *vcpu, struct kvm_run *run, ulong insn);
156 static int truly_illegal_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, in truly_illegal_insn() argument
172 static int truly_virtual_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, in truly_virtual_insn() argument
202 static int wfi_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, ulong insn) in wfi_insn() argument
209 static int wrs_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, ulong insn) in wrs_insn() argument
249 * @run: The VCPU run struct containing the CSR data
253 int kvm_riscv_vcpu_csr_return(struct kvm_vcpu *vcpu, struct kvm_run *run) in kvm_riscv_vcpu_csr_return() argument
265 run->riscv_csr.ret_value); in kvm_riscv_vcpu_csr_return()
273 static int csr_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, ulong insn) in csr_insn() argument
317 run->riscv_csr.csr_num = csr_num; in csr_insn()
318 run->riscv_csr.new_value = new_val; in csr_insn()
319 run->riscv_csr.write_mask = wr_mask; in csr_insn()
320 run->riscv_csr.ret_value = 0; in csr_insn()
337 run->riscv_csr.ret_value = val; in csr_insn()
339 kvm_riscv_vcpu_csr_return(vcpu, run); in csr_insn()
349 run->exit_reason = KVM_EXIT_RISCV_CSR; in csr_insn()
398 static int system_opcode_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, in system_opcode_insn() argument
407 rc = ifn->func(vcpu, run, insn); in system_opcode_insn()
414 return truly_illegal_insn(vcpu, run, insn); in system_opcode_insn()
416 return truly_virtual_insn(vcpu, run, insn); in system_opcode_insn()
431 * @run: The VCPU run struct containing the mmio data
434 * Returns > 0 to continue run-loop
435 * Returns 0 to exit run-loop and handle in user-space.
436 * Returns < 0 to report failure and exit run-loop
438 int kvm_riscv_vcpu_virtual_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, in kvm_riscv_vcpu_virtual_insn() argument
458 return truly_illegal_insn(vcpu, run, insn); in kvm_riscv_vcpu_virtual_insn()
463 return system_opcode_insn(vcpu, run, insn); in kvm_riscv_vcpu_virtual_insn()
465 return truly_illegal_insn(vcpu, run, insn); in kvm_riscv_vcpu_virtual_insn()
473 * @run: The VCPU run struct containing the mmio data
477 * Returns > 0 to continue run-loop
478 * Returns 0 to exit run-loop and handle in user-space.
479 * Returns < 0 to report failure and exit run-loop
481 int kvm_riscv_vcpu_mmio_load(struct kvm_vcpu *vcpu, struct kvm_run *run, in kvm_riscv_vcpu_mmio_load() argument
571 run->mmio.is_write = false; in kvm_riscv_vcpu_mmio_load()
572 run->mmio.phys_addr = fault_addr; in kvm_riscv_vcpu_mmio_load()
573 run->mmio.len = len; in kvm_riscv_vcpu_mmio_load()
578 memcpy(run->mmio.data, data_buf, len); in kvm_riscv_vcpu_mmio_load()
580 kvm_riscv_vcpu_mmio_return(vcpu, run); in kvm_riscv_vcpu_mmio_load()
586 run->exit_reason = KVM_EXIT_MMIO; in kvm_riscv_vcpu_mmio_load()
595 * @run: The VCPU run struct containing the mmio data
599 * Returns > 0 to continue run-loop
600 * Returns 0 to exit run-loop and handle in user-space.
601 * Returns < 0 to report failure and exit run-loop
603 int kvm_riscv_vcpu_mmio_store(struct kvm_vcpu *vcpu, struct kvm_run *run, in kvm_riscv_vcpu_mmio_store() argument
688 *((u8 *)run->mmio.data) = data8; in kvm_riscv_vcpu_mmio_store()
691 *((u16 *)run->mmio.data) = data16; in kvm_riscv_vcpu_mmio_store()
694 *((u32 *)run->mmio.data) = data32; in kvm_riscv_vcpu_mmio_store()
697 *((u64 *)run->mmio.data) = data64; in kvm_riscv_vcpu_mmio_store()
704 run->mmio.is_write = true; in kvm_riscv_vcpu_mmio_store()
705 run->mmio.phys_addr = fault_addr; in kvm_riscv_vcpu_mmio_store()
706 run->mmio.len = len; in kvm_riscv_vcpu_mmio_store()
710 fault_addr, len, run->mmio.data)) { in kvm_riscv_vcpu_mmio_store()
713 kvm_riscv_vcpu_mmio_return(vcpu, run); in kvm_riscv_vcpu_mmio_store()
719 run->exit_reason = KVM_EXIT_MMIO; in kvm_riscv_vcpu_mmio_store()
729 * @run: The VCPU run struct containing the mmio data
731 int kvm_riscv_vcpu_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run) in kvm_riscv_vcpu_mmio_return() argument
746 if (run->mmio.is_write) in kvm_riscv_vcpu_mmio_return()
754 data8 = *((u8 *)run->mmio.data); in kvm_riscv_vcpu_mmio_return()
759 data16 = *((u16 *)run->mmio.data); in kvm_riscv_vcpu_mmio_return()
764 data32 = *((u32 *)run->mmio.data); in kvm_riscv_vcpu_mmio_return()
769 data64 = *((u64 *)run->mmio.data); in kvm_riscv_vcpu_mmio_return()