diff options
author | Christoffer Dall <christoffer.dall@arm.com> | 2016-05-01 23:29:58 +0300 |
---|---|---|
committer | Marc Zyngier <marc.zyngier@arm.com> | 2019-02-20 00:05:45 +0300 |
commit | 64cf98fa5544aee6c547786ee32f92b796b30635 (patch) | |
tree | 019e045370167fb30e982ad16891fd94905dea56 /arch/arm64/include/asm | |
parent | bee038a67487598ebbe995f85bf60c3a5b2e9099 (diff) | |
download | linux-64cf98fa5544aee6c547786ee32f92b796b30635.tar.xz |
KVM: arm/arm64: Move kvm_is_write_fault to header file
Move this little function to the header files for arm/arm64 so other
code can make use of it directly.
Signed-off-by: Christoffer Dall <christoffer.dall@arm.com>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/include/asm')
-rw-r--r-- | arch/arm64/include/asm/kvm_emulate.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h index 506386a3edde..a0d1ce9ae12b 100644 --- a/arch/arm64/include/asm/kvm_emulate.h +++ b/arch/arm64/include/asm/kvm_emulate.h @@ -331,6 +331,14 @@ static inline int kvm_vcpu_sys_get_rt(struct kvm_vcpu *vcpu) return ESR_ELx_SYS64_ISS_RT(esr); } +static inline bool kvm_is_write_fault(struct kvm_vcpu *vcpu) +{ + if (kvm_vcpu_trap_is_iabt(vcpu)) + return false; + + return kvm_vcpu_dabt_iswrite(vcpu); +} + static inline unsigned long kvm_vcpu_get_mpidr_aff(struct kvm_vcpu *vcpu) { return vcpu_read_sys_reg(vcpu, MPIDR_EL1) & MPIDR_HWID_BITMASK; |