aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm64/kvm
diff options
context:
space:
mode:
authorMarc Zyngier <marc.zyngier@arm.com>2015-10-28 10:42:09 -0400
committerMarc Zyngier <marc.zyngier@arm.com>2016-02-29 13:34:17 -0500
commit77cb2d91333312d7426055d4369f3821e5e8bda0 (patch)
tree3ef94f5d8792be1a432d5d5c864de0ced73bbe31 /arch/arm64/kvm
parent5efe6de13807fe927f0ecc63d83197b5cd3c7782 (diff)
arm64: KVM: VHE: Add fpsimd enabling on guest access
Despite the fact that a VHE enabled kernel runs at EL2, it uses CPACR_EL1 to trap FPSIMD access. Add the required alternative code to re-enable guest FPSIMD access when it has trapped to EL2. Reviewed-by: Christoffer Dall <christoffer.dall@linaro.org> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
Diffstat (limited to 'arch/arm64/kvm')
-rw-r--r--arch/arm64/kvm/hyp/entry.S6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/arm64/kvm/hyp/entry.S b/arch/arm64/kvm/hyp/entry.S
index fd0fbe9b7e6a..ce9e5e5f28cf 100644
--- a/arch/arm64/kvm/hyp/entry.S
+++ b/arch/arm64/kvm/hyp/entry.S
@@ -130,9 +130,15 @@ ENDPROC(__guest_exit)
130ENTRY(__fpsimd_guest_restore) 130ENTRY(__fpsimd_guest_restore)
131 stp x4, lr, [sp, #-16]! 131 stp x4, lr, [sp, #-16]!
132 132
133alternative_if_not ARM64_HAS_VIRT_HOST_EXTN
133 mrs x2, cptr_el2 134 mrs x2, cptr_el2
134 bic x2, x2, #CPTR_EL2_TFP 135 bic x2, x2, #CPTR_EL2_TFP
135 msr cptr_el2, x2 136 msr cptr_el2, x2
137alternative_else
138 mrs x2, cpacr_el1
139 orr x2, x2, #CPACR_EL1_FPEN
140 msr cpacr_el1, x2
141alternative_endif
136 isb 142 isb
137 143
138 mrs x3, tpidr_el2 144 mrs x3, tpidr_el2