From patchwork Thu Jan 15 23:59:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 5643631 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 536819F357 for ; Fri, 16 Jan 2015 00:09:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5AA1D20160 for ; Fri, 16 Jan 2015 00:09:01 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7D46E2015E for ; Fri, 16 Jan 2015 00:09:00 +0000 (UTC) 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 1YBuR1-00075q-Oc; Fri, 16 Jan 2015 00:06:43 +0000 Received: from mailout2.w2.samsung.com ([211.189.100.12] helo=usmailout2.samsung.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YBuOy-0003Ra-OW for linux-arm-kernel@lists.infradead.org; Fri, 16 Jan 2015 00:04:37 +0000 Received: from uscpsbgex1.samsung.com (u122.gpu85.samsung.co.kr [203.254.195.122]) by mailout2.w2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NI800E8MTJ2HO50@mailout2.w2.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 15 Jan 2015 19:04:14 -0500 (EST) X-AuditID: cbfec37a-b7fba6d000007572-8f-54b8557eeae0 Received: from usmmp1.samsung.com ( [203.254.195.77]) by uscpsbgex1.samsung.com (USCPEXMTA) with SMTP id A4.64.30066.E7558B45; Thu, 15 Jan 2015 19:04:14 -0500 (EST) Received: from sisasmtp.sisa.samsung.com ([105.144.21.116]) by usmmp1.samsung.com (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTP id <0NI80001PTJ1L6B0@usmmp1.samsung.com>; Thu, 15 Jan 2015 19:04:14 -0500 (EST) Received: from mjsmard-530U3C-530U4C-532U3C.sisa.samsung.com (105.144.129.79) by SISAEX02SJ.sisa.samsung.com (105.144.21.116) with Microsoft SMTP Server (TLS) id 14.3.123.3; Thu, 15 Jan 2015 16:04:13 -0800 From: Mario Smarduch To: christoffer.dall@linaro.org, marc.zyngier@arm.com, pbonzini@redhat.com, james.hogan@imgtec.com, agraf@suse.de, cornelia.huck@de.ibm.com, borntraeger@de.ibm.com Subject: [PATCH v16 09/10] KVM: arm64: Add HYP interface to flush VM Stage 1/2 TLB entries Date: Thu, 15 Jan 2015 15:59:00 -0800 Message-id: <1421366341-26012-10-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1421366341-26012-1-git-send-email-m.smarduch@samsung.com> References: <1421366341-26012-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.144.129.79] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpikeLIzCtJLcpLzFFi42I5/e+wr25d6I4Qg1Vn+C1OXPnHaDF9xXYW i/fLehgtXrwGcuc3NzJavJv3gtmi+1kzo8WbT9oWc6YWWnw8dZzdYtPja6wWf+/8Y7PYv+0f q8WcMw9YLCa92cbkwO+xZt4aRo+Djw6xefTsPMPocefaHjaP85vWMHtsXlLv8X7fVTaPzaer PT5vkgvgjOKySUnNySxLLdK3S+DKOPtrM3PBXo6K1dtmMzUw3mPrYuTkkBAwkTjQeg7KFpO4 cG89mC0ksIxRYt7G9C5GLiC7l0li+qR/7BDORUaJ/7O3soJUsQnoSuy/txEsISKwnFHi9Jbf LCAOs0Abk8TnI8uZQKqEBWIklj08wgxiswioSqxvPwMW5xVwl1jXeRJoHwfQbgWJOZNsQMKc QOGJM5pZIc5wk1gy4yUbRLmgxI/J91hAypkFJCSef1aCKFGV2HbzOSPEB0oS0w5fZZ/AKDQL SccshI4FjEyrGMVKi5MLipPSUysM9YoTc4tL89L1kvNzNzFC4q1qB+OdrzaHGAU4GJV4eBn8 tocIsSaWFVfmHmKU4GBWEuHlZd4RIsSbklhZlVqUH19UmpNafIiRiYNTqoExbmXN0qtr70z6 q2hu63TpsWj0RB0FPevwQjP+b3vEdJtVktmc+GYvyc7dIRtS0mp1SODIFLHSL3WVqc9jrR5t D5r/fJ3bH8v7Hi+UuCTfBBxT/btr9YwOTiue+fuEQuZuERA1blNI/XG0nGuD2cHik2/SO079 d5+ddkHQQiepZY78+jz3TxuVWIozEg21mIuKEwFirxC8lQIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150115_160436_897242_812F028A X-CRM114-Status: UNSURE ( 6.42 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) Cc: peter.maydell@linaro.org, kvm@vger.kernel.org, steve.capper@arm.com, kvm-ia64@vger.kernel.org, catalin.marinas@arm.com, kvm-ppc@vger.kernel.org, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 b72aa9f..6e1b5df 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