Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753181AbbLCShg (ORCPT ); Thu, 3 Dec 2015 13:37:36 -0500 Received: from mga14.intel.com ([192.55.52.115]:53670 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752999AbbLCSgs (ORCPT ); Thu, 3 Dec 2015 13:36:48 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,378,1444719600"; d="scan'208";a="7025556" From: Yunhong Jiang To: alex.williamson@redhat.com, pbonzini@redhat.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 5/5] KVM: Expose x86 kvm_arch_set_irq_inatomic() Date: Thu, 3 Dec 2015 10:22:52 -0800 Message-Id: <1449166972-8894-6-git-send-email-yunhong.jiang@linux.intel.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1449166972-8894-1-git-send-email-yunhong.jiang@linux.intel.com> References: <1449166972-8894-1-git-send-email-yunhong.jiang@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3169 Lines: 96 The x86 support setting irq in atomic, expose it to vfio driver. Signed-off-by: Yunhong Jiang --- arch/x86/kvm/Kconfig | 1 + include/linux/kvm_host.h | 19 ++++++++++++++++--- virt/kvm/Kconfig | 3 +++ virt/kvm/eventfd.c | 9 --------- 4 files changed, 20 insertions(+), 12 deletions(-) diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 639a6e34500c..642e8b905c96 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -30,6 +30,7 @@ config KVM select HAVE_KVM_IRQFD select IRQ_BYPASS_MANAGER select HAVE_KVM_IRQ_BYPASS + select KVM_SET_IRQ_INATOMIC select HAVE_KVM_IRQ_ROUTING select HAVE_KVM_EVENTFD select KVM_APIC_ARCHITECTURE diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index 590c46e672df..a6e237275928 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -852,9 +852,6 @@ int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level, bool line_status); int kvm_set_msi(struct kvm_kernel_irq_routing_entry *irq_entry, struct kvm *kvm, int irq_source_id, int level, bool line_status); -int kvm_arch_set_irq_inatomic(struct kvm_kernel_irq_routing_entry *e, - struct kvm *kvm, int irq_source_id, - int level, bool line_status); bool kvm_irq_has_notifier(struct kvm *kvm, unsigned irqchip, unsigned pin); void kvm_notify_acked_gsi(struct kvm *kvm, int gsi); void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); @@ -1207,4 +1204,20 @@ int kvm_arch_update_irqfd_routing(struct kvm *kvm, unsigned int host_irq, uint32_t guest_irq, bool set); #endif /* CONFIG_HAVE_KVM_IRQ_BYPASS */ +#ifndef CONFIG_KVM_SET_IRQ_INATOMIC +int __attribute__((weak)) kvm_arch_set_irq_inatomic( + struct kvm_kernel_irq_routing_entry *irq, + struct kvm *kvm, int irq_source_id, + int level, + bool line_status) +{ + return -EWOULDBLOCK; +} +#else +extern int kvm_arch_set_irq_inatomic( + struct kvm_kernel_irq_routing_entry *e, + struct kvm *kvm, int irq_source_id, int level, + bool line_status); +#endif + #endif diff --git a/virt/kvm/Kconfig b/virt/kvm/Kconfig index 7a79b6853583..7c99dd4724a4 100644 --- a/virt/kvm/Kconfig +++ b/virt/kvm/Kconfig @@ -50,3 +50,6 @@ config KVM_COMPAT config HAVE_KVM_IRQ_BYPASS bool + +config KVM_SET_IRQ_INATOMIC + bool diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index b20a2d1bbf73..405c26742380 100644 --- a/virt/kvm/eventfd.c +++ b/virt/kvm/eventfd.c @@ -173,15 +173,6 @@ irqfd_deactivate(struct kvm_kernel_irqfd *irqfd) queue_work(irqfd_cleanup_wq, &irqfd->shutdown); } -int __attribute__((weak)) kvm_arch_set_irq_inatomic( - struct kvm_kernel_irq_routing_entry *irq, - struct kvm *kvm, int irq_source_id, - int level, - bool line_status) -{ - return -EWOULDBLOCK; -} - static int irqfd_wakeup_pollin(struct kvm_kernel_irqfd *irqfd) { -- 1.8.3.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/