summaryrefslogtreecommitdiff
path: root/arch/arm64/kvm/hyp/hyp.h
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2015-10-26 11:34:09 +0300
committerMarc Zyngier <marc.zyngier@arm.com>2015-12-14 14:30:41 +0300
commitc13d1683df16db16c91372177ca10c31677b5ed5 (patch)
treec33ebab7d9dff4a45664c47edda215838ed5c5b7 /arch/arm64/kvm/hyp/hyp.h
parentbe901e9b15cd2c8e48dc089b4655ea4a076e66fd (diff)
downloadlinux-c13d1683df16db16c91372177ca10c31677b5ed5.tar.xz
arm64: KVM: Implement fpsimd save/restore
Implement the fpsimd save restore, keeping the lazy part in assembler (as returning to C would be overkill). Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org>
Diffstat (limited to 'arch/arm64/kvm/hyp/hyp.h')
-rw-r--r--arch/arm64/kvm/hyp/hyp.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/arm64/kvm/hyp/hyp.h b/arch/arm64/kvm/hyp/hyp.h
index 73419a769112..70d4f696c862 100644
--- a/arch/arm64/kvm/hyp/hyp.h
+++ b/arch/arm64/kvm/hyp/hyp.h
@@ -76,6 +76,13 @@ void __debug_restore_state(struct kvm_vcpu *vcpu,
void __debug_cond_save_host_state(struct kvm_vcpu *vcpu);
void __debug_cond_restore_host_state(struct kvm_vcpu *vcpu);
+void __fpsimd_save_state(struct user_fpsimd_state *fp_regs);
+void __fpsimd_restore_state(struct user_fpsimd_state *fp_regs);
+static inline bool __fpsimd_enabled(void)
+{
+ return !(read_sysreg(cptr_el2) & CPTR_EL2_TFP);
+}
+
u64 __guest_enter(struct kvm_vcpu *vcpu, struct kvm_cpu_context *host_ctxt);
#endif /* __ARM64_KVM_HYP_H__ */