Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1332289

[PATCH v4 17/23] arm64: KVM: VHE: Add fpsimd enabling on guest access

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Marc Zyngier <marc.zyngier@arm.com>
Newsgroups linux.kernel
Subject [PATCH v4 17/23] arm64: KVM: VHE: Add fpsimd enabling on guest access
Date Thu, 11 Feb 2016 19:50:01 +0100
Message-ID <r14tr-4eC-7@gated-at.bofh.it> (permalink)
References <r14tr-4eC-3@gated-at.bofh.it>
X-Mailer git-send-email 2.1.4
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 33
Organization linux.* mail to news gateway
X-Original-Cc linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kvmarm@lists.cs.columbia.edu
X-Original-Date Thu, 11 Feb 2016 18:39:58 +0000
X-Original-Message-ID <1455216004-19499-18-git-send-email-marc.zyngier@arm.com>
X-Original-References <1455216004-19499-1-git-send-email-marc.zyngier@arm.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1332289

Show key headers only | View raw


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>
---
 arch/arm64/kvm/hyp/entry.S | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/kvm/hyp/entry.S b/arch/arm64/kvm/hyp/entry.S
index fd0fbe9..ce9e5e5 100644
--- a/arch/arm64/kvm/hyp/entry.S
+++ b/arch/arm64/kvm/hyp/entry.S
@@ -130,9 +130,15 @@ ENDPROC(__guest_exit)
 ENTRY(__fpsimd_guest_restore)
 	stp	x4, lr, [sp, #-16]!
 
+alternative_if_not ARM64_HAS_VIRT_HOST_EXTN
 	mrs	x2, cptr_el2
 	bic	x2, x2, #CPTR_EL2_TFP
 	msr	cptr_el2, x2
+alternative_else
+	mrs	x2, cpacr_el1
+	orr	x2, x2, #CPACR_EL1_FPEN
+	msr	cpacr_el1, x2
+alternative_endif
 	isb
 
 	mrs	x3, tpidr_el2
-- 
2.1.4

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[PATCH v4 17/23] arm64: KVM: VHE: Add fpsimd enabling on guest access Marc Zyngier <marc.zyngier@arm.com> - 2016-02-11 19:50 +0100

csiph-web