7 #ifndef __ARM64_KVM_HYP_FAULT_H__
8 #define __ARM64_KVM_HYP_FAULT_H__
10 #include <asm/kvm_asm.h>
11 #include <asm/kvm_emulate.h>
12 #include <asm/kvm_hyp.h>
13 #include <asm/kvm_mmu.h>
29 par = read_sysreg_par();
30 if (!__kvm_at(
"s1e1r", far))
31 tmp = read_sysreg_par();
34 write_sysreg(par, par_el1);
36 if (unlikely(tmp & SYS_PAR_EL1_F))
40 *hpfar = PAR_TO_HPFAR(tmp);
48 far = read_sysreg_el2(SYS_FAR);
61 if (!(esr & ESR_ELx_S1PTW) &&
62 (cpus_have_final_cap(ARM64_WORKAROUND_834220) ||
63 esr_fsc_is_permission_fault(esr))) {
67 hpfar = read_sysreg(hpfar_el2);
71 fault->hpfar_el2 = hpfar;
static bool __get_fault_info(u64 esr, struct kvm_vcpu_fault_info *fault)
static bool __translate_far_to_hpfar(u64 far, u64 *hpfar)