From patchwork Fri Oct 10 02:34:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 5063311 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CC9D49F295 for ; Fri, 10 Oct 2014 02:38:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 186832022A for ; Fri, 10 Oct 2014 02:38:31 +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 3F8C0201FB for ; Fri, 10 Oct 2014 02:38:30 +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 1XcQ2v-0001we-Qs; Fri, 10 Oct 2014 02:35:09 +0000 Received: from mailout4.w2.samsung.com ([211.189.100.14] helo=usmailout4.samsung.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XcQ2f-0001SL-L9 for linux-arm-kernel@lists.infradead.org; Fri, 10 Oct 2014 02:34:54 +0000 Received: from uscpsbgex1.samsung.com (u122.gpu85.samsung.co.kr [203.254.195.122]) by usmailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0ND7001PPJ5R0EA0@usmailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Thu, 09 Oct 2014 22:34:39 -0400 (EDT) X-AuditID: cbfec37a-b7f216d000000635-59-543745bf953f Received: from usmmp1.samsung.com ( [203.254.195.77]) by uscpsbgex1.samsung.com (USCPEXMTA) with SMTP id AA.CC.01589.FB547345; Thu, 09 Oct 2014 22:34:39 -0400 (EDT) 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 <0ND7008E9J5RGT40@usmmp1.samsung.com>; Thu, 09 Oct 2014 22:34:39 -0400 (EDT) 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, 09 Oct 2014 19:34:38 -0700 From: Mario Smarduch To: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com, catalin.marinas@arm.com Subject: [PATCH 2/3] arm64: Add HYP interface to flush VM Stage 1/2 TLB entires Date: Thu, 09 Oct 2014 19:34:06 -0700 Message-id: <1412908447-28247-3-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1412908447-28247-1-git-send-email-m.smarduch@samsung.com> References: <1412908447-28247-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.144.129.79] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCLMWRmVeSWpSXmKPExsVy+t9hX939ruYhBh/fylq8X9bDaPHi9T9G iy8/rzNazJlaaPHx1HF2i02Pr7Fa/L3zj81i/7Z/rA4cHmvmrWH02LSqk83jzrU9bB7nN61h 9ti8pN7j/b6rbB6fN8kFsEdx2aSk5mSWpRbp2yVwZcztfMVacJq9YvnD2cwNjL9Zuxg5OSQE TCR6Vixih7DFJC7cW8/WxcjFISSwjFFib/9RJginl0li//vDzBDORUaJc+ea2UBa2AR0Jfbf 2wjUzsEhIpAncak5BKSGWaCPUeL+1N/MIDXCAv4SN663MILUsAioSvx7ZwsS5hVwk/h6ahkT SFhCQEFiziQbkDCngLvElMn/mEHCQkAlB99FQVQLSvyYfI8FJMwsICHx/LMSSFgIaN62m88Z Ic5Xkph2+Cr7BEahWUg6ZiF0LGBkWsUoVlqcXFCclJ5aYahXnJhbXJqXrpecn7uJERITVTsY 73y1OcQowMGoxMN7QcY8RIg1say4MvcQowQHs5IIr74pUIg3JbGyKrUoP76oNCe1+BAjEwen VAOjybH//Nfks61+PzxgwPUzL8JIw/qJ6duwpB2Tv799uuDns9j3u7bsPirjsnL/m7Pbv/pG Na7lNpjQuYlx3RXN5uUl2tPeNi7cK+cVwfyVobt3i8Dc2N87jx3l3nQhVS6l/Njfx2tX398X oP7BtX+f/OSjDp0HRWImSKStP1w+n6X89qHPb4/v/ajEUpyRaKjFXFScCABNs/peZwIAAA== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141009_193453_818998_D932150C X-CRM114-Status: UNSURE ( 7.51 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) Cc: gleb@kernel.org, pbonzini@redhat.com, linux-arm-kernel@lists.infradead.org, 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE, 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 HYP VM TLB FLush function. Signed-off-by: Mario Smarduch Reviewed-by: Christoffer Dall --- 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 b0d1512..117a91c 100644 --- a/arch/arm64/kvm/hyp.S +++ b/arch/arm64/kvm/hyp.S @@ -645,6 +645,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 + * @struc 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