diff options
| author | Marc Zyngier <marc.zyngier@arm.com> | 2016-09-06 04:28:41 -0400 |
|---|---|---|
| committer | Christoffer Dall <christoffer.dall@linaro.org> | 2016-09-08 06:53:00 -0400 |
| commit | 3e51d43516b99a5ede461381b4d031998f8dbdf3 (patch) | |
| tree | 7d9b5eab5535a1c6b6896b9845b0974a6fecaf4f /arch/arm64/include | |
| parent | cb96408da4e11698674abd04aeac941c1bed2038 (diff) | |
arm64: KVM: Move kvm_vcpu_get_condition out of emulate.c
In order to make emulate.c more generic, move the arch-specific
manupulation bits out of emulate.c.
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm64/include')
| -rw-r--r-- | arch/arm64/include/asm/kvm_emulate.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h index 4cdeae3b17c6..b336434d8546 100644 --- a/arch/arm64/include/asm/kvm_emulate.h +++ b/arch/arm64/include/asm/kvm_emulate.h | |||
| @@ -147,6 +147,16 @@ static inline u32 kvm_vcpu_get_hsr(const struct kvm_vcpu *vcpu) | |||
| 147 | return vcpu->arch.fault.esr_el2; | 147 | return vcpu->arch.fault.esr_el2; |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | static inline int kvm_vcpu_get_condition(const struct kvm_vcpu *vcpu) | ||
| 151 | { | ||
| 152 | u32 esr = kvm_vcpu_get_hsr(vcpu); | ||
| 153 | |||
| 154 | if (esr & ESR_ELx_CV) | ||
| 155 | return (esr & ESR_ELx_COND_MASK) >> ESR_ELx_COND_SHIFT; | ||
| 156 | |||
| 157 | return -1; | ||
| 158 | } | ||
| 159 | |||
| 150 | static inline unsigned long kvm_vcpu_get_hfar(const struct kvm_vcpu *vcpu) | 160 | static inline unsigned long kvm_vcpu_get_hfar(const struct kvm_vcpu *vcpu) |
| 151 | { | 161 | { |
| 152 | return vcpu->arch.fault.far_el2; | 162 | return vcpu->arch.fault.far_el2; |
