Lines Matching refs:trap
14 struct kvm_cpu_trap *trap) in gstage_page_fault() argument
22 fault_addr = (trap->htval << 2) | (trap->stval & 0x3); in gstage_page_fault()
28 (trap->scause == EXC_STORE_GUEST_PAGE_FAULT && !writable)) { in gstage_page_fault()
29 switch (trap->scause) { in gstage_page_fault()
33 trap->htinst); in gstage_page_fault()
37 trap->htinst); in gstage_page_fault()
44 (trap->scause == EXC_STORE_GUEST_PAGE_FAULT) ? true : false); in gstage_page_fault()
62 struct kvm_cpu_trap *trap) in kvm_riscv_vcpu_unpriv_read() argument
64 register unsigned long taddr asm("a0") = (unsigned long)trap; in kvm_riscv_vcpu_unpriv_read()
96 if (trap->scause == EXC_LOAD_PAGE_FAULT) in kvm_riscv_vcpu_unpriv_read()
97 trap->scause = EXC_INST_PAGE_FAULT; in kvm_riscv_vcpu_unpriv_read()
136 struct kvm_cpu_trap *trap) in kvm_riscv_vcpu_trap_redirect() argument
157 csr_write(CSR_VSCAUSE, trap->scause); in kvm_riscv_vcpu_trap_redirect()
158 csr_write(CSR_VSTVAL, trap->stval); in kvm_riscv_vcpu_trap_redirect()
159 csr_write(CSR_VSEPC, trap->sepc); in kvm_riscv_vcpu_trap_redirect()
173 struct kvm_cpu_trap *trap) in kvm_riscv_vcpu_exit() argument
178 if (trap->scause & CAUSE_IRQ_FLAG) in kvm_riscv_vcpu_exit()
184 switch (trap->scause) { in kvm_riscv_vcpu_exit()
189 kvm_riscv_vcpu_trap_redirect(vcpu, trap); in kvm_riscv_vcpu_exit()
195 ret = kvm_riscv_vcpu_virtual_insn(vcpu, run, trap); in kvm_riscv_vcpu_exit()
201 ret = gstage_page_fault(vcpu, run, trap); in kvm_riscv_vcpu_exit()
219 trap->scause, trap->stval, trap->htval, trap->htinst); in kvm_riscv_vcpu_exit()