Lines Matching refs:trap
161 struct kvm_cpu_trap *trap) in virtual_inst_fault() argument
163 unsigned long insn = trap->stval; in virtual_inst_fault()
421 struct kvm_cpu_trap *trap) in stage2_page_fault() argument
429 fault_addr = (trap->htval << 2) | (trap->stval & 0x3); in stage2_page_fault()
435 (trap->scause == EXC_STORE_GUEST_PAGE_FAULT && !writeable)) { in stage2_page_fault()
436 switch (trap->scause) { in stage2_page_fault()
439 trap->htinst); in stage2_page_fault()
442 trap->htinst); in stage2_page_fault()
449 (trap->scause == EXC_STORE_GUEST_PAGE_FAULT) ? true : false); in stage2_page_fault()
467 struct kvm_cpu_trap *trap) in kvm_riscv_vcpu_unpriv_read() argument
469 register unsigned long taddr asm("a0") = (unsigned long)trap; in kvm_riscv_vcpu_unpriv_read()
515 if (trap->scause == EXC_LOAD_PAGE_FAULT) in kvm_riscv_vcpu_unpriv_read()
516 trap->scause = EXC_INST_PAGE_FAULT; in kvm_riscv_vcpu_unpriv_read()
565 struct kvm_cpu_trap *trap) in kvm_riscv_vcpu_trap_redirect() argument
586 csr_write(CSR_VSCAUSE, trap->scause); in kvm_riscv_vcpu_trap_redirect()
587 csr_write(CSR_VSTVAL, trap->stval); in kvm_riscv_vcpu_trap_redirect()
588 csr_write(CSR_VSEPC, trap->sepc); in kvm_riscv_vcpu_trap_redirect()
659 struct kvm_cpu_trap *trap) in kvm_riscv_vcpu_exit() argument
664 if (trap->scause & CAUSE_IRQ_FLAG) in kvm_riscv_vcpu_exit()
670 switch (trap->scause) { in kvm_riscv_vcpu_exit()
673 ret = virtual_inst_fault(vcpu, run, trap); in kvm_riscv_vcpu_exit()
679 ret = stage2_page_fault(vcpu, run, trap); in kvm_riscv_vcpu_exit()
697 trap->scause, trap->stval, trap->htval, trap->htinst); in kvm_riscv_vcpu_exit()