Lines Matching full:run
148 int (*func)(struct kvm_vcpu *vcpu, struct kvm_run *run, ulong insn);
151 static int truly_illegal_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, in truly_illegal_insn() argument
167 static int truly_virtual_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, in truly_virtual_insn() argument
197 static int wfi_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, ulong insn) in wfi_insn() argument
223 * @run: The VCPU run struct containing the CSR data
227 int kvm_riscv_vcpu_csr_return(struct kvm_vcpu *vcpu, struct kvm_run *run) in kvm_riscv_vcpu_csr_return() argument
239 run->riscv_csr.ret_value); in kvm_riscv_vcpu_csr_return()
247 static int csr_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, ulong insn) in csr_insn() argument
291 run->riscv_csr.csr_num = csr_num; in csr_insn()
292 run->riscv_csr.new_value = new_val; in csr_insn()
293 run->riscv_csr.write_mask = wr_mask; in csr_insn()
294 run->riscv_csr.ret_value = 0; in csr_insn()
311 run->riscv_csr.ret_value = val; in csr_insn()
313 kvm_riscv_vcpu_csr_return(vcpu, run); in csr_insn()
323 run->exit_reason = KVM_EXIT_RISCV_CSR; in csr_insn()
367 static int system_opcode_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, in system_opcode_insn() argument
376 rc = ifn->func(vcpu, run, insn); in system_opcode_insn()
383 return truly_illegal_insn(vcpu, run, insn); in system_opcode_insn()
385 return truly_virtual_insn(vcpu, run, insn); in system_opcode_insn()
400 * @run: The VCPU run struct containing the mmio data
403 * Returns > 0 to continue run-loop
404 * Returns 0 to exit run-loop and handle in user-space.
405 * Returns < 0 to report failure and exit run-loop
407 int kvm_riscv_vcpu_virtual_insn(struct kvm_vcpu *vcpu, struct kvm_run *run, in kvm_riscv_vcpu_virtual_insn() argument
427 return truly_illegal_insn(vcpu, run, insn); in kvm_riscv_vcpu_virtual_insn()
432 return system_opcode_insn(vcpu, run, insn); in kvm_riscv_vcpu_virtual_insn()
434 return truly_illegal_insn(vcpu, run, insn); in kvm_riscv_vcpu_virtual_insn()
442 * @run: The VCPU run struct containing the mmio data
446 * Returns > 0 to continue run-loop
447 * Returns 0 to exit run-loop and handle in user-space.
448 * Returns < 0 to report failure and exit run-loop
450 int kvm_riscv_vcpu_mmio_load(struct kvm_vcpu *vcpu, struct kvm_run *run, in kvm_riscv_vcpu_mmio_load() argument
540 run->mmio.is_write = false; in kvm_riscv_vcpu_mmio_load()
541 run->mmio.phys_addr = fault_addr; in kvm_riscv_vcpu_mmio_load()
542 run->mmio.len = len; in kvm_riscv_vcpu_mmio_load()
547 memcpy(run->mmio.data, data_buf, len); in kvm_riscv_vcpu_mmio_load()
549 kvm_riscv_vcpu_mmio_return(vcpu, run); in kvm_riscv_vcpu_mmio_load()
555 run->exit_reason = KVM_EXIT_MMIO; in kvm_riscv_vcpu_mmio_load()
564 * @run: The VCPU run struct containing the mmio data
568 * Returns > 0 to continue run-loop
569 * Returns 0 to exit run-loop and handle in user-space.
570 * Returns < 0 to report failure and exit run-loop
572 int kvm_riscv_vcpu_mmio_store(struct kvm_vcpu *vcpu, struct kvm_run *run, in kvm_riscv_vcpu_mmio_store() argument
657 *((u8 *)run->mmio.data) = data8; in kvm_riscv_vcpu_mmio_store()
660 *((u16 *)run->mmio.data) = data16; in kvm_riscv_vcpu_mmio_store()
663 *((u32 *)run->mmio.data) = data32; in kvm_riscv_vcpu_mmio_store()
666 *((u64 *)run->mmio.data) = data64; in kvm_riscv_vcpu_mmio_store()
673 run->mmio.is_write = true; in kvm_riscv_vcpu_mmio_store()
674 run->mmio.phys_addr = fault_addr; in kvm_riscv_vcpu_mmio_store()
675 run->mmio.len = len; in kvm_riscv_vcpu_mmio_store()
679 fault_addr, len, run->mmio.data)) { in kvm_riscv_vcpu_mmio_store()
682 kvm_riscv_vcpu_mmio_return(vcpu, run); in kvm_riscv_vcpu_mmio_store()
688 run->exit_reason = KVM_EXIT_MMIO; in kvm_riscv_vcpu_mmio_store()
698 * @run: The VCPU run struct containing the mmio data
700 int kvm_riscv_vcpu_mmio_return(struct kvm_vcpu *vcpu, struct kvm_run *run) in kvm_riscv_vcpu_mmio_return() argument
715 if (run->mmio.is_write) in kvm_riscv_vcpu_mmio_return()
723 data8 = *((u8 *)run->mmio.data); in kvm_riscv_vcpu_mmio_return()
728 data16 = *((u16 *)run->mmio.data); in kvm_riscv_vcpu_mmio_return()
733 data32 = *((u32 *)run->mmio.data); in kvm_riscv_vcpu_mmio_return()
738 data64 = *((u64 *)run->mmio.data); in kvm_riscv_vcpu_mmio_return()