From patchwork Mon Aug 10 13:31:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Auger X-Patchwork-Id: 6984371 Return-Path: X-Original-To: patchwork-kvm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 5CB279F344 for ; Mon, 10 Aug 2015 13:32:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6C7B5205B7 for ; Mon, 10 Aug 2015 13:32:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 88322205FF for ; Mon, 10 Aug 2015 13:32:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754107AbbHJNcI (ORCPT ); Mon, 10 Aug 2015 09:32:08 -0400 Received: from mail-wi0-f182.google.com ([209.85.212.182]:36355 "EHLO mail-wi0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753896AbbHJNcB (ORCPT ); Mon, 10 Aug 2015 09:32:01 -0400 Received: by wicja10 with SMTP id ja10so37315302wic.1 for ; Mon, 10 Aug 2015 06:32:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=U+gBX2kamKHqJuQRU385PZZQlQXLPF09Xxdf69XHWik=; b=iOBTmyhny/SYLLrgZ00rR0SAe8h10JTH6auUk/KiILrmx2CVVUkuY2Lbcqdmoyn7w+ +K0elJJZrKNu0jwjMxCxr358/mXLQ55UgQMUCrzgrWByRoTaB9QZuy+kPA0WdZTeov7t WJuNmZ8cQxD25Z2Z89zk3rQ3noH0e+v3ilwVQySvMRx0QsU9T/nOCQm4mARMuDSuXuTV JjDS5MNI0I5AbwDTMjw6v12jUvHc9lzPCJmZ5SKGqLAJjgFoUOd4p8B95yDiQjFbwzsO fTgBC8PqY0TE1rilq5cbnq18CNM6xrfLtfyJmCr/yP5iXUJlg5qauDolAO0JuYZva+Bq wE4A== X-Gm-Message-State: ALoCoQlWXuatYxq+IAlVUTFqVP8YQYNkFoGDmVLXExKBqMSJ6Esre2GbpEo/WExd97+AM9q1D1J0 X-Received: by 10.194.90.225 with SMTP id bz1mr29046882wjb.110.1439213520336; Mon, 10 Aug 2015 06:32:00 -0700 (PDT) Received: from gnx2579.home (LCaen-156-56-7-90.w80-11.abo.wanadoo.fr. [80.11.198.90]) by smtp.gmail.com with ESMTPSA id s16sm13826483wib.16.2015.08.10.06.31.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 06:31:59 -0700 (PDT) From: Eric Auger To: eric.auger@st.com, eric.auger@linaro.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, alex.williamson@redhat.com, pbonzini@redhat.com, feng.wu@intel.com Cc: linux-kernel@vger.kernel.org, patches@linaro.org, christoffer.dall@linaro.org, marc.zyngier@arm.com Subject: [PATCH v5 4/5] KVM: introduce kvm_arch functions for IRQ bypass Date: Mon, 10 Aug 2015 15:31:06 +0200 Message-Id: <1439213467-13668-5-git-send-email-eric.auger@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1439213467-13668-1-git-send-email-eric.auger@linaro.org> References: <1439213467-13668-1-git-send-email-eric.auger@linaro.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 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