From patchwork Tue Sep 23 00:54:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Smarduch X-Patchwork-Id: 4951581 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 AA4659F348 for ; Tue, 23 Sep 2014 00:58:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BEBEA20154 for ; Tue, 23 Sep 2014 00:58:06 +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 CF20D201FA for ; Tue, 23 Sep 2014 00:58:05 +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 1XWEOf-0006qX-6o; Tue, 23 Sep 2014 00:56:01 +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 1XWEOb-0006lt-Dc for linux-arm-kernel@lists.infradead.org; Tue, 23 Sep 2014 00:55:58 +0000 Received: from uscpsbgex2.samsung.com (u123.gpu85.samsung.co.kr [203.254.195.123]) by usmailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NCB00DACX8LY4B0@usmailout4.samsung.com> for linux-arm-kernel@lists.infradead.org; Mon, 22 Sep 2014 20:55:33 -0400 (EDT) X-AuditID: cbfec37b-b7f826d000001cb2-52-5420c505a17c Received: from usmmp1.samsung.com ( [203.254.195.77]) by uscpsbgex2.samsung.com (USCPEXMTA) with SMTP id 5A.4A.07346.505C0245; Mon, 22 Sep 2014 20:55:33 -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 <0NCB0019CX8LGDA0@usmmp1.samsung.com>; Mon, 22 Sep 2014 20:55:33 -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.1.421.2; Mon, 22 Sep 2014 17:55:32 -0700 From: Mario Smarduch To: kvmarm@lists.cs.columbia.edu, christoffer.dall@linaro.org, marc.zyngier@arm.com, pbonzini@redhat.com, gleb@kernel.org, agraf@suse.de, borntraeger@de.ibm.com, cornelia.huck@de.ibm.com, xiaoguangrong@linux.vnet.ibm.com, ralf@linux-mips.org, catali.marinas@arm.com Subject: [PATCH v11 1/6] KVM: Add architecture-specific TLB flush implementations Date: Mon, 22 Sep 2014 17:54:45 -0700 Message-id: <1411433690-8104-2-git-send-email-m.smarduch@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1411433690-8104-1-git-send-email-m.smarduch@samsung.com> References: <1411433690-8104-1-git-send-email-m.smarduch@samsung.com> MIME-version: 1.0 X-Originating-IP: [105.144.129.79] X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupmkeLIzCtJLcpLzFFi42I5/e+wry7rUYUQg/tLNS1OXPnHaDF9xXYW i2tdzYwWL14DufObGxktvvy8zmgxZ2qhxcdTx9ktNj2+xmrx984/Nov92/6xWsw584DF4tIe FYtJb7YxWSz8f5PRgd9jzbw1jB4HHx1i89i0qpPN4861PWweR1euZfJ4cGgzi8f5TWuYPTYv qfd4v+8qm8fm09UenzfJBXBHcdmkpOZklqUW6dslcGU8uvOfreAqb8W/ddMYGxh3cXcxcnJI CJhI3J3ymBHCFpO4cG89G4gtJLCMUeL1DPEuRi4gu5dJ4vPVeewQzkVGifPPbzOBVLEJ6Ers v7cRLCEi0M8kcfrYdlYQh1lgBqPEvkXXwGYJCwRLLHlwn6WLkYODRUBV4vHnSpAwr4CrxN4l F9hAwhICChJzJtmAhDkF3CSOb93GCHGFq8TL5jNsEOWCEj8m3wObwiwgIfH8sxJEiarEtpvP oR5Qkph2+Cr7BEahWUg6ZiF0LGBkWsUoVlqcXFCclJ5aYaRXnJhbXJqXrpecn7uJERKB1TsY 7361OcQowMGoxMPrsUYhRIg1say4MvcQowQHs5IIb8lEoBBvSmJlVWpRfnxRaU5q8SFGJg5O qQbGgt+flgRG3Z+jJ8AtOmuy9i2TLW8CZ/H2mMWmuL8WMJhQVeOfp7rEVu5GYuYSZzH9jvuT 5jy4kbza5L/d3+daR/fr8kzYPS1E0DiZ450L01/GmXunh/oIya0peMN063wVy/wPcV+q7oXp pr598O++ourEghmtmRNcFu0LMrK5rlW2dXXw66/LlViKMxINtZiLihMBLNwc5p4CAAA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140922_175557_534748_A6CD2E71 X-CRM114-Status: UNSURE ( 8.96 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.0 (------) Cc: peter.maydell@linaro.org, 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=-2.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 ARMv7. Signed-off-by: Mario Smarduch --- include/linux/kvm_host.h | 1 + virt/kvm/Kconfig | 3 +++ virt/kvm/kvm_main.c | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index ec4e3bd..a49a6df 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -592,6 +592,7 @@ void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); void kvm_flush_remote_tlbs(struct kvm *kvm); +void kvm_arch_flush_remote_tlbs(struct kvm *kvm); void kvm_reload_remote_mmus(struct kvm *kvm); void kvm_make_mclock_inprogress_request(struct kvm *kvm); void kvm_make_scan_ioapic_request(struct kvm *kvm); 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);