From patchwork Wed Oct 22 22: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: 5137381 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 9D978C11AC for ; Wed, 22 Oct 2014 22:37:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D9E292025A for ; Wed, 22 Oct 2014 22:37:35 +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 CB13D20222 for ; Wed, 22 Oct 2014 22:37:34 +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 1Xh4Uu-0002PC-0y; Wed, 22 Oct 2014 22:35:16 +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 1Xh4Ui-0001Fa-Ly for linux-arm-kernel@lists.infradead.org; Wed, 22 Oct 2014 22:35:05 +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 <0NDV00EJ1AQ21250@usmailout3.samsung.com> for linux-arm-kernel@lists.infradead.org; Wed, 22 Oct 2014 18:34:50 -0400 (EDT) X-AuditID: cbfec37c-b7f9f6d000006015-d8-5448310af311 Received: from usmmp2.samsung.com ( [203.254.195.78]) by uscpsbgex3.samsung.com (USCPEXMTA) with SMTP id 7C.9D.24597.A0138445; Wed, 22 Oct 2014 18:34:50 -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 <0NDV00IWNAQ2KX60@usmmp2.samsung.com>; Wed, 22 Oct 2014 18:34:50 -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; Wed, 22 Oct 2014 15:34:49 -0700 From: Mario Smarduch To: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, pbonzini@redhat.com, agraf@suse.de, catalin.marinas@arm.com, cornelia.huck@de.ibm.com, borntraeger@de.ibm.com, james.hogan@imgtec.com, marc.zyngier@arm.com, xiaoguangrong@linux.vnet.ibm.com Subject: [PATCH v12 1/6] KVM: Add architecture-defined TLB flush support Date: Wed, 22 Oct 2014 15:34:06 -0700 Message-id: <1414017251-5772-2-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1414017251-5772-1-git-send-email-m.smarduch@samsung.com> References: <1414017251-5772-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.144.129.79] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFuplkeLIzCtJLcpLzFFi42I5/e+wny6XoUeIwawl8hYnrvxjtJi+YjuL xftlPYwWL14DufObGxkt3s17wWzR/ayZ0eLNJ22LOVMLLT6eOs5usenxNVaLv3f+sVns3/aP 1WLOmQcsFpPebGOyWPj/JqODgMeaeWsYPQ4+OsTm0bPzDKPHnWt72DweHNrM4nF+0xpmj81L 6j3e77vK5rH5dLXH501yAVxRXDYpqTmZZalF+nYJXBlbW5pZCs5yVRze1svSwPiUo4uRk0NC wETi1da5bBC2mMSFe+uBbC4OIYFljBJ7JvSzQDi9TBL9i1qYIJyLjBJz511kAmlhE9CV2H9v IztIQkSgiUni9p9bYA6zwFlGifYtP9lBqoQFPCSaFnexgNgsAqoSq/73g3XzCrhKvPn7GaiG A2i5gsScSTYgYU4BN4mrJ9eClQsBlSybvBSqXFDix+R7LCDlzAISEs8/K0GUqEpsu/mcEeIF JYlph6+yT2AUmoWkYxZCxwJGplWMYqXFyQXFSempFcZ6xYm5xaV56XrJ+bmbGCFRWLOD8d5X m0OMAhyMSjy8MzjcQ4RYE8uKK3MPMUpwMCuJ8G4T9AgR4k1JrKxKLcqPLyrNSS0+xMjEwSnV wMiybe6et+G6+7d7XNSJ4Pate/rkxY2NzMJeU2+s3Le+YtEHt0OTRd9ePnVl/qu+0OW/hTgE exf6sz//P01zj+6lJVpSqn5C/VKlU48c6jga07vEnMFPvff9w1TB4lLJy8vlDtyO3fvP9Zq/ dfTSY7eaw1J+L7vEePGUM6f+5Kr120wzVn0I2PxPiaU4I9FQi7moOBEAf8sBBqACAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141022_153504_825756_B5361F8A X-CRM114-Status: UNSURE ( 8.14 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.4 (------) Cc: peter.maydell@linaro.org, kvm@vger.kernel.org, steve.capper@arm.com, kvm-ia64@vger.kernel.org, kvm-ppc@vger.kernel.org, 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=-3.3 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 This patch adds support for architecture implemented VM TLB flush, currently ARMv7 defines HAVE_KVM_ARCH_TLB_FLUSH_ALL. This leaves other architectures unaffected using the generic version. In subsequent patch ARMv7 defines HAVE_KVM_ARCH_TLB_FLUSH_ALL and it's own TLB flush interface. Signed-off-by: Mario Smarduch Reviewed-by: Paolo Bonzini --- virt/kvm/Kconfig | 3 +++ virt/kvm/kvm_main.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig index fc0c5e6..3796a21 100644 --- a/virt/kvm/Kconfig +++ b/virt/kvm/Kconfig @@ -37,3 +37,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 33712fb..887df87 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -184,6 +184,7 @@ static bool make_all_cpus_request(struct kvm *kvm, unsigned int req) return called; } +#ifndef CONFIG_HAVE_KVM_ARCH_TLB_FLUSH_ALL void kvm_flush_remote_tlbs(struct kvm *kvm) { long dirty_count = kvm->tlbs_dirty; @@ -194,6 +195,7 @@ void kvm_flush_remote_tlbs(struct kvm *kvm) cmpxchg(&kvm->tlbs_dirty, dirty_count, 0); } EXPORT_SYMBOL_GPL(kvm_flush_remote_tlbs); +#endif void kvm_reload_remote_mmus(struct kvm *kvm) {