From: Yunhong Jiang <yunhong.jiang@linux.intel.com>
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 [thread overview]
Message-ID: <1449166972-8894-6-git-send-email-yunhong.jiang@linux.intel.com> (raw)
In-Reply-To: <1449166972-8894-1-git-send-email-yunhong.jiang@linux.intel.com>
The x86 support setting irq in atomic, expose it to vfio driver.
Signed-off-by: Yunhong Jiang <yunhong.jiang@linux.intel.com>
---
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
next prev parent reply other threads:[~2015-12-03 18:37 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-03 18:22 [PATCH 0/5] Threaded MSI interrupt for VFIO PCI device Yunhong Jiang
2015-12-03 18:22 ` [PATCH 1/5] KVM: Extract the irqfd_wakeup_pollin/irqfd_wakeup_pollup Yunhong Jiang
2015-12-03 18:22 ` [PATCH 2/5] VIRT: Support runtime irq_bypass consumer Yunhong Jiang
2015-12-16 19:48 ` Alex Williamson
2015-12-03 18:22 ` [PATCH 3/5] VFIO: Support threaded interrupt handling on VFIO Yunhong Jiang
2015-12-16 19:49 ` Alex Williamson
2015-12-03 18:22 ` [PATCH 4/5] KVM: Add the irq handling consumer Yunhong Jiang
2015-12-04 0:33 ` kbuild test robot
2015-12-03 18:22 ` Yunhong Jiang [this message]
2015-12-03 18:55 ` [PATCH 0/5] Threaded MSI interrupt for VFIO PCI device Alex Williamson
2015-12-03 22:31 ` Yunhong Jiang
2015-12-16 17:56 ` Paolo Bonzini
2015-12-16 19:15 ` Alex Williamson
2015-12-16 21:55 ` Paolo Bonzini
2016-01-06 7:42 ` Yunhong Jiang
2016-01-06 7:40 ` Yunhong Jiang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1449166972-8894-6-git-send-email-yunhong.jiang@linux.intel.com \
--to=yunhong.jiang@linux.intel.com \
--cc=alex.williamson@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome