~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/kvm_irqfd.h

Version: ~ [ linux-5.3-rc1 ] ~ [ linux-5.2.2 ] ~ [ linux-5.1.19 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.60 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.134 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.186 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.186 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.70 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /*
  2  * This program is free software; you can redistribute it and/or modify
  3  * it under the terms of the GNU General Public License as published by
  4  * the Free Software Foundation; either version 2 of the License.
  5  *
  6  * This program is distributed in the hope that it will be useful,
  7  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  8  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  9  * GNU General Public License for more details.
 10  *
 11  * irqfd: Allows an fd to be used to inject an interrupt to the guest
 12  * Credit goes to Avi Kivity for the original idea.
 13  */
 14 
 15 #ifndef __LINUX_KVM_IRQFD_H
 16 #define __LINUX_KVM_IRQFD_H
 17 
 18 #include <linux/kvm_host.h>
 19 #include <linux/poll.h>
 20 
 21 /*
 22  * Resampling irqfds are a special variety of irqfds used to emulate
 23  * level triggered interrupts.  The interrupt is asserted on eventfd
 24  * trigger.  On acknowledgment through the irq ack notifier, the
 25  * interrupt is de-asserted and userspace is notified through the
 26  * resamplefd.  All resamplers on the same gsi are de-asserted
 27  * together, so we don't need to track the state of each individual
 28  * user.  We can also therefore share the same irq source ID.
 29  */
 30 struct kvm_kernel_irqfd_resampler {
 31         struct kvm *kvm;
 32         /*
 33          * List of resampling struct _irqfd objects sharing this gsi.
 34          * RCU list modified under kvm->irqfds.resampler_lock
 35          */
 36         struct list_head list;
 37         struct kvm_irq_ack_notifier notifier;
 38         /*
 39          * Entry in list of kvm->irqfd.resampler_list.  Use for sharing
 40          * resamplers among irqfds on the same gsi.
 41          * Accessed and modified under kvm->irqfds.resampler_lock
 42          */
 43         struct list_head link;
 44 };
 45 
 46 struct kvm_kernel_irqfd {
 47         /* Used for MSI fast-path */
 48         struct kvm *kvm;
 49         wait_queue_entry_t wait;
 50         /* Update side is protected by irqfds.lock */
 51         struct kvm_kernel_irq_routing_entry irq_entry;
 52         seqcount_t irq_entry_sc;
 53         /* Used for level IRQ fast-path */
 54         int gsi;
 55         struct work_struct inject;
 56         /* The resampler used by this irqfd (resampler-only) */
 57         struct kvm_kernel_irqfd_resampler *resampler;
 58         /* Eventfd notified on resample (resampler-only) */
 59         struct eventfd_ctx *resamplefd;
 60         /* Entry in list of irqfds for a resampler (resampler-only) */
 61         struct list_head resampler_link;
 62         /* Used for setup/shutdown */
 63         struct eventfd_ctx *eventfd;
 64         struct list_head list;
 65         poll_table pt;
 66         struct work_struct shutdown;
 67         struct irq_bypass_consumer consumer;
 68         struct irq_bypass_producer *producer;
 69 };
 70 
 71 #endif /* __LINUX_KVM_IRQFD_H */
 72 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp