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


Groups > linux.kernel > #1730279

[PATCH] arm64: KVM: Skip PSTATE.PAN reest at EL2 in non-VHE

From Dongjiu Geng <gengdongjiu@huawei.com>
Newsgroups linux.kernel
Subject [PATCH] arm64: KVM: Skip PSTATE.PAN reest at EL2 in non-VHE
Date 2017-09-11 13:00 +0200
Message-ID <uouBA-1ZH-7@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


PSTATE.PAN disables reading and/or writing to a userspace virtual
address from EL1 in non-VHE or from EL2 in VHE. In non-VHE, there is
no any userspace mapping at EL2, so no need to reest the PSTATE.PAN.

Signed-off-by: Dongjiu Geng <gengdongjiu@huawei.com>
Signed-off-by: Haibin Zhang <zhanghaibin7@huawei.com>
---
 arch/arm64/kvm/hyp/entry.S | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/hyp/entry.S b/arch/arm64/kvm/hyp/entry.S
index 12ee62d6d410..86a7549b1b4c 100644
--- a/arch/arm64/kvm/hyp/entry.S
+++ b/arch/arm64/kvm/hyp/entry.S
@@ -96,8 +96,12 @@ ENTRY(__guest_exit)
 
 	add	x1, x1, #VCPU_CONTEXT
 
-	ALTERNATIVE(nop, SET_PSTATE_PAN(1), ARM64_HAS_PAN, CONFIG_ARM64_PAN)
+alternative_if_not ARM64_HAS_VIRT_HOST_EXTN
+	b	2f			// skip PAN at EL2 in non-VHE
+alternative_else_nop_endif
 
+	ALTERNATIVE(nop, SET_PSTATE_PAN(1), ARM64_HAS_PAN, CONFIG_ARM64_PAN)
+2:
 	// Store the guest regs x2 and x3
 	stp	x2, x3,   [x1, #CPU_XREG_OFFSET(2)]
 
-- 
2.14.1

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] arm64: KVM: Skip PSTATE.PAN reest at EL2 in non-VHE Dongjiu Geng <gengdongjiu@huawei.com> - 2017-09-11 13:00 +0200
  Re: [PATCH] arm64: KVM: Skip PSTATE.PAN reest at EL2 in non-VHE Vladimir Murzin <vladimir.murzin@arm.com> - 2017-09-11 13:30 +0200
    Re: [PATCH] arm64: KVM: Skip PSTATE.PAN reest at EL2 in non-VHE gengdongjiu <gengdongjiu@huawei.com> - 2017-09-11 13:50 +0200
      Re: [PATCH] arm64: KVM: Skip PSTATE.PAN reest at EL2 in non-VHE Marc Zyngier <marc.zyngier@arm.com> - 2017-09-12 16:10 +0200
  Re: [PATCH] arm64: KVM: Skip PSTATE.PAN reest at EL2 in non-VHE Marc Zyngier <marc.zyngier@arm.com> - 2017-09-12 16:20 +0200

csiph-web