From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoffer Dall Subject: [PATCH 15/37] KVM: arm64: Don't deactivate VM on VHE systems Date: Thu, 12 Oct 2017 12:41:19 +0200 Message-ID: <20171012104141.26902-16-christoffer.dall@linaro.org> References: <20171012104141.26902-1-christoffer.dall@linaro.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 4C3A749D44 for ; Thu, 12 Oct 2017 06:41:20 -0400 (EDT) Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a4+9Fx6x+YZk for ; Thu, 12 Oct 2017 06:41:19 -0400 (EDT) Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id BF6E149D78 for ; Thu, 12 Oct 2017 06:41:18 -0400 (EDT) Received: by mail-wm0-f43.google.com with SMTP id q124so11980461wmb.0 for ; Thu, 12 Oct 2017 03:42:03 -0700 (PDT) In-Reply-To: <20171012104141.26902-1-christoffer.dall@linaro.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Cc: Marc Zyngier , Shih-Wei Li , kvm@vger.kernel.org List-Id: kvmarm@lists.cs.columbia.edu There is no need to reset the VTTBR to zero when exiting the guest on VHE systems. VHE systems don't use stage 2 translations for the EL2&0 translation regime used by the host. Signed-off-by: Christoffer Dall --- arch/arm64/kvm/hyp/switch.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kvm/hyp/switch.c b/arch/arm64/kvm/hyp/switch.c index b72dc66..2cedf12 100644 --- a/arch/arm64/kvm/hyp/switch.c +++ b/arch/arm64/kvm/hyp/switch.c @@ -136,13 +136,13 @@ static void __hyp_text __deactivate_traps(struct kvm_vcpu *vcpu) write_sysreg(0, pmuserenr_el0); } -static void __hyp_text __activate_vm(struct kvm_vcpu *vcpu) +static inline void __hyp_text __activate_vm(struct kvm_vcpu *vcpu) { struct kvm *kvm = kern_hyp_va(vcpu->kvm); write_sysreg(kvm->arch.vttbr, vttbr_el2); } -static void __hyp_text __deactivate_vm(struct kvm_vcpu *vcpu) +static inline void __hyp_text __deactivate_vm(struct kvm_vcpu *vcpu) { write_sysreg(0, vttbr_el2); } @@ -360,7 +360,6 @@ int kvm_vcpu_run(struct kvm_vcpu *vcpu) __vgic_save_state(vcpu); __deactivate_traps(vcpu); - __deactivate_vm(vcpu); __sysreg_restore_host_state(host_ctxt); -- 2.9.0