[v2,3/8] arm64: KVM: Install stage-2 translation before enabling traps
diff mbox series

Message ID 20181123184107.39334-4-marc.zyngier@arm.com
State New, archived
Headers show
  • Workaround for Cortex-A76 erratum 1165522
Related show

Commit Message

Marc Zyngier Nov. 23, 2018, 6:41 p.m. UTC
It is a bit odd that we only install stage-2 translation after having
cleared HCR_EL2.TGE, which means that there is a window during which
AT requests could fail as stage-2 is not configured yet.

Let's move stage-2 configuration before we clear TGE, making the
guest entry sequence clearer: we first configure all the guest stuff,
then only switch to the guest translation regime.

While we're at it, do the same thing for !VHE. It doesn't hurt,
and keeps things symmetric.

Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
 arch/arm64/kvm/hyp/switch.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff mbox series

diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c
index 7cc175c88a37..a8fa61c68c32 100644
--- a/arch/arm64/kvm/hyp/switch.c
+++ b/arch/arm64/kvm/hyp/switch.c
@@ -499,8 +499,8 @@  int kvm_vcpu_run_vhe(struct kvm_vcpu *vcpu)
-	__activate_traps(vcpu);
+	__activate_traps(vcpu);
@@ -545,8 +545,8 @@  int __hyp_text __kvm_vcpu_run_nvhe(struct kvm_vcpu *vcpu)
-	__activate_traps(vcpu);
+	__activate_traps(vcpu);