From patchwork Fri Sep 18 14:29:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wu, Feng" X-Patchwork-Id: 53887 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f199.google.com (mail-lb0-f199.google.com [209.85.217.199]) by patches.linaro.org (Postfix) with ESMTPS id 056D4218E3 for ; Fri, 18 Sep 2015 14:44:23 +0000 (UTC) Received: by lbbti1 with SMTP id ti1sf17780014lbb.3 for ; Fri, 18 Sep 2015 07:44:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=RSaScxBVD2lMwpUWM9OM92Y3Ik6YIumuxth/w7dgDNE=; b=IHMwXc5dNIds/0VAoYt9lZuH1P0WaMd0jGlpV/y8XuUQ5SZ2MfqiGToIBPeJtMcWXD 30fYGdUJifz+H55iJEeCB8/Ubj35ExhMVhlTdxz6KMaxymhkJ8W1N67D9Guc/JWOIMPY f09paHZvJbUU0jqtw5GF53Pj7ik3mmyv6C+sdKuUyfL7i35sZyhNC/xGI1Tv5GmEmkx0 aOh+0tAYjz1pDlpd7e+lLLyv57Uvogqs8INuK+e9ez1jFADm5k+hKSU4cIZyapuhohvv gr9SY/+hgyDAqul8I4/rO7PnniYU7utKSpm3sGaa7Cn1FtuBB7rNAcqGm3PF2RA90Fxd XJTw== X-Gm-Message-State: ALoCoQmgU95FUi13ogZonie2eh4qqDG02dWXSTpydZsXvouTVyTlrTo7fF9k3rdU5VZjZjPf/ySc X-Received: by 10.112.189.105 with SMTP id gh9mr982905lbc.16.1442587461938; Fri, 18 Sep 2015 07:44:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.20.134 with SMTP id n6ls213182lae.104.gmail; Fri, 18 Sep 2015 07:44:21 -0700 (PDT) X-Received: by 10.152.21.129 with SMTP id v1mr3212563lae.87.1442587461769; Fri, 18 Sep 2015 07:44:21 -0700 (PDT) Received: from mail-lb0-f179.google.com (mail-lb0-f179.google.com. [209.85.217.179]) by mx.google.com with ESMTPS id c5si6325670laa.134.2015.09.18.07.44.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Sep 2015 07:44:21 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) client-ip=209.85.217.179; Received: by lbbmp1 with SMTP id mp1so26330653lbb.1 for ; Fri, 18 Sep 2015 07:44:21 -0700 (PDT) X-Received: by 10.112.151.106 with SMTP id up10mr3343520lbb.106.1442587461661; Fri, 18 Sep 2015 07:44:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp337462lbq; Fri, 18 Sep 2015 07:44:20 -0700 (PDT) X-Received: by 10.107.40.12 with SMTP id o12mr14281634ioo.84.1442587460001; Fri, 18 Sep 2015 07:44:20 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b74si7057111iob.205.2015.09.18.07.44.19; Fri, 18 Sep 2015 07:44:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754123AbbIROoM (ORCPT + 30 others); Fri, 18 Sep 2015 10:44:12 -0400 Received: from mga14.intel.com ([192.55.52.115]:4418 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754100AbbIROoJ (ORCPT ); Fri, 18 Sep 2015 10:44:09 -0400 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 18 Sep 2015 07:44:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,553,1437462000"; d="scan'208";a="792548522" Received: from feng-bdw-de-pi.bj.intel.com ([10.238.154.58]) by fmsmga001.fm.intel.com with ESMTP; 18 Sep 2015 07:44:06 -0700 From: Feng Wu To: pbonzini@redhat.com, alex.williamson@redhat.com, joro@8bytes.org, mtosatti@redhat.com Cc: eric.auger@linaro.org, kvm@vger.kernel.org, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, Feng Wu Subject: [PATCH v9 05/18] KVM: introduce kvm_arch functions for IRQ bypass Date: Fri, 18 Sep 2015 22:29:43 +0800 Message-Id: <1442586596-5920-6-git-send-email-feng.wu@intel.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1442586596-5920-1-git-send-email-feng.wu@intel.com> References: <1442586596-5920-1-git-send-email-feng.wu@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: feng.wu@intel.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.179 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Eric Auger This patch introduces - kvm_arch_irq_bypass_add_producer - kvm_arch_irq_bypass_del_producer - kvm_arch_irq_bypass_stop - kvm_arch_irq_bypass_start They make possible to specialize the KVM IRQ bypass consumer in case CONFIG_KVM_HAVE_IRQ_BYPASS is set. Signed-off-by: Eric Auger Signed-off-by: Feng Wu --- v4 -> v5: - remove static inline stub functions v2 -> v3 (Feng Wu): - use 'kvm_arch_irq_bypass_start' instead of 'kvm_arch_irq_bypass_resume' - Remove 'kvm_arch_irq_bypass_update', which is not needed to be a irqbypass callback per Alex's comments. - Make kvm_arch_irq_bypass_add_producer return 'int' v1 -> v2: - use CONFIG_KVM_HAVE_IRQ_BYPASS instead CONFIG_IRQ_BYPASS_MANAGER - rename all functions according to Paolo's proposal - add kvm_arch_irq_bypass_update according to Feng's need include/linux/kvm_host.h | 10 ++++++++++ virt/kvm/Kconfig | 3 +++ 2 files changed, 13 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 05e99b8..5ac8d21 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -1151,5 +1152,14 @@ static inline void kvm_vcpu_set_dy_eligible(struct kvm_vcpu *vcpu, bool val) { } #endif /* CONFIG_HAVE_KVM_CPU_RELAX_INTERCEPT */ + +#ifdef CONFIG_HAVE_KVM_IRQ_BYPASS +int kvm_arch_irq_bypass_add_producer(struct irq_bypass_consumer *, + struct irq_bypass_producer *); +void kvm_arch_irq_bypass_del_producer(struct irq_bypass_consumer *, + struct irq_bypass_producer *); +void kvm_arch_irq_bypass_stop(struct irq_bypass_consumer *); +void kvm_arch_irq_bypass_start(struct irq_bypass_consumer *); +#endif /* CONFIG_HAVE_KVM_IRQ_BYPASS */ #endif diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig index e2c876d..9f8014d 100644 --- a/virt/kvm/Kconfig +++ b/virt/kvm/Kconfig @@ -47,3 +47,6 @@ config KVM_GENERIC_DIRTYLOG_READ_PROTECT config KVM_COMPAT def_bool y depends on COMPAT && !S390 + +config HAVE_KVM_IRQ_BYPASS + bool