#include <linux/kvm_host.h>
#include <linux/kvm.h>
#include <linux/kvm_irqfd.h>
#include <linux/workqueue.h>
#include <linux/syscalls.h>
#include <linux/wait.h>
#include <linux/poll.h>
#include <linux/file.h>
#include <linux/list.h>
#include <linux/eventfd.h>
#include <linux/kernel.h>
#include <linux/srcu.h>
#include <linux/slab.h>
#include <linux/seqlock.h>
#include <linux/irqbypass.h>
#include <trace/events/kvm.h>
#include <kvm/iodev.h>
#ifdef CONFIG_HAVE_KVM_IRQCHIP
static struct workqueue_struct *irqfd_cleanup_wq;
bool __attribute__((weak))
kvm_arch_irqfd_allowed(struct kvm *kvm, struct kvm_irqfd *args)
{ … }
static void
irqfd_inject(struct work_struct *work)
{ … }
static void irqfd_resampler_notify(struct kvm_kernel_irqfd_resampler *resampler)
{ … }
static void
irqfd_resampler_ack(struct kvm_irq_ack_notifier *kian)
{ … }
static void
irqfd_resampler_shutdown(struct kvm_kernel_irqfd *irqfd)
{ … }
static void
irqfd_shutdown(struct work_struct *work)
{ … }
static bool
irqfd_is_active(struct kvm_kernel_irqfd *irqfd)
{ … }
static void
irqfd_deactivate(struct kvm_kernel_irqfd *irqfd)
{ … }
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)
{ … }
static int
irqfd_wakeup(wait_queue_entry_t *wait, unsigned mode, int sync, void *key)
{ … }
static void
irqfd_ptable_queue_proc(struct file *file, wait_queue_head_t *wqh,
poll_table *pt)
{ … }
static void irqfd_update(struct kvm *kvm, struct kvm_kernel_irqfd *irqfd)
{ … }
#ifdef CONFIG_HAVE_KVM_IRQ_BYPASS
void __attribute__((weak)) kvm_arch_irq_bypass_stop(
struct irq_bypass_consumer *cons)
{ … }
void __attribute__((weak)) kvm_arch_irq_bypass_start(
struct irq_bypass_consumer *cons)
{ … }
int __attribute__((weak)) kvm_arch_update_irqfd_routing(
struct kvm *kvm, unsigned int host_irq,
uint32_t guest_irq, bool set)
{ … }
bool __attribute__((weak)) kvm_arch_irqfd_route_changed(
struct kvm_kernel_irq_routing_entry *old,
struct kvm_kernel_irq_routing_entry *new)
{ … }
#endif
static int
kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
{ … }
bool kvm_irq_has_notifier(struct kvm *kvm, unsigned irqchip, unsigned pin)
{ … }
EXPORT_SYMBOL_GPL(…);
void kvm_notify_acked_gsi(struct kvm *kvm, int gsi)
{ … }
void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin)
{ … }
void kvm_register_irq_ack_notifier(struct kvm *kvm,
struct kvm_irq_ack_notifier *kian)
{ … }
void kvm_unregister_irq_ack_notifier(struct kvm *kvm,
struct kvm_irq_ack_notifier *kian)
{ … }
static int
kvm_irqfd_deassign(struct kvm *kvm, struct kvm_irqfd *args)
{ … }
int
kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args)
{ … }
void
kvm_irqfd_release(struct kvm *kvm)
{ … }
void kvm_irq_routing_update(struct kvm *kvm)
{ … }
bool kvm_notify_irqfd_resampler(struct kvm *kvm,
unsigned int irqchip,
unsigned int pin)
{ … }
int kvm_irqfd_init(void)
{ … }
void kvm_irqfd_exit(void)
{ … }
#endif
struct _ioeventfd { … };
static inline struct _ioeventfd *
to_ioeventfd(struct kvm_io_device *dev)
{ … }
static void
ioeventfd_release(struct _ioeventfd *p)
{ … }
static bool
ioeventfd_in_range(struct _ioeventfd *p, gpa_t addr, int len, const void *val)
{ … }
static int
ioeventfd_write(struct kvm_vcpu *vcpu, struct kvm_io_device *this, gpa_t addr,
int len, const void *val)
{ … }
static void
ioeventfd_destructor(struct kvm_io_device *this)
{ … }
static const struct kvm_io_device_ops ioeventfd_ops = …;
static bool
ioeventfd_check_collision(struct kvm *kvm, struct _ioeventfd *p)
{ … }
static enum kvm_bus ioeventfd_bus_from_flags(__u32 flags)
{ … }
static int kvm_assign_ioeventfd_idx(struct kvm *kvm,
enum kvm_bus bus_idx,
struct kvm_ioeventfd *args)
{ … }
static int
kvm_deassign_ioeventfd_idx(struct kvm *kvm, enum kvm_bus bus_idx,
struct kvm_ioeventfd *args)
{ … }
static int kvm_deassign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
{ … }
static int
kvm_assign_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
{ … }
int
kvm_ioeventfd(struct kvm *kvm, struct kvm_ioeventfd *args)
{ … }
void
kvm_eventfd_init(struct kvm *kvm)
{ … }