From patchwork Fri Jan 23 10:02:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoffer Dall X-Patchwork-Id: 43584 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ee0-f70.google.com (mail-ee0-f70.google.com [74.125.83.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F217D218DB for ; Fri, 23 Jan 2015 10:13:39 +0000 (UTC) Received: by mail-ee0-f70.google.com with SMTP id c13sf4316718eek.1 for ; Fri, 23 Jan 2015 02:13:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version :content-type:content-transfer-encoding:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list; bh=rHaFNpUAyUGKRO963OPO5u0wtGGg4F50+goj3QYsKt8=; b=DP7yTy27LQVrUH3CTutz+SBv1dCnqYIPftN/aTL+lTc+jun++bPiHRXN83oi95ES10 Q/t08+v1bkmdFUngo0sOXv8DZOYz+tyTbbTSRHwmzDusbShZkffyUZ2F7GFUtBGp5tdo 25r32rk0x4UBeIYHegk3abSELAS/tsU2+7bvEa1iUZluWFzKuUe/4R8dYOfLSsLuV3+b v7TBJuhJI0wD6pY+SBBkuojWWZBUwWCy64v7WMcWLweQlPGm/z+WbWVgak0QFqxHbibg tOSX+d9ktAobgh/c1SIoV7GqNSBxU8CblgSs9D/rntbVkXd7bOKN6JuaV8kqOf+zF4TC 1WxA== X-Gm-Message-State: ALoCoQlbpD1OCLAkOxdHdlo3J0f9zmWQG5m7pecAe3Gh3eaR4UCFf7XrH52uN2xb9Da5UZY70ce7 X-Received: by 10.112.168.163 with SMTP id zx3mr12396lbb.24.1422008019163; Fri, 23 Jan 2015 02:13:39 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.137 with SMTP id w9ls267996lal.5.gmail; Fri, 23 Jan 2015 02:13:38 -0800 (PST) X-Received: by 10.152.4.8 with SMTP id g8mr6340327lag.58.1422008018678; Fri, 23 Jan 2015 02:13:38 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id a8si930606laf.73.2015.01.23.02.13.38 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 02:13:38 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id u10so6181670lbd.12 for ; Fri, 23 Jan 2015 02:13:38 -0800 (PST) X-Received: by 10.152.245.44 with SMTP id xl12mr741104lac.81.1422008018589; Fri, 23 Jan 2015 02:13:38 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp195970lbb; Fri, 23 Jan 2015 02:13:37 -0800 (PST) X-Received: by 10.66.63.2 with SMTP id c2mr9862238pas.23.1422008016772; Fri, 23 Jan 2015 02:13:36 -0800 (PST) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id ra16si1312697pac.161.2015.01.23.02.13.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Jan 2015 02:13:36 -0800 (PST) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YEbDJ-0003LB-C6; Fri, 23 Jan 2015 10:11:41 +0000 Received: from mail-la0-f42.google.com ([209.85.215.42]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YEb5e-0003sw-3J for linux-arm-kernel@lists.infradead.org; Fri, 23 Jan 2015 10:03:46 +0000 Received: by mail-la0-f42.google.com with SMTP id ms9so6417805lab.1 for ; Fri, 23 Jan 2015 02:03:28 -0800 (PST) X-Received: by 10.112.222.135 with SMTP id qm7mr6271064lbc.19.1422007408143; Fri, 23 Jan 2015 02:03:28 -0800 (PST) Received: from localhost.localdomain (188-178-240-98-static.dk.customer.tdc.net. [188.178.240.98]) by mx.google.com with ESMTPSA id pg3sm331848lbb.8.2015.01.23.02.03.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Jan 2015 02:03:27 -0800 (PST) From: Christoffer Dall To: Paolo Bonzini , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org Subject: [GIT PULL 13/36] KVM: arm64: Add HYP interface to flush VM Stage 1/2 TLB entries Date: Fri, 23 Jan 2015 11:02:42 +0100 Message-Id: <1422007385-14730-14-git-send-email-christoffer.dall@linaro.org> X-Mailer: git-send-email 2.1.2.330.g565301e.dirty In-Reply-To: <1422007385-14730-1-git-send-email-christoffer.dall@linaro.org> References: <1422007385-14730-1-git-send-email-christoffer.dall@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150123_020346_394353_3AEF1231 X-CRM114-Status: UNSURE ( 9.84 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [209.85.215.42 listed in wl.mailspike.net] -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [209.85.215.42 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Marc Zyngier , kvm@vger.kernel.org, Mario Smarduch X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: christoffer.dall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 From: Mario Smarduch This patch adds support for arm64 hyp interface to flush all TLBs associated with VMID. Reviewed-by: Christoffer Dall Signed-off-by: Mario Smarduch --- arch/arm64/kvm/hyp.S | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/arch/arm64/kvm/hyp.S b/arch/arm64/kvm/hyp.S index fbe909f..d9c4344 100644 --- a/arch/arm64/kvm/hyp.S +++ b/arch/arm64/kvm/hyp.S @@ -1030,6 +1030,28 @@ ENTRY(__kvm_tlb_flush_vmid_ipa) ret ENDPROC(__kvm_tlb_flush_vmid_ipa) +/** + * void __kvm_tlb_flush_vmid(struct kvm *kvm) - Flush per-VMID TLBs + * @struct kvm *kvm - pointer to kvm structure + * + * Invalidates all Stage 1 and 2 TLB entries for current VMID. + */ +ENTRY(__kvm_tlb_flush_vmid) + dsb ishst + + kern_hyp_va x0 + ldr x2, [x0, #KVM_VTTBR] + msr vttbr_el2, x2 + isb + + tlbi vmalls12e1is + dsb ish + isb + + msr vttbr_el2, xzr + ret +ENDPROC(__kvm_tlb_flush_vmid) + ENTRY(__kvm_flush_vm_context) dsb ishst tlbi alle1is