From patchwork Sat Nov 15 08:19:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 5311071 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 D17D89F2ED for ; Sat, 15 Nov 2014 08:24:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1357420155 for ; Sat, 15 Nov 2014 08:24:24 +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 38A9F2014A for ; Sat, 15 Nov 2014 08:24:23 +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 1XpYac-00077r-JP; Sat, 15 Nov 2014 08:20:14 +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 1XpYaa-0005zj-DR for linux-arm-kernel@lists.infradead.org; Sat, 15 Nov 2014 08:20:12 +0000 Received: from uscpsbgex2.samsung.com (u123.gpu85.samsung.co.kr [203.254.195.123]) 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 <0NF200B8NN51UP90@mailout2.w2.samsung.com> for linux-arm-kernel@lists.infradead.org; Sat, 15 Nov 2014 03:19:49 -0500 (EST) X-AuditID: cbfec37b-b7f296d000006be0-ba-54670ca58cf9 Received: from usmmp2.samsung.com ( [203.254.195.78]) by uscpsbgex2.samsung.com (USCPEXMTA) with SMTP id 68.7B.27616.5AC07645; Sat, 15 Nov 2014 03:19:49 -0500 (EST) Received: from sisasmtp.sisa.samsung.com ([105.144.21.116]) by usmmp2.samsung.com (Oracle Communications Messaging Server 7u4-27.01(7.0.4.27.0) 64bit (built Aug 30 2012)) with ESMTP id <0NF200CKIN51RT50@usmmp2.samsung.com>; Sat, 15 Nov 2014 03:19:49 -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; Sat, 15 Nov 2014 00:19:48 -0800 From: m.smarduch@samsung.com To: christoffer.dall@linaro.org, marc.zyngier@arm.com Subject: [PATCH v2 2/3] KVM: arm64: Add HYP interface to flush VM TLB entires Date: Sat, 15 Nov 2014 00:19:09 -0800 Message-id: <1416039550-28125-3-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1416039550-28125-1-git-send-email-m.smarduch@samsung.com> References: <1416039550-28125-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.144.129.79] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDLMWRmVeSWpSXmKPExsVy+t9hP92lPOkhBk9Oq1i8X9bDaPHi9T9G izlTCy0+njrObrHp8TVWi793/rFZ7N/2j9WB3WPNvDWMHneu7WHzOL9pDbPH5iX1Hu/3XWXz +LxJLoAtissmJTUnsyy1SN8ugStj3/xzrAWvOCoONfawNjC2sXcxcnJICJhItK+cxAJhi0lc uLeerYuRi0NIYBmjxN3L7SwQTi+TxL8dsxghnIuMEh8u7AVrZxOQkXg4vQmohYNDRMBUormN A6SGWWAbo8SPF8+ZQWqEBXwlNt5bAVbPIqAqcfTwJ1YQm1fATeL6r0usIL0SAgoScybZgIQ5 Bdwl9hzfDnaREFDJjtfP2SDKBSV+TL7HAlLOLCAh8fyzEkSJqsS2m88ZIR5Qkph2+Cr7BEah WUg6ZiF0LGBkWsUoVlqcXFCclJ5aYaRXnJhbXJqXrpecn7uJERID1TsY7361OcQowMGoxMPb MD0tRIg1say4MvcQowQHs5II7wSu9BAh3pTEyqrUovz4otKc1OJDjEwcnFINjDHZXZyme5Ze tM0+vU2oduaMFB/bRXtmpD5/V3CX9eXi8rWmO6LvTfNhN/i8nd+0c7tDneCHSw1tR9zcdPPm GCVGP2by1q57+W5xRAqrZVfr2wPNLFl3Kr+suzL99/sEOxGnxhfvtyRt0Wuqnvuh0irx6/6C 5YecXszVPZwwQaVaIHJ6umDVDyWW4oxEQy3mouJEALbj+69fAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141115_002012_540246_53BFD829 X-CRM114-Status: UNSURE ( 6.21 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) Cc: kvm@vger.kernel.org, catalin.marinas@arm.com, pbonzini@redhat.com, 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=-2.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_LOW, 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 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 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