From patchwork Thu Oct 12 10:41:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 10001659 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0BAF660325 for ; Thu, 12 Oct 2017 10:54:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F241928CE6 for ; Thu, 12 Oct 2017 10:54:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E6EC428CEC; Thu, 12 Oct 2017 10:54:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 70CA528CE6 for ; Thu, 12 Oct 2017 10:54:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Rrr/++YFJEBZ1lyfrq8OhOQD1THcVx2agNnum7zMxQg=; b=hjZoLl6ETE/a3CFLAKQWrRHuts 7qrO+GIyrSi+1QCL0AcVmg4tUx8MPJnLh+tORXEhisDFtLs83MCUkFoHImWPjZtsObdnutuL8Sxzt 1sT3u3GXa4xj2BP4bd/Slc/RtphxoRHfKUzIucyC34iS7/cJMux0KN2bQk4D15gtbNAqQD8PL8mXz ADzK7hgkpzDWsrFoXlkV8mBlv+DFPwGFxS2JbIOZ9Xsvwzz7pot8fAN5OfsDyhGwMTKSGXd4HOnM9 f+WU8xstthgKZaZX8ObF4/1iVPwOhtsv6+5hhwCb+YIU7wqHkLPVQbkCTQYMOQSeUsJXRL1kEOFQB cEVzysiQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1e2b89-0003cC-Kb; Thu, 12 Oct 2017 10:54:21 +0000 Received: from mail-wm0-x22b.google.com ([2a00:1450:400c:c09::22b]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1e2awZ-0007Xl-Tr for linux-arm-kernel@lists.infradead.org; Thu, 12 Oct 2017 10:42:39 +0000 Received: by mail-wm0-x22b.google.com with SMTP id i124so11857424wmf.3 for ; Thu, 12 Oct 2017 03:42:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ztx4DiHTiw4RSNXBMBe0A8NGVVJP3jyZoYVR7B1Rn6c=; b=ZFlxhgOl2KZAaEQe0b+v55DBdtKkY1akZ3/ALuTf5T4zpXctNVx+hdbWM+Vo/ZnJTw GWXT31GPAJbVh61Ya/Iq5JZbYoTfCRho0/A+xtcxd+Pl6023zi4+5lupHSlNLXvufU0B eXMs9Bvuzkln8grF2ZV+rv3gt98lgfe8mntuY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ztx4DiHTiw4RSNXBMBe0A8NGVVJP3jyZoYVR7B1Rn6c=; b=ny0z7MM5mB4GdlfA3B5gKxDiDd8XkA3IVhHgJDRRAubwbxA2eRnk12wXGCNzGvK83p 1tzT7pFZYptdBP7yQ9A5rBQE4Aj/O10yCogM+K0q55lKdfb7FwwtrhKDx1bWxCw1KUte hjYmpOx2nvK/rNMQI6RrBLyHV+d/T24str090CXs/86VhYOaSPHQdUtsZCE6gTfO4cM2 DXl5isd836i/fa/fbX+smJjOlQaqT4uyH+Rniv8fVlK77DdLfNaMXZ97lxZZa/Qkxt6s ocA9CYnyGJnFqC/W7tH7FhWxwMxiXh3mEsiYCgfVumWyHuHbE4farZYM6TNvO+D5Do6U Azgg== X-Gm-Message-State: AMCzsaW/9KuLVcg4q77ZxKXr/rV1QY5pN/skBn4j/4rcaoNUr8n1FAkM 5gA8eFiacYKHrYPhL+RCUHeVvQ== X-Google-Smtp-Source: AOwi7QCFxeSgfNN+3zvf+YWncY9mlb3lrIe0tRoL1tvObSklC873XodupbIuoHJxWhgDKEQABH6uyg== X-Received: by 10.80.230.24 with SMTP id y24mr2426300edm.211.1507804922058; Thu, 12 Oct 2017 03:42:02 -0700 (PDT) Received: from localhost.localdomain (xd93dd96b.cust.hiper.dk. [217.61.217.107]) by smtp.gmail.com with ESMTPSA id g49sm4798603edc.31.2017.10.12.03.42.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Oct 2017 03:42:01 -0700 (PDT) From: Christoffer Dall To: kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org 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> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20171012104141.26902-1-christoffer.dall@linaro.org> References: <20171012104141.26902-1-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171012_034225_228151_46B6CDC3 X-CRM114-Status: GOOD ( 11.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marc Zyngier , Christoffer Dall , Shih-Wei Li , kvm@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Andrew Jones --- 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);