From patchwork Tue Aug 26 23:51:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 4784671 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 0F14D9F2E8 for ; Tue, 26 Aug 2014 23:55:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4AD01201DD for ; Tue, 26 Aug 2014 23:55:57 +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 719ED20117 for ; Tue, 26 Aug 2014 23:55:56 +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 1XMQWr-0003cr-WA; Tue, 26 Aug 2014 23:51:57 +0000 Received: from mailout1.w2.samsung.com ([211.189.100.11] helo=usmailout1.samsung.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XMQWh-0003M0-9V for linux-arm-kernel@lists.infradead.org; Tue, 26 Aug 2014 23:51:47 +0000 Received: from uscpsbgex4.samsung.com (u125.gpu85.samsung.co.kr [203.254.195.125]) by mailout1.w2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NAX00DT9U9MXY50@mailout1.w2.samsung.com> for linux-arm-kernel@lists.infradead.org; Tue, 26 Aug 2014 19:51:23 -0400 (EDT) X-AuditID: cbfec37d-b7f676d000000907-b6-53fd1d7ae55d Received: from usmmp2.samsung.com ( [203.254.195.78]) by uscpsbgex4.samsung.com (USCPEXMTA) with SMTP id 71.11.02311.A7D1DF35; Tue, 26 Aug 2014 19:51:22 -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 <0NAX0001OU9MH880@usmmp2.samsung.com>; Tue, 26 Aug 2014 19:51:22 -0400 (EDT) Received: from mjsmard-530U3C-530U4C-532U3C.sisa.samsung.com (105.144.129.72) by SISAEX02SJ.sisa.samsung.com (105.144.21.116) with Microsoft SMTP Server (TLS) id 14.1.421.2; Tue, 26 Aug 2014 16:51:21 -0700 From: Mario Smarduch To: christoffer.dall@linaro.org, marc.zyngier@arm.com, pbonzini@redhat.com, ralf@linux-mips.org, gleb@kernel.org, agraf@suse.de, borntraeger@de.ibm.com, cornelia.huck@de.ibm.com, xiaoguangrong@linux.vnet.ibm.com Subject: [PATCH v10 1/6] KVM: Add architecture-specific TLB flush implementations Date: Tue, 26 Aug 2014 16:51:07 -0700 Message-id: <1409097072-1096-2-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1409097072-1096-1-git-send-email-m.smarduch@samsung.com> References: <1409097072-1096-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.144.129.72] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrOLMWRmVeSWpSXmKPExsVy+t9hP90q2b/BBgf+m1mcuPKP0WL6iu0s Fi9eA1nzmxsZLb78vM5oMWdqocWmx9dYLf7e+cdmsX/bP1aLS3tULCa92cZksfD/TUYHHo81 89Ywehx8dIjNY9OqTjaPO9f2sHkcXbmWyePBoc0sHpuX1Hu833eVzWPz6WqPz5vkAriiuGxS UnMyy1KL9O0SuDIu/1zMWtDBWdE2q4+lgfEQexcjJ4eEgInE5jnNjBC2mMSFe+vZuhi5OIQE ljFK3J48kRHC6WWS2LBpLVTmIqPE79O7mUBa2AR0Jfbf2wg2SkTgOqPE2w9VIDazQJ3Eg73P WEFsYYFgif0r94KtYBFQlej9f5sFxOYVcJV43vMdKM4BtFpBYs4kG5Awp4CbxMuXX9lAbCGg ki3/XrBBlAtK/Jh8jwWknFlAQuL5ZyWIElWJbTefQz2gJHF17kyWCYxCs5B0zELoWMDItIpR rLQ4uaA4KT21wkSvODG3uDQvXS85P3cTIySyancw3v9qc4hRgINRiYf3w4I/wUKsiWXFlbmH GCU4mJVEeH8kAYV4UxIrq1KL8uOLSnNSiw8xMnFwSjUwLi3lleXsmLv4Ro+G6i3l4os6bdz2 X2/ODG6Z/1ZwRpHv6n9xTi3HnnH1/HJuc1BI3PUlNqis4ZaC2smrJkxzRXYxnXnXv33W96Oi 1Xsm7ed5JSt3rbjrGqvL4Qvl5q2TEk9LNilb3nUon/cgap/hhuiJPaGZcyq3ivGbHF2SYRwp KVf/wIFJiaU4I9FQi7moOBEAbR72n4oCAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140826_165147_411479_D63B3A83 X-CRM114-Status: UNSURE ( 7.62 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.0 (-----) Cc: Mario Smarduch , linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, steve.capper@arm.com 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, 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 Add support to declare architecture specific TLB flush function, for now only ARMv7. Signed-off-by: Mario Smarduch --- virt/kvm/Kconfig | 3 +++ virt/kvm/kvm_main.c | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig index 13f2d19..f1efaa5 100644 --- a/virt/kvm/Kconfig +++ b/virt/kvm/Kconfig @@ -34,3 +34,6 @@ config HAVE_KVM_CPU_RELAX_INTERCEPT config KVM_VFIO bool + +config HAVE_KVM_ARCH_TLB_FLUSH_ALL + bool diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index 4b6c01b..d0a24f5 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -186,12 +186,16 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req) void kvm_flush_remote_tlbs(struct kvm *kvm) { +#ifdef CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL + kvm_arch_flush_remote_tlbs(kvm); +#else long dirty_count = kvm->tlbs_dirty; smp_mb(); if (make_all_cpus_request(kvm, KVM_REQ_TLB_FLUSH)) ++kvm->stat.remote_tlb_flush; cmpxchg(&kvm->tlbs_dirty, dirty_count, 0); +#endif } EXPORT_SYMBOL_GPL(kvm_flush_remote_tlbs);