From patchwork Tue Apr 29 00:54:50 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 4083991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0BC6FBFF02 for ; Tue, 29 Apr 2014 00:57:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 24B66201EC for ; Tue, 29 Apr 2014 00:57:56 +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 2304B201E7 for ; Tue, 29 Apr 2014 00:57:55 +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 1WewKS-0007Fw-67; Tue, 29 Apr 2014 00:55:24 +0000 Received: from mailout3.w2.samsung.com ([211.189.100.13] helo=usmailout3.samsung.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WewKH-0006B8-MQ for linux-arm-kernel@lists.infradead.org; Tue, 29 Apr 2014 00:55:14 +0000 Received: from uscpsbgex3.samsung.com (u124.gpu85.samsung.co.kr [203.254.195.124]) by usmailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4R00818P7GNAB0@usmailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 28 Apr 2014 20:54:52 -0400 (EDT) X-AuditID: cbfec37c-b7f796d000005f99-6d-535ef85b8483 Received: from usmmp2.samsung.com ( [203.254.195.78]) by uscpsbgex3.samsung.com (USCPEXMTA) with SMTP id 7B.A9.24473.B58FE535; Mon, 28 Apr 2014 20:54:51 -0400 (EDT) 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 <0N4R005LEP7FW230@usmmp2.samsung.com>; Mon, 28 Apr 2014 20:54:51 -0400 (EDT) Received: from [105.144.129.76] (105.144.129.76) by SISAEX02SJ.sisa.samsung.com (105.144.21.116) with Microsoft SMTP Server (TLS) id 14.1.421.2; Mon, 28 Apr 2014 17:54:51 -0700 Message-id: <535EF85A.8030105@samsung.com> Date: Mon, 28 Apr 2014 17:54:50 -0700 From: Mario Smarduch User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-version: 1.0 To: "kvmarm@lists.cs.columbia.edu" , Marc Zyngier , "christoffer.dall@linaro.org" , Steve Capper Subject: [PATCH v4 1/5] add ARMv7 HYP API to flush VM TLBs without address param X-Originating-IP: [105.144.129.76] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrFLMWRmVeSWpSXmKPExsVy+t9hP93oH3HBBp2bbCxevP7HaNH7/yKr xf2r3xktPp46zm6x6fE1Vou/d/6xWcw584DFYtKbbUwWH2asZHTg9Fgzbw2jx6yGXjaPO9f2 sHmc37SG2WPzknqPvi2rGAPYorhsUlJzMstSi/TtErgylvSdZStYKlYx48sc9gbGC0JdjJwc EgImEts7njBB2GISF+6tZ+ti5OIQEljGKPHp+G1mkISQQC+TxMs5phCJLYwSl35tAuvgFdCS OHj9BQuIzSKgKjFl/RGwOJuArsT+exvZQWxRgQiJP6f3sULUC0r8mHwPrF5E4ByjxIGTjCBD mQV2MElce/wfrEhYIEDi/5oZbCA2s4C6xKR5i5ghbHmJzWveQl2kKrHt5nOgZg6gs5UkVh8x n8AoOAvJillIumch6V7AyLyKUay0OLmgOCk9tcJYrzgxt7g0L10vOT93EyMkPmp2MN77anOI UYCDUYmH1yAqLliINbGsuDL3EKMEB7OSCK9tK1CINyWxsiq1KD++qDQntfgQIxMHp1QDo4uw bnBu7R6jpRrLby+cGpDB9MPJ359hz2slm8j/YX6JLD++XDoU/+nwxM2i7R8DbTRy/mlo9/F+ e/blxxmTOn/LciWD2clbHzH7zTqxcadIxqVnG58U/VrGLO8W8a5DQXRxT0KnxaL49QEr/ll2 +FiLX46I9fjO4pWy5GF6nOVr1/SXi+fEK7EUZyQaajEXFScCACm9W4ZtAgAA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140428_175513_821570_A229B09E X-CRM114-Status: UNSURE ( 9.54 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.6 (-----) Cc: Peter Maydell , "gavin.guo@canonical.com" , =?UTF-8?B?7J207KCV7ISd?= , =?UTF-8?B?7KCV7ISx7KeE?= , "kvmarm@lists.cs.columbia.edu" , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 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.5 required=5.0 tests=BAYES_00,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 Patch adds HYP interface for global VM TLB invalidation without address parameter. - Added ARM version of kvm_flush_remote_tlbs() Signed-off-by: Mario Smarduch --- arch/arm/include/asm/kvm_asm.h | 1 + arch/arm/include/asm/kvm_host.h | 2 ++ arch/arm/kvm/interrupts.S | 5 +++++ arch/arm/kvm/mmu.c | 10 ++++++++++ 4 files changed, 18 insertions(+) diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h index 661da11..0eeaca1 100644 --- a/arch/arm/include/asm/kvm_asm.h +++ b/arch/arm/include/asm/kvm_asm.h @@ -76,6 +76,7 @@ extern char __kvm_hyp_code_end[]; extern void __kvm_flush_vm_context(void); extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa); +extern void __kvm_tlb_flush_vmid(struct kvm *kvm); extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu); #endif diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h index 098f7dd..1e739f9 100644 --- a/arch/arm/include/asm/kvm_host.h +++ b/arch/arm/include/asm/kvm_host.h @@ -228,4 +228,6 @@ int kvm_perf_teardown(void); u64 kvm_arm_timer_get_reg(struct kvm_vcpu *, u64 regid); int kvm_arm_timer_set_reg(struct kvm_vcpu *, u64 regid, u64 value); +void kvm_tlb_flush_vmid(struct kvm *kvm); + #endif /* __ARM_KVM_HOST_H__ */ diff --git a/arch/arm/kvm/interrupts.S b/arch/arm/kvm/interrupts.S index 0d68d40..8620280 100644 --- a/arch/arm/kvm/interrupts.S +++ b/arch/arm/kvm/interrupts.S @@ -45,8 +45,12 @@ __kvm_hyp_code_start: * * As v7 does not support flushing per IPA, just nuke the whole TLB * instead, ignoring the ipa value. + * + * void __kvm_tlb_flush_vm(struct kvm *kvm) - alias on ARMv7 for global VM TLB + * flush with no address parameters. */ ENTRY(__kvm_tlb_flush_vmid_ipa) +ENTRY(__kvm_tlb_flush_vmid) push {r2, r3} dsb ishst @@ -65,6 +69,7 @@ ENTRY(__kvm_tlb_flush_vmid_ipa) pop {r2, r3} bx lr ENDPROC(__kvm_tlb_flush_vmid_ipa) +ENDPROC(__kvm_tlb_flush_vmid) /******************************************************************** * Flush TLBs and instruction caches of all CPUs inside the inner-shareable diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c index e8580e2..7ab77f3 100644 --- a/arch/arm/kvm/mmu.c +++ b/arch/arm/kvm/mmu.c @@ -56,6 +56,16 @@ static void kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa) kvm_call_hyp(__kvm_tlb_flush_vmid_ipa, kvm, ipa); } +/* Function reuses __kvm_tlb_flush_vmid_ipa() HYP interface without additional + * address argument to flush entire VM TLBs. + */ +void kvm_flush_remote_tlbs(struct kvm *kvm) +{ + if (kvm) + kvm_call_hyp(__kvm_tlb_flush_vmid, kvm); +} + + static int mmu_topup_memory_cache(struct kvm_mmu_memory_cache *cache, int min, int max) {