Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1227957 > unrolled thread

[PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series

Started byFeng Wu <feng.wu@intel.com>
First post2015-09-18 16:50 +0200
Last post2015-09-18 17:00 +0200
Articles 10 — 4 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series Feng Wu <feng.wu@intel.com> - 2015-09-18 16:50 +0200
    Re: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including  prerequisite series Paolo Bonzini <pbonzini@redhat.com> - 2015-09-18 17:00 +0200
      RE: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including  prerequisite series "Wu, Feng" <feng.wu@intel.com> - 2015-09-18 17:20 +0200
        Re: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including  prerequisite series Paolo Bonzini <pbonzini@redhat.com> - 2015-09-18 17:30 +0200
          RE: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including  prerequisite series "Wu, Feng" <feng.wu@intel.com> - 2015-09-18 17:40 +0200
      Re: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including  prerequisite series Alex Williamson <alex.williamson@redhat.com> - 2015-09-18 20:00 +0200
    [PATCH v9 04/18] KVM: create kvm_irqfd.h Feng Wu <feng.wu@intel.com> - 2015-09-18 17:00 +0200
      RE: [PATCH v9 04/18] KVM: create kvm_irqfd.h "Wu, Feng" <feng.wu@intel.com> - 2015-09-18 17:40 +0200
    [PATCH v9 02/18] KVM: x86: select IRQ_BYPASS_MANAGER Feng Wu <feng.wu@intel.com> - 2015-09-18 17:00 +0200
    [PATCH v9 05/18] KVM: introduce kvm_arch functions for IRQ bypass Feng Wu <feng.wu@intel.com> - 2015-09-18 17:00 +0200

#1227957 — [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series

FromFeng Wu <feng.wu@intel.com>
Date2015-09-18 16:50 +0200
Subject[PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series
Message-ID<qa597-5y9-3@gated-at.bofh.it>
VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt.
With VT-d Posted-Interrupts enabled, external interrupts from
direct-assigned devices can be delivered to guests without VMM
intervention when guest is running in non-root mode.

You can find the VT-d Posted-Interrtups Spec. in the following URL:
http://www.intel.com/content/www/us/en/intelligent-systems/intel-technology/vt-directed-io-spec.html

v9:
- Include the whole series:
[01/18]: irq bypasser manager
[02/18] - [06/18]: Common non-architecture part for VT-d PI and ARM side forwarded irq
[07/18] - [18/18]: VT-d PI part

v8:
refer to the changelog in each patch

v7:
* Define two weak irq bypass callbacks:
  - kvm_arch_irq_bypass_start()
  - kvm_arch_irq_bypass_stop()
* Remove the x86 dummy implementation of the above two functions.
* Print some useful information instead of WARN_ON() when the
  irq bypass consumer unregistration fails.
* Fix an issue when calling pi_pre_block and pi_post_block.

v6:
* Rebase on 4.2.0-rc6
* Rebase on https://lkml.org/lkml/2015/8/6/526 and http://www.gossamer-threads.com/lists/linux/kernel/2235623
* Make the add_consumer and del_consumer callbacks static
* Remove pointless INIT_LIST_HEAD to 'vdev->ctx[vector].producer.node)'
* Use dev_info instead of WARN_ON() when irq_bypass_register_producer fails
* Remove optional dummy callbacks for irq producer

v4:
* For lowest-priority interrupt, only support single-CPU destination
interrupts at the current stage, more common lowest priority support
will be added later.
* Accoring to Marcelo's suggestion, when vCPU is blocked, we handle
the posted-interrupts in the HLT emulation path.
* Some small changes (coding style, typo, add some code comments)

v3:
* Adjust the Posted-interrupts Descriptor updating logic when vCPU is
  preempted or blocked.
* KVM_DEV_VFIO_DEVICE_POSTING_IRQ --> KVM_DEV_VFIO_DEVICE_POST_IRQ
* __KVM_HAVE_ARCH_KVM_VFIO_POSTING --> __KVM_HAVE_ARCH_KVM_VFIO_POST
* Add KVM_DEV_VFIO_DEVICE_UNPOST_IRQ attribute for VFIO irq, which
  can be used to change back to remapping mode.
* Fix typo

v2:
* Use VFIO framework to enable this feature, the VFIO part of this series is
  base on Eric's patch "[PATCH v3 0/8] KVM-VFIO IRQ forward control"
* Rebase this patchset on git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git,
  then revise some irq logic based on the new hierarchy irqdomain patches provided
  by Jiang Liu <jiang.liu@linux.intel.com>


*** BLURB HERE ***

Alex Williamson (1):
  virt: IRQ bypass manager

Eric Auger (4):
  KVM: arm/arm64: select IRQ_BYPASS_MANAGER
  KVM: create kvm_irqfd.h
  KVM: introduce kvm_arch functions for IRQ bypass
  KVM: eventfd: add irq bypass consumer management

Feng Wu (13):
  KVM: x86: select IRQ_BYPASS_MANAGER
  KVM: Extend struct pi_desc for VT-d Posted-Interrupts
  KVM: Add some helper functions for Posted-Interrupts
  KVM: Define a new interface kvm_intr_is_single_vcpu()
  KVM: Make struct kvm_irq_routing_table accessible
  KVM: make kvm_set_msi_irq() public
  vfio: Register/unregister irq_bypass_producer
  KVM: x86: Update IRTE for posted-interrupts
  KVM: Implement IRQ bypass consumer callbacks for x86
  KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'
  KVM: Update Posted-Interrupts Descriptor when vCPU is preempted
  KVM: Update Posted-Interrupts Descriptor when vCPU is blocked
  iommu/vt-d: Add a command line parameter for VT-d posted-interrupts

 Documentation/kernel-parameters.txt   |   1 +
 Documentation/virtual/kvm/locking.txt |  12 ++
 MAINTAINERS                           |   7 +
 arch/arm/kvm/Kconfig                  |   2 +
 arch/arm/kvm/Makefile                 |   1 +
 arch/arm64/kvm/Kconfig                |   2 +
 arch/arm64/kvm/Makefile               |   1 +
 arch/x86/include/asm/kvm_host.h       |  24 +++
 arch/x86/kvm/Kconfig                  |   3 +
 arch/x86/kvm/Makefile                 |   3 +
 arch/x86/kvm/irq_comm.c               |  32 ++-
 arch/x86/kvm/lapic.c                  |  59 ++++++
 arch/x86/kvm/lapic.h                  |   2 +
 arch/x86/kvm/trace.h                  |  33 ++++
 arch/x86/kvm/vmx.c                    | 361 +++++++++++++++++++++++++++++++++-
 arch/x86/kvm/x86.c                    | 108 +++++++++-
 drivers/iommu/irq_remapping.c         |  12 +-
 drivers/vfio/pci/Kconfig              |   1 +
 drivers/vfio/pci/vfio_pci_intrs.c     |   9 +
 drivers/vfio/pci/vfio_pci_private.h   |   2 +
 include/linux/irqbypass.h             |  90 +++++++++
 include/linux/kvm_host.h              |  29 +++
 include/linux/kvm_irqfd.h             |  71 +++++++
 virt/kvm/Kconfig                      |   3 +
 virt/kvm/eventfd.c                    | 142 +++++++------
 virt/kvm/irqchip.c                    |  10 -
 virt/kvm/kvm_main.c                   |   3 +
 virt/lib/Kconfig                      |   2 +
 virt/lib/Makefile                     |   1 +
 virt/lib/irqbypass.c                  | 257 ++++++++++++++++++++++++
 30 files changed, 1182 insertions(+), 101 deletions(-)
 create mode 100644 include/linux/irqbypass.h
 create mode 100644 include/linux/kvm_irqfd.h
 create mode 100644 virt/lib/Kconfig
 create mode 100644 virt/lib/Makefile
 create mode 100644 virt/lib/irqbypass.c

-- 
2.1.0

--
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/

[toc] | [next] | [standalone]


#1227962 — Re: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series

FromPaolo Bonzini <pbonzini@redhat.com>
Date2015-09-18 17:00 +0200
SubjectRe: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series
Message-ID<qa5iO-5JO-7@gated-at.bofh.it>
In reply to#1227957

On 18/09/2015 16:29, Feng Wu wrote:
> VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt.
> With VT-d Posted-Interrupts enabled, external interrupts from
> direct-assigned devices can be delivered to guests without VMM
> intervention when guest is running in non-root mode.
> 
> You can find the VT-d Posted-Interrtups Spec. in the following URL:
> http://www.intel.com/content/www/us/en/intelligent-systems/intel-technology/vt-directed-io-spec.html

Thanks.  I will squash patches 2 and 14 together, and drop patch 3.

Signed-off-bys are missing in patch 1 and 4.  The patches exist
elsewhere in the mailing list archives, so not a big deal.  Or just
reply to them with the S-o-b line.

Alex, can you ack the series and review patch 12?

Joerg, can you ack patch 18?

Paolo

> v9:
> - Include the whole series:
> [01/18]: irq bypasser manager
> [02/18] - [06/18]: Common non-architecture part for VT-d PI and ARM side forwarded irq
> [07/18] - [18/18]: VT-d PI part
> 
> v8:
> refer to the changelog in each patch
> 
> v7:
> * Define two weak irq bypass callbacks:
>   - kvm_arch_irq_bypass_start()
>   - kvm_arch_irq_bypass_stop()
> * Remove the x86 dummy implementation of the above two functions.
> * Print some useful information instead of WARN_ON() when the
>   irq bypass consumer unregistration fails.
> * Fix an issue when calling pi_pre_block and pi_post_block.
> 
> v6:
> * Rebase on 4.2.0-rc6
> * Rebase on https://lkml.org/lkml/2015/8/6/526 and http://www.gossamer-threads.com/lists/linux/kernel/2235623
> * Make the add_consumer and del_consumer callbacks static
> * Remove pointless INIT_LIST_HEAD to 'vdev->ctx[vector].producer.node)'
> * Use dev_info instead of WARN_ON() when irq_bypass_register_producer fails
> * Remove optional dummy callbacks for irq producer
> 
> v4:
> * For lowest-priority interrupt, only support single-CPU destination
> interrupts at the current stage, more common lowest priority support
> will be added later.
> * Accoring to Marcelo's suggestion, when vCPU is blocked, we handle
> the posted-interrupts in the HLT emulation path.
> * Some small changes (coding style, typo, add some code comments)
> 
> v3:
> * Adjust the Posted-interrupts Descriptor updating logic when vCPU is
>   preempted or blocked.
> * KVM_DEV_VFIO_DEVICE_POSTING_IRQ --> KVM_DEV_VFIO_DEVICE_POST_IRQ
> * __KVM_HAVE_ARCH_KVM_VFIO_POSTING --> __KVM_HAVE_ARCH_KVM_VFIO_POST
> * Add KVM_DEV_VFIO_DEVICE_UNPOST_IRQ attribute for VFIO irq, which
>   can be used to change back to remapping mode.
> * Fix typo
> 
> v2:
> * Use VFIO framework to enable this feature, the VFIO part of this series is
>   base on Eric's patch "[PATCH v3 0/8] KVM-VFIO IRQ forward control"
> * Rebase this patchset on git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git,
>   then revise some irq logic based on the new hierarchy irqdomain patches provided
>   by Jiang Liu <jiang.liu@linux.intel.com>
> 
> 
> *** BLURB HERE ***
> 
> Alex Williamson (1):
>   virt: IRQ bypass manager
> 
> Eric Auger (4):
>   KVM: arm/arm64: select IRQ_BYPASS_MANAGER
>   KVM: create kvm_irqfd.h
>   KVM: introduce kvm_arch functions for IRQ bypass
>   KVM: eventfd: add irq bypass consumer management
> 
> Feng Wu (13):
>   KVM: x86: select IRQ_BYPASS_MANAGER
>   KVM: Extend struct pi_desc for VT-d Posted-Interrupts
>   KVM: Add some helper functions for Posted-Interrupts
>   KVM: Define a new interface kvm_intr_is_single_vcpu()
>   KVM: Make struct kvm_irq_routing_table accessible
>   KVM: make kvm_set_msi_irq() public
>   vfio: Register/unregister irq_bypass_producer
>   KVM: x86: Update IRTE for posted-interrupts
>   KVM: Implement IRQ bypass consumer callbacks for x86
>   KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'
>   KVM: Update Posted-Interrupts Descriptor when vCPU is preempted
>   KVM: Update Posted-Interrupts Descriptor when vCPU is blocked
>   iommu/vt-d: Add a command line parameter for VT-d posted-interrupts
> 
>  Documentation/kernel-parameters.txt   |   1 +
>  Documentation/virtual/kvm/locking.txt |  12 ++
>  MAINTAINERS                           |   7 +
>  arch/arm/kvm/Kconfig                  |   2 +
>  arch/arm/kvm/Makefile                 |   1 +
>  arch/arm64/kvm/Kconfig                |   2 +
>  arch/arm64/kvm/Makefile               |   1 +
>  arch/x86/include/asm/kvm_host.h       |  24 +++
>  arch/x86/kvm/Kconfig                  |   3 +
>  arch/x86/kvm/Makefile                 |   3 +
>  arch/x86/kvm/irq_comm.c               |  32 ++-
>  arch/x86/kvm/lapic.c                  |  59 ++++++
>  arch/x86/kvm/lapic.h                  |   2 +
>  arch/x86/kvm/trace.h                  |  33 ++++
>  arch/x86/kvm/vmx.c                    | 361 +++++++++++++++++++++++++++++++++-
>  arch/x86/kvm/x86.c                    | 108 +++++++++-
>  drivers/iommu/irq_remapping.c         |  12 +-
>  drivers/vfio/pci/Kconfig              |   1 +
>  drivers/vfio/pci/vfio_pci_intrs.c     |   9 +
>  drivers/vfio/pci/vfio_pci_private.h   |   2 +
>  include/linux/irqbypass.h             |  90 +++++++++
>  include/linux/kvm_host.h              |  29 +++
>  include/linux/kvm_irqfd.h             |  71 +++++++
>  virt/kvm/Kconfig                      |   3 +
>  virt/kvm/eventfd.c                    | 142 +++++++------
>  virt/kvm/irqchip.c                    |  10 -
>  virt/kvm/kvm_main.c                   |   3 +
>  virt/lib/Kconfig                      |   2 +
>  virt/lib/Makefile                     |   1 +
>  virt/lib/irqbypass.c                  | 257 ++++++++++++++++++++++++
>  30 files changed, 1182 insertions(+), 101 deletions(-)
>  create mode 100644 include/linux/irqbypass.h
>  create mode 100644 include/linux/kvm_irqfd.h
>  create mode 100644 virt/lib/Kconfig
>  create mode 100644 virt/lib/Makefile
>  create mode 100644 virt/lib/irqbypass.c
> 
--
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/

[toc] | [prev] | [next] | [standalone]


#1228048 — RE: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series

From"Wu, Feng" <feng.wu@intel.com>
Date2015-09-18 17:20 +0200
SubjectRE: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series
Message-ID<qa5Cc-6mB-67@gated-at.bofh.it>
In reply to#1227962

> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> Sent: Friday, September 18, 2015 10:59 PM
> To: Wu, Feng; alex.williamson@redhat.com; joro@8bytes.org;
> mtosatti@redhat.com
> Cc: eric.auger@linaro.org; kvm@vger.kernel.org;
> iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including
> prerequisite series
> 
> 
> 
> On 18/09/2015 16:29, Feng Wu wrote:
> > VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt.
> > With VT-d Posted-Interrupts enabled, external interrupts from
> > direct-assigned devices can be delivered to guests without VMM
> > intervention when guest is running in non-root mode.
> >
> > You can find the VT-d Posted-Interrtups Spec. in the following URL:
> >
> http://www.intel.com/content/www/us/en/intelligent-systems/intel-technolog
> y/vt-directed-io-spec.html
> 
> Thanks.  I will squash patches 2 and 14 together, and drop patch 3.
> 
> Signed-off-bys are missing in patch 1 and 4.  The patches exist
> elsewhere in the mailing list archives, so not a big deal.  Or just
> reply to them with the S-o-b line.
> 

Thanks for your quick response, Paolo! I didn't change the code
in patch 1 and 4, do I need to add s-o-b, if needed, I can reply
the patches.

Thanks,
Feng

> Alex, can you ack the series and review patch 12?
> 
> Joerg, can you ack patch 18?
> 
> Paolo
> 
> > v9:
> > - Include the whole series:
> > [01/18]: irq bypasser manager
> > [02/18] - [06/18]: Common non-architecture part for VT-d PI and ARM side
> forwarded irq
> > [07/18] - [18/18]: VT-d PI part
> >
> > v8:
> > refer to the changelog in each patch
> >
> > v7:
> > * Define two weak irq bypass callbacks:
> >   - kvm_arch_irq_bypass_start()
> >   - kvm_arch_irq_bypass_stop()
> > * Remove the x86 dummy implementation of the above two functions.
> > * Print some useful information instead of WARN_ON() when the
> >   irq bypass consumer unregistration fails.
> > * Fix an issue when calling pi_pre_block and pi_post_block.
> >
> > v6:
> > * Rebase on 4.2.0-rc6
> > * Rebase on https://lkml.org/lkml/2015/8/6/526 and
> http://www.gossamer-threads.com/lists/linux/kernel/2235623
> > * Make the add_consumer and del_consumer callbacks static
> > * Remove pointless INIT_LIST_HEAD to 'vdev->ctx[vector].producer.node)'
> > * Use dev_info instead of WARN_ON() when irq_bypass_register_producer
> fails
> > * Remove optional dummy callbacks for irq producer
> >
> > v4:
> > * For lowest-priority interrupt, only support single-CPU destination
> > interrupts at the current stage, more common lowest priority support
> > will be added later.
> > * Accoring to Marcelo's suggestion, when vCPU is blocked, we handle
> > the posted-interrupts in the HLT emulation path.
> > * Some small changes (coding style, typo, add some code comments)
> >
> > v3:
> > * Adjust the Posted-interrupts Descriptor updating logic when vCPU is
> >   preempted or blocked.
> > * KVM_DEV_VFIO_DEVICE_POSTING_IRQ -->
> KVM_DEV_VFIO_DEVICE_POST_IRQ
> > * __KVM_HAVE_ARCH_KVM_VFIO_POSTING -->
> __KVM_HAVE_ARCH_KVM_VFIO_POST
> > * Add KVM_DEV_VFIO_DEVICE_UNPOST_IRQ attribute for VFIO irq, which
> >   can be used to change back to remapping mode.
> > * Fix typo
> >
> > v2:
> > * Use VFIO framework to enable this feature, the VFIO part of this series is
> >   base on Eric's patch "[PATCH v3 0/8] KVM-VFIO IRQ forward control"
> > * Rebase this patchset on
> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git,
> >   then revise some irq logic based on the new hierarchy irqdomain patches
> provided
> >   by Jiang Liu <jiang.liu@linux.intel.com>
> >
> >
> > *** BLURB HERE ***
> >
> > Alex Williamson (1):
> >   virt: IRQ bypass manager
> >
> > Eric Auger (4):
> >   KVM: arm/arm64: select IRQ_BYPASS_MANAGER
> >   KVM: create kvm_irqfd.h
> >   KVM: introduce kvm_arch functions for IRQ bypass
> >   KVM: eventfd: add irq bypass consumer management
> >
> > Feng Wu (13):
> >   KVM: x86: select IRQ_BYPASS_MANAGER
> >   KVM: Extend struct pi_desc for VT-d Posted-Interrupts
> >   KVM: Add some helper functions for Posted-Interrupts
> >   KVM: Define a new interface kvm_intr_is_single_vcpu()
> >   KVM: Make struct kvm_irq_routing_table accessible
> >   KVM: make kvm_set_msi_irq() public
> >   vfio: Register/unregister irq_bypass_producer
> >   KVM: x86: Update IRTE for posted-interrupts
> >   KVM: Implement IRQ bypass consumer callbacks for x86
> >   KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'
> >   KVM: Update Posted-Interrupts Descriptor when vCPU is preempted
> >   KVM: Update Posted-Interrupts Descriptor when vCPU is blocked
> >   iommu/vt-d: Add a command line parameter for VT-d posted-interrupts
> >
> >  Documentation/kernel-parameters.txt   |   1 +
> >  Documentation/virtual/kvm/locking.txt |  12 ++
> >  MAINTAINERS                           |   7 +
> >  arch/arm/kvm/Kconfig                  |   2 +
> >  arch/arm/kvm/Makefile                 |   1 +
> >  arch/arm64/kvm/Kconfig                |   2 +
> >  arch/arm64/kvm/Makefile               |   1 +
> >  arch/x86/include/asm/kvm_host.h       |  24 +++
> >  arch/x86/kvm/Kconfig                  |   3 +
> >  arch/x86/kvm/Makefile                 |   3 +
> >  arch/x86/kvm/irq_comm.c               |  32 ++-
> >  arch/x86/kvm/lapic.c                  |  59 ++++++
> >  arch/x86/kvm/lapic.h                  |   2 +
> >  arch/x86/kvm/trace.h                  |  33 ++++
> >  arch/x86/kvm/vmx.c                    | 361
> +++++++++++++++++++++++++++++++++-
> >  arch/x86/kvm/x86.c                    | 108 +++++++++-
> >  drivers/iommu/irq_remapping.c         |  12 +-
> >  drivers/vfio/pci/Kconfig              |   1 +
> >  drivers/vfio/pci/vfio_pci_intrs.c     |   9 +
> >  drivers/vfio/pci/vfio_pci_private.h   |   2 +
> >  include/linux/irqbypass.h             |  90 +++++++++
> >  include/linux/kvm_host.h              |  29 +++
> >  include/linux/kvm_irqfd.h             |  71 +++++++
> >  virt/kvm/Kconfig                      |   3 +
> >  virt/kvm/eventfd.c                    | 142 +++++++------
> >  virt/kvm/irqchip.c                    |  10 -
> >  virt/kvm/kvm_main.c                   |   3 +
> >  virt/lib/Kconfig                      |   2 +
> >  virt/lib/Makefile                     |   1 +
> >  virt/lib/irqbypass.c                  | 257
> ++++++++++++++++++++++++
> >  30 files changed, 1182 insertions(+), 101 deletions(-)
> >  create mode 100644 include/linux/irqbypass.h
> >  create mode 100644 include/linux/kvm_irqfd.h
> >  create mode 100644 virt/lib/Kconfig
> >  create mode 100644 virt/lib/Makefile
> >  create mode 100644 virt/lib/irqbypass.c
> >
--
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/

[toc] | [prev] | [next] | [standalone]


#1228059 — Re: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series

FromPaolo Bonzini <pbonzini@redhat.com>
Date2015-09-18 17:30 +0200
SubjectRe: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series
Message-ID<qa5LQ-6xO-29@gated-at.bofh.it>
In reply to#1228048

On 18/09/2015 17:08, Wu, Feng wrote:
> 
> 
>> -----Original Message-----
>> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
>> Sent: Friday, September 18, 2015 10:59 PM
>> To: Wu, Feng; alex.williamson@redhat.com; joro@8bytes.org;
>> mtosatti@redhat.com
>> Cc: eric.auger@linaro.org; kvm@vger.kernel.org;
>> iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org
>> Subject: Re: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including
>> prerequisite series
>>
>>
>>
>> On 18/09/2015 16:29, Feng Wu wrote:
>>> VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt.
>>> With VT-d Posted-Interrupts enabled, external interrupts from
>>> direct-assigned devices can be delivered to guests without VMM
>>> intervention when guest is running in non-root mode.
>>>
>>> You can find the VT-d Posted-Interrtups Spec. in the following URL:
>>>
>> http://www.intel.com/content/www/us/en/intelligent-systems/intel-technolog
>> y/vt-directed-io-spec.html
>>
>> Thanks.  I will squash patches 2 and 14 together, and drop patch 3.
>>
>> Signed-off-bys are missing in patch 1 and 4.  The patches exist
>> elsewhere in the mailing list archives, so not a big deal.  Or just
>> reply to them with the S-o-b line.
>>
> 
> Thanks for your quick response, Paolo! I didn't change the code
> in patch 1 and 4, do I need to add s-o-b, if needed, I can reply
> the patches.

Yes, the s-o-b just means that the code passed through your hands.

Note that I replied to patch 17, but no need to resend that one
either---just mailing list discussion is enough.

Paolo

> Thanks,
> Feng
> 
>> Alex, can you ack the series and review patch 12?
>>
>> Joerg, can you ack patch 18?
>>
>> Paolo
>>
>>> v9:
>>> - Include the whole series:
>>> [01/18]: irq bypasser manager
>>> [02/18] - [06/18]: Common non-architecture part for VT-d PI and ARM side
>> forwarded irq
>>> [07/18] - [18/18]: VT-d PI part
>>>
>>> v8:
>>> refer to the changelog in each patch
>>>
>>> v7:
>>> * Define two weak irq bypass callbacks:
>>>   - kvm_arch_irq_bypass_start()
>>>   - kvm_arch_irq_bypass_stop()
>>> * Remove the x86 dummy implementation of the above two functions.
>>> * Print some useful information instead of WARN_ON() when the
>>>   irq bypass consumer unregistration fails.
>>> * Fix an issue when calling pi_pre_block and pi_post_block.
>>>
>>> v6:
>>> * Rebase on 4.2.0-rc6
>>> * Rebase on https://lkml.org/lkml/2015/8/6/526 and
>> http://www.gossamer-threads.com/lists/linux/kernel/2235623
>>> * Make the add_consumer and del_consumer callbacks static
>>> * Remove pointless INIT_LIST_HEAD to 'vdev->ctx[vector].producer.node)'
>>> * Use dev_info instead of WARN_ON() when irq_bypass_register_producer
>> fails
>>> * Remove optional dummy callbacks for irq producer
>>>
>>> v4:
>>> * For lowest-priority interrupt, only support single-CPU destination
>>> interrupts at the current stage, more common lowest priority support
>>> will be added later.
>>> * Accoring to Marcelo's suggestion, when vCPU is blocked, we handle
>>> the posted-interrupts in the HLT emulation path.
>>> * Some small changes (coding style, typo, add some code comments)
>>>
>>> v3:
>>> * Adjust the Posted-interrupts Descriptor updating logic when vCPU is
>>>   preempted or blocked.
>>> * KVM_DEV_VFIO_DEVICE_POSTING_IRQ -->
>> KVM_DEV_VFIO_DEVICE_POST_IRQ
>>> * __KVM_HAVE_ARCH_KVM_VFIO_POSTING -->
>> __KVM_HAVE_ARCH_KVM_VFIO_POST
>>> * Add KVM_DEV_VFIO_DEVICE_UNPOST_IRQ attribute for VFIO irq, which
>>>   can be used to change back to remapping mode.
>>> * Fix typo
>>>
>>> v2:
>>> * Use VFIO framework to enable this feature, the VFIO part of this series is
>>>   base on Eric's patch "[PATCH v3 0/8] KVM-VFIO IRQ forward control"
>>> * Rebase this patchset on
>> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git,
>>>   then revise some irq logic based on the new hierarchy irqdomain patches
>> provided
>>>   by Jiang Liu <jiang.liu@linux.intel.com>
>>>
>>>
>>> *** BLURB HERE ***
>>>
>>> Alex Williamson (1):
>>>   virt: IRQ bypass manager
>>>
>>> Eric Auger (4):
>>>   KVM: arm/arm64: select IRQ_BYPASS_MANAGER
>>>   KVM: create kvm_irqfd.h
>>>   KVM: introduce kvm_arch functions for IRQ bypass
>>>   KVM: eventfd: add irq bypass consumer management
>>>
>>> Feng Wu (13):
>>>   KVM: x86: select IRQ_BYPASS_MANAGER
>>>   KVM: Extend struct pi_desc for VT-d Posted-Interrupts
>>>   KVM: Add some helper functions for Posted-Interrupts
>>>   KVM: Define a new interface kvm_intr_is_single_vcpu()
>>>   KVM: Make struct kvm_irq_routing_table accessible
>>>   KVM: make kvm_set_msi_irq() public
>>>   vfio: Register/unregister irq_bypass_producer
>>>   KVM: x86: Update IRTE for posted-interrupts
>>>   KVM: Implement IRQ bypass consumer callbacks for x86
>>>   KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'
>>>   KVM: Update Posted-Interrupts Descriptor when vCPU is preempted
>>>   KVM: Update Posted-Interrupts Descriptor when vCPU is blocked
>>>   iommu/vt-d: Add a command line parameter for VT-d posted-interrupts
>>>
>>>  Documentation/kernel-parameters.txt   |   1 +
>>>  Documentation/virtual/kvm/locking.txt |  12 ++
>>>  MAINTAINERS                           |   7 +
>>>  arch/arm/kvm/Kconfig                  |   2 +
>>>  arch/arm/kvm/Makefile                 |   1 +
>>>  arch/arm64/kvm/Kconfig                |   2 +
>>>  arch/arm64/kvm/Makefile               |   1 +
>>>  arch/x86/include/asm/kvm_host.h       |  24 +++
>>>  arch/x86/kvm/Kconfig                  |   3 +
>>>  arch/x86/kvm/Makefile                 |   3 +
>>>  arch/x86/kvm/irq_comm.c               |  32 ++-
>>>  arch/x86/kvm/lapic.c                  |  59 ++++++
>>>  arch/x86/kvm/lapic.h                  |   2 +
>>>  arch/x86/kvm/trace.h                  |  33 ++++
>>>  arch/x86/kvm/vmx.c                    | 361
>> +++++++++++++++++++++++++++++++++-
>>>  arch/x86/kvm/x86.c                    | 108 +++++++++-
>>>  drivers/iommu/irq_remapping.c         |  12 +-
>>>  drivers/vfio/pci/Kconfig              |   1 +
>>>  drivers/vfio/pci/vfio_pci_intrs.c     |   9 +
>>>  drivers/vfio/pci/vfio_pci_private.h   |   2 +
>>>  include/linux/irqbypass.h             |  90 +++++++++
>>>  include/linux/kvm_host.h              |  29 +++
>>>  include/linux/kvm_irqfd.h             |  71 +++++++
>>>  virt/kvm/Kconfig                      |   3 +
>>>  virt/kvm/eventfd.c                    | 142 +++++++------
>>>  virt/kvm/irqchip.c                    |  10 -
>>>  virt/kvm/kvm_main.c                   |   3 +
>>>  virt/lib/Kconfig                      |   2 +
>>>  virt/lib/Makefile                     |   1 +
>>>  virt/lib/irqbypass.c                  | 257
>> ++++++++++++++++++++++++
>>>  30 files changed, 1182 insertions(+), 101 deletions(-)
>>>  create mode 100644 include/linux/irqbypass.h
>>>  create mode 100644 include/linux/kvm_irqfd.h
>>>  create mode 100644 virt/lib/Kconfig
>>>  create mode 100644 virt/lib/Makefile
>>>  create mode 100644 virt/lib/irqbypass.c
>>>
--
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/

[toc] | [prev] | [next] | [standalone]


#1228066 — RE: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series

From"Wu, Feng" <feng.wu@intel.com>
Date2015-09-18 17:40 +0200
SubjectRE: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series
Message-ID<qa5Vv-6Jf-3@gated-at.bofh.it>
In reply to#1228059

> -----Original Message-----
> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> Sent: Friday, September 18, 2015 11:21 PM
> To: Wu, Feng; alex.williamson@redhat.com; joro@8bytes.org;
> mtosatti@redhat.com
> Cc: eric.auger@linaro.org; kvm@vger.kernel.org;
> iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org
> Subject: Re: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including
> prerequisite series
> 
> 
> 
> On 18/09/2015 17:08, Wu, Feng wrote:
> >
> >
> >> -----Original Message-----
> >> From: Paolo Bonzini [mailto:pbonzini@redhat.com]
> >> Sent: Friday, September 18, 2015 10:59 PM
> >> To: Wu, Feng; alex.williamson@redhat.com; joro@8bytes.org;
> >> mtosatti@redhat.com
> >> Cc: eric.auger@linaro.org; kvm@vger.kernel.org;
> >> iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org
> >> Subject: Re: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including
> >> prerequisite series
> >>
> >>
> >>
> >> On 18/09/2015 16:29, Feng Wu wrote:
> >>> VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt.
> >>> With VT-d Posted-Interrupts enabled, external interrupts from
> >>> direct-assigned devices can be delivered to guests without VMM
> >>> intervention when guest is running in non-root mode.
> >>>
> >>> You can find the VT-d Posted-Interrtups Spec. in the following URL:
> >>>
> >>
> http://www.intel.com/content/www/us/en/intelligent-systems/intel-technolog
> >> y/vt-directed-io-spec.html
> >>
> >> Thanks.  I will squash patches 2 and 14 together, and drop patch 3.
> >>
> >> Signed-off-bys are missing in patch 1 and 4.  The patches exist
> >> elsewhere in the mailing list archives, so not a big deal.  Or just
> >> reply to them with the S-o-b line.
> >>
> >
> > Thanks for your quick response, Paolo! I didn't change the code
> > in patch 1 and 4, do I need to add s-o-b, if needed, I can reply
> > the patches.
> 
> Yes, the s-o-b just means that the code passed through your hands.

Done.
> 
> Note that I replied to patch 17, but no need to resend that one
> either---just mailing list discussion is enough.

Do you mean you replied to patch 17 just now, but I don't find your replies
in the mailing list.

Thanks,
Feng

> 
> Paolo
> 
> > Thanks,
> > Feng
> >
> >> Alex, can you ack the series and review patch 12?
> >>
> >> Joerg, can you ack patch 18?
> >>
> >> Paolo
> >>
> >>> v9:
> >>> - Include the whole series:
> >>> [01/18]: irq bypasser manager
> >>> [02/18] - [06/18]: Common non-architecture part for VT-d PI and ARM side
> >> forwarded irq
> >>> [07/18] - [18/18]: VT-d PI part
> >>>
> >>> v8:
> >>> refer to the changelog in each patch
> >>>
> >>> v7:
> >>> * Define two weak irq bypass callbacks:
> >>>   - kvm_arch_irq_bypass_start()
> >>>   - kvm_arch_irq_bypass_stop()
> >>> * Remove the x86 dummy implementation of the above two functions.
> >>> * Print some useful information instead of WARN_ON() when the
> >>>   irq bypass consumer unregistration fails.
> >>> * Fix an issue when calling pi_pre_block and pi_post_block.
> >>>
> >>> v6:
> >>> * Rebase on 4.2.0-rc6
> >>> * Rebase on https://lkml.org/lkml/2015/8/6/526 and
> >> http://www.gossamer-threads.com/lists/linux/kernel/2235623
> >>> * Make the add_consumer and del_consumer callbacks static
> >>> * Remove pointless INIT_LIST_HEAD to 'vdev->ctx[vector].producer.node)'
> >>> * Use dev_info instead of WARN_ON() when irq_bypass_register_producer
> >> fails
> >>> * Remove optional dummy callbacks for irq producer
> >>>
> >>> v4:
> >>> * For lowest-priority interrupt, only support single-CPU destination
> >>> interrupts at the current stage, more common lowest priority support
> >>> will be added later.
> >>> * Accoring to Marcelo's suggestion, when vCPU is blocked, we handle
> >>> the posted-interrupts in the HLT emulation path.
> >>> * Some small changes (coding style, typo, add some code comments)
> >>>
> >>> v3:
> >>> * Adjust the Posted-interrupts Descriptor updating logic when vCPU is
> >>>   preempted or blocked.
> >>> * KVM_DEV_VFIO_DEVICE_POSTING_IRQ -->
> >> KVM_DEV_VFIO_DEVICE_POST_IRQ
> >>> * __KVM_HAVE_ARCH_KVM_VFIO_POSTING -->
> >> __KVM_HAVE_ARCH_KVM_VFIO_POST
> >>> * Add KVM_DEV_VFIO_DEVICE_UNPOST_IRQ attribute for VFIO irq, which
> >>>   can be used to change back to remapping mode.
> >>> * Fix typo
> >>>
> >>> v2:
> >>> * Use VFIO framework to enable this feature, the VFIO part of this series is
> >>>   base on Eric's patch "[PATCH v3 0/8] KVM-VFIO IRQ forward control"
> >>> * Rebase this patchset on
> >> git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git,
> >>>   then revise some irq logic based on the new hierarchy irqdomain
> patches
> >> provided
> >>>   by Jiang Liu <jiang.liu@linux.intel.com>
> >>>
> >>>
> >>> *** BLURB HERE ***
> >>>
> >>> Alex Williamson (1):
> >>>   virt: IRQ bypass manager
> >>>
> >>> Eric Auger (4):
> >>>   KVM: arm/arm64: select IRQ_BYPASS_MANAGER
> >>>   KVM: create kvm_irqfd.h
> >>>   KVM: introduce kvm_arch functions for IRQ bypass
> >>>   KVM: eventfd: add irq bypass consumer management
> >>>
> >>> Feng Wu (13):
> >>>   KVM: x86: select IRQ_BYPASS_MANAGER
> >>>   KVM: Extend struct pi_desc for VT-d Posted-Interrupts
> >>>   KVM: Add some helper functions for Posted-Interrupts
> >>>   KVM: Define a new interface kvm_intr_is_single_vcpu()
> >>>   KVM: Make struct kvm_irq_routing_table accessible
> >>>   KVM: make kvm_set_msi_irq() public
> >>>   vfio: Register/unregister irq_bypass_producer
> >>>   KVM: x86: Update IRTE for posted-interrupts
> >>>   KVM: Implement IRQ bypass consumer callbacks for x86
> >>>   KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'
> >>>   KVM: Update Posted-Interrupts Descriptor when vCPU is preempted
> >>>   KVM: Update Posted-Interrupts Descriptor when vCPU is blocked
> >>>   iommu/vt-d: Add a command line parameter for VT-d posted-interrupts
> >>>
> >>>  Documentation/kernel-parameters.txt   |   1 +
> >>>  Documentation/virtual/kvm/locking.txt |  12 ++
> >>>  MAINTAINERS                           |   7 +
> >>>  arch/arm/kvm/Kconfig                  |   2 +
> >>>  arch/arm/kvm/Makefile                 |   1 +
> >>>  arch/arm64/kvm/Kconfig                |   2 +
> >>>  arch/arm64/kvm/Makefile               |   1 +
> >>>  arch/x86/include/asm/kvm_host.h       |  24 +++
> >>>  arch/x86/kvm/Kconfig                  |   3 +
> >>>  arch/x86/kvm/Makefile                 |   3 +
> >>>  arch/x86/kvm/irq_comm.c               |  32 ++-
> >>>  arch/x86/kvm/lapic.c                  |  59 ++++++
> >>>  arch/x86/kvm/lapic.h                  |   2 +
> >>>  arch/x86/kvm/trace.h                  |  33 ++++
> >>>  arch/x86/kvm/vmx.c                    | 361
> >> +++++++++++++++++++++++++++++++++-
> >>>  arch/x86/kvm/x86.c                    | 108 +++++++++-
> >>>  drivers/iommu/irq_remapping.c         |  12 +-
> >>>  drivers/vfio/pci/Kconfig              |   1 +
> >>>  drivers/vfio/pci/vfio_pci_intrs.c     |   9 +
> >>>  drivers/vfio/pci/vfio_pci_private.h   |   2 +
> >>>  include/linux/irqbypass.h             |  90 +++++++++
> >>>  include/linux/kvm_host.h              |  29 +++
> >>>  include/linux/kvm_irqfd.h             |  71 +++++++
> >>>  virt/kvm/Kconfig                      |   3 +
> >>>  virt/kvm/eventfd.c                    | 142 +++++++------
> >>>  virt/kvm/irqchip.c                    |  10 -
> >>>  virt/kvm/kvm_main.c                   |   3 +
> >>>  virt/lib/Kconfig                      |   2 +
> >>>  virt/lib/Makefile                     |   1 +
> >>>  virt/lib/irqbypass.c                  | 257
> >> ++++++++++++++++++++++++
> >>>  30 files changed, 1182 insertions(+), 101 deletions(-)
> >>>  create mode 100644 include/linux/irqbypass.h
> >>>  create mode 100644 include/linux/kvm_irqfd.h
> >>>  create mode 100644 virt/lib/Kconfig
> >>>  create mode 100644 virt/lib/Makefile
> >>>  create mode 100644 virt/lib/irqbypass.c
> >>>
--
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/

[toc] | [prev] | [next] | [standalone]


#1228212 — Re: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series

FromAlex Williamson <alex.williamson@redhat.com>
Date2015-09-18 20:00 +0200
SubjectRe: [PATCH v9 00/18] Add VT-d Posted-Interrupts support - including prerequisite series
Message-ID<qa870-1k0-9@gated-at.bofh.it>
In reply to#1227962
On Fri, 2015-09-18 at 16:58 +0200, Paolo Bonzini wrote:
> 
> On 18/09/2015 16:29, Feng Wu wrote:
> > VT-d Posted-Interrupts is an enhancement to CPU side Posted-Interrupt.
> > With VT-d Posted-Interrupts enabled, external interrupts from
> > direct-assigned devices can be delivered to guests without VMM
> > intervention when guest is running in non-root mode.
> > 
> > You can find the VT-d Posted-Interrtups Spec. in the following URL:
> > http://www.intel.com/content/www/us/en/intelligent-systems/intel-technology/vt-directed-io-spec.html
> 
> Thanks.  I will squash patches 2 and 14 together, and drop patch 3.
> 
> Signed-off-bys are missing in patch 1 and 4.  The patches exist
> elsewhere in the mailing list archives, so not a big deal.  Or just
> reply to them with the S-o-b line.
> 
> Alex, can you ack the series and review patch 12?

I sent an ack for 12 separately, I got a bit lost in 16 & 17, but for
all the others that don't already have some tag from me,

Reviewed-by: Alex Williamson <alex.williamson@redhat.com>

> 
> Joerg, can you ack patch 18?
> 
> Paolo
> 
> > v9:
> > - Include the whole series:
> > [01/18]: irq bypasser manager
> > [02/18] - [06/18]: Common non-architecture part for VT-d PI and ARM side forwarded irq
> > [07/18] - [18/18]: VT-d PI part
> > 
> > v8:
> > refer to the changelog in each patch
> > 
> > v7:
> > * Define two weak irq bypass callbacks:
> >   - kvm_arch_irq_bypass_start()
> >   - kvm_arch_irq_bypass_stop()
> > * Remove the x86 dummy implementation of the above two functions.
> > * Print some useful information instead of WARN_ON() when the
> >   irq bypass consumer unregistration fails.
> > * Fix an issue when calling pi_pre_block and pi_post_block.
> > 
> > v6:
> > * Rebase on 4.2.0-rc6
> > * Rebase on https://lkml.org/lkml/2015/8/6/526 and http://www.gossamer-threads.com/lists/linux/kernel/2235623
> > * Make the add_consumer and del_consumer callbacks static
> > * Remove pointless INIT_LIST_HEAD to 'vdev->ctx[vector].producer.node)'
> > * Use dev_info instead of WARN_ON() when irq_bypass_register_producer fails
> > * Remove optional dummy callbacks for irq producer
> > 
> > v4:
> > * For lowest-priority interrupt, only support single-CPU destination
> > interrupts at the current stage, more common lowest priority support
> > will be added later.
> > * Accoring to Marcelo's suggestion, when vCPU is blocked, we handle
> > the posted-interrupts in the HLT emulation path.
> > * Some small changes (coding style, typo, add some code comments)
> > 
> > v3:
> > * Adjust the Posted-interrupts Descriptor updating logic when vCPU is
> >   preempted or blocked.
> > * KVM_DEV_VFIO_DEVICE_POSTING_IRQ --> KVM_DEV_VFIO_DEVICE_POST_IRQ
> > * __KVM_HAVE_ARCH_KVM_VFIO_POSTING --> __KVM_HAVE_ARCH_KVM_VFIO_POST
> > * Add KVM_DEV_VFIO_DEVICE_UNPOST_IRQ attribute for VFIO irq, which
> >   can be used to change back to remapping mode.
> > * Fix typo
> > 
> > v2:
> > * Use VFIO framework to enable this feature, the VFIO part of this series is
> >   base on Eric's patch "[PATCH v3 0/8] KVM-VFIO IRQ forward control"
> > * Rebase this patchset on git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git,
> >   then revise some irq logic based on the new hierarchy irqdomain patches provided
> >   by Jiang Liu <jiang.liu@linux.intel.com>
> > 
> > 
> > *** BLURB HERE ***
> > 
> > Alex Williamson (1):
> >   virt: IRQ bypass manager
> > 
> > Eric Auger (4):
> >   KVM: arm/arm64: select IRQ_BYPASS_MANAGER
> >   KVM: create kvm_irqfd.h
> >   KVM: introduce kvm_arch functions for IRQ bypass
> >   KVM: eventfd: add irq bypass consumer management
> > 
> > Feng Wu (13):
> >   KVM: x86: select IRQ_BYPASS_MANAGER
> >   KVM: Extend struct pi_desc for VT-d Posted-Interrupts
> >   KVM: Add some helper functions for Posted-Interrupts
> >   KVM: Define a new interface kvm_intr_is_single_vcpu()
> >   KVM: Make struct kvm_irq_routing_table accessible
> >   KVM: make kvm_set_msi_irq() public
> >   vfio: Register/unregister irq_bypass_producer
> >   KVM: x86: Update IRTE for posted-interrupts
> >   KVM: Implement IRQ bypass consumer callbacks for x86
> >   KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'
> >   KVM: Update Posted-Interrupts Descriptor when vCPU is preempted
> >   KVM: Update Posted-Interrupts Descriptor when vCPU is blocked
> >   iommu/vt-d: Add a command line parameter for VT-d posted-interrupts
> > 
> >  Documentation/kernel-parameters.txt   |   1 +
> >  Documentation/virtual/kvm/locking.txt |  12 ++
> >  MAINTAINERS                           |   7 +
> >  arch/arm/kvm/Kconfig                  |   2 +
> >  arch/arm/kvm/Makefile                 |   1 +
> >  arch/arm64/kvm/Kconfig                |   2 +
> >  arch/arm64/kvm/Makefile               |   1 +
> >  arch/x86/include/asm/kvm_host.h       |  24 +++
> >  arch/x86/kvm/Kconfig                  |   3 +
> >  arch/x86/kvm/Makefile                 |   3 +
> >  arch/x86/kvm/irq_comm.c               |  32 ++-
> >  arch/x86/kvm/lapic.c                  |  59 ++++++
> >  arch/x86/kvm/lapic.h                  |   2 +
> >  arch/x86/kvm/trace.h                  |  33 ++++
> >  arch/x86/kvm/vmx.c                    | 361 +++++++++++++++++++++++++++++++++-
> >  arch/x86/kvm/x86.c                    | 108 +++++++++-
> >  drivers/iommu/irq_remapping.c         |  12 +-
> >  drivers/vfio/pci/Kconfig              |   1 +
> >  drivers/vfio/pci/vfio_pci_intrs.c     |   9 +
> >  drivers/vfio/pci/vfio_pci_private.h   |   2 +
> >  include/linux/irqbypass.h             |  90 +++++++++
> >  include/linux/kvm_host.h              |  29 +++
> >  include/linux/kvm_irqfd.h             |  71 +++++++
> >  virt/kvm/Kconfig                      |   3 +
> >  virt/kvm/eventfd.c                    | 142 +++++++------
> >  virt/kvm/irqchip.c                    |  10 -
> >  virt/kvm/kvm_main.c                   |   3 +
> >  virt/lib/Kconfig                      |   2 +
> >  virt/lib/Makefile                     |   1 +
> >  virt/lib/irqbypass.c                  | 257 ++++++++++++++++++++++++
> >  30 files changed, 1182 insertions(+), 101 deletions(-)
> >  create mode 100644 include/linux/irqbypass.h
> >  create mode 100644 include/linux/kvm_irqfd.h
> >  create mode 100644 virt/lib/Kconfig
> >  create mode 100644 virt/lib/Makefile
> >  create mode 100644 virt/lib/irqbypass.c
> > 



--
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/

[toc] | [prev] | [next] | [standalone]


#1227971 — [PATCH v9 04/18] KVM: create kvm_irqfd.h

FromFeng Wu <feng.wu@intel.com>
Date2015-09-18 17:00 +0200
Subject[PATCH v9 04/18] KVM: create kvm_irqfd.h
Message-ID<qa5iP-5JO-37@gated-at.bofh.it>
In reply to#1227957
From: Eric Auger <eric.auger@linaro.org>

Move _irqfd_resampler and _irqfd struct declarations in a new
public header: kvm_irqfd.h. They are respectively renamed into
kvm_kernel_irqfd_resampler and kvm_kernel_irqfd. Those datatypes
will be used by architecture specific code, in the context of
IRQ bypass manager integration.

Signed-off-by: Eric Auger <eric.auger@linaro.org>
---
 include/linux/kvm_irqfd.h | 69 ++++++++++++++++++++++++++++++++++
 virt/kvm/eventfd.c        | 95 ++++++++++++-----------------------------------
 2 files changed, 92 insertions(+), 72 deletions(-)
 create mode 100644 include/linux/kvm_irqfd.h

diff --git a/include/linux/kvm_irqfd.h b/include/linux/kvm_irqfd.h
new file mode 100644
index 0000000..f926b39
--- /dev/null
+++ b/include/linux/kvm_irqfd.h
@@ -0,0 +1,69 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * irqfd: Allows an fd to be used to inject an interrupt to the guest
+ * Credit goes to Avi Kivity for the original idea.
+ */
+
+#ifndef __LINUX_KVM_IRQFD_H
+#define __LINUX_KVM_IRQFD_H
+
+#include <linux/kvm_host.h>
+#include <linux/poll.h>
+
+/*
+ * Resampling irqfds are a special variety of irqfds used to emulate
+ * level triggered interrupts.  The interrupt is asserted on eventfd
+ * trigger.  On acknowledgment through the irq ack notifier, the
+ * interrupt is de-asserted and userspace is notified through the
+ * resamplefd.  All resamplers on the same gsi are de-asserted
+ * together, so we don't need to track the state of each individual
+ * user.  We can also therefore share the same irq source ID.
+ */
+struct kvm_kernel_irqfd_resampler {
+	struct kvm *kvm;
+	/*
+	 * List of resampling struct _irqfd objects sharing this gsi.
+	 * RCU list modified under kvm->irqfds.resampler_lock
+	 */
+	struct list_head list;
+	struct kvm_irq_ack_notifier notifier;
+	/*
+	 * Entry in list of kvm->irqfd.resampler_list.  Use for sharing
+	 * resamplers among irqfds on the same gsi.
+	 * Accessed and modified under kvm->irqfds.resampler_lock
+	 */
+	struct list_head link;
+};
+
+struct kvm_kernel_irqfd {
+	/* Used for MSI fast-path */
+	struct kvm *kvm;
+	wait_queue_t wait;
+	/* Update side is protected by irqfds.lock */
+	struct kvm_kernel_irq_routing_entry irq_entry;
+	seqcount_t irq_entry_sc;
+	/* Used for level IRQ fast-path */
+	int gsi;
+	struct work_struct inject;
+	/* The resampler used by this irqfd (resampler-only) */
+	struct kvm_kernel_irqfd_resampler *resampler;
+	/* Eventfd notified on resample (resampler-only) */
+	struct eventfd_ctx *resamplefd;
+	/* Entry in list of irqfds for a resampler (resampler-only) */
+	struct list_head resampler_link;
+	/* Used for setup/shutdown */
+	struct eventfd_ctx *eventfd;
+	struct list_head list;
+	poll_table pt;
+	struct work_struct shutdown;
+};
+
+#endif /* __LINUX_KVM_IRQFD_H */
diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
index 9ff4193..647ffb8 100644
--- a/virt/kvm/eventfd.c
+++ b/virt/kvm/eventfd.c
@@ -23,6 +23,7 @@
 
 #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>
@@ -39,68 +40,14 @@
 #include <kvm/iodev.h>
 
 #ifdef CONFIG_HAVE_KVM_IRQFD
-/*
- * --------------------------------------------------------------------
- * irqfd: Allows an fd to be used to inject an interrupt to the guest
- *
- * Credit goes to Avi Kivity for the original idea.
- * --------------------------------------------------------------------
- */
-
-/*
- * Resampling irqfds are a special variety of irqfds used to emulate
- * level triggered interrupts.  The interrupt is asserted on eventfd
- * trigger.  On acknowledgement through the irq ack notifier, the
- * interrupt is de-asserted and userspace is notified through the
- * resamplefd.  All resamplers on the same gsi are de-asserted
- * together, so we don't need to track the state of each individual
- * user.  We can also therefore share the same irq source ID.
- */
-struct _irqfd_resampler {
-	struct kvm *kvm;
-	/*
-	 * List of resampling struct _irqfd objects sharing this gsi.
-	 * RCU list modified under kvm->irqfds.resampler_lock
-	 */
-	struct list_head list;
-	struct kvm_irq_ack_notifier notifier;
-	/*
-	 * Entry in list of kvm->irqfd.resampler_list.  Use for sharing
-	 * resamplers among irqfds on the same gsi.
-	 * Accessed and modified under kvm->irqfds.resampler_lock
-	 */
-	struct list_head link;
-};
-
-struct _irqfd {
-	/* Used for MSI fast-path */
-	struct kvm *kvm;
-	wait_queue_t wait;
-	/* Update side is protected by irqfds.lock */
-	struct kvm_kernel_irq_routing_entry irq_entry;
-	seqcount_t irq_entry_sc;
-	/* Used for level IRQ fast-path */
-	int gsi;
-	struct work_struct inject;
-	/* The resampler used by this irqfd (resampler-only) */
-	struct _irqfd_resampler *resampler;
-	/* Eventfd notified on resample (resampler-only) */
-	struct eventfd_ctx *resamplefd;
-	/* Entry in list of irqfds for a resampler (resampler-only) */
-	struct list_head resampler_link;
-	/* Used for setup/shutdown */
-	struct eventfd_ctx *eventfd;
-	struct list_head list;
-	poll_table pt;
-	struct work_struct shutdown;
-};
 
 static struct workqueue_struct *irqfd_cleanup_wq;
 
 static void
 irqfd_inject(struct work_struct *work)
 {
-	struct _irqfd *irqfd = container_of(work, struct _irqfd, inject);
+	struct kvm_kernel_irqfd *irqfd =
+		container_of(work, struct kvm_kernel_irqfd, inject);
 	struct kvm *kvm = irqfd->kvm;
 
 	if (!irqfd->resampler) {
@@ -121,12 +68,13 @@ irqfd_inject(struct work_struct *work)
 static void
 irqfd_resampler_ack(struct kvm_irq_ack_notifier *kian)
 {
-	struct _irqfd_resampler *resampler;
+	struct kvm_kernel_irqfd_resampler *resampler;
 	struct kvm *kvm;
-	struct _irqfd *irqfd;
+	struct kvm_kernel_irqfd *irqfd;
 	int idx;
 
-	resampler = container_of(kian, struct _irqfd_resampler, notifier);
+	resampler = container_of(kian,
+			struct kvm_kernel_irqfd_resampler, notifier);
 	kvm = resampler->kvm;
 
 	kvm_set_irq(kvm, KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID,
@@ -141,9 +89,9 @@ irqfd_resampler_ack(struct kvm_irq_ack_notifier *kian)
 }
 
 static void
-irqfd_resampler_shutdown(struct _irqfd *irqfd)
+irqfd_resampler_shutdown(struct kvm_kernel_irqfd *irqfd)
 {
-	struct _irqfd_resampler *resampler = irqfd->resampler;
+	struct kvm_kernel_irqfd_resampler *resampler = irqfd->resampler;
 	struct kvm *kvm = resampler->kvm;
 
 	mutex_lock(&kvm->irqfds.resampler_lock);
@@ -168,7 +116,8 @@ irqfd_resampler_shutdown(struct _irqfd *irqfd)
 static void
 irqfd_shutdown(struct work_struct *work)
 {
-	struct _irqfd *irqfd = container_of(work, struct _irqfd, shutdown);
+	struct kvm_kernel_irqfd *irqfd =
+		container_of(work, struct kvm_kernel_irqfd, shutdown);
 	u64 cnt;
 
 	/*
@@ -198,7 +147,7 @@ irqfd_shutdown(struct work_struct *work)
 
 /* assumes kvm->irqfds.lock is held */
 static bool
-irqfd_is_active(struct _irqfd *irqfd)
+irqfd_is_active(struct kvm_kernel_irqfd *irqfd)
 {
 	return list_empty(&irqfd->list) ? false : true;
 }
@@ -209,7 +158,7 @@ irqfd_is_active(struct _irqfd *irqfd)
  * assumes kvm->irqfds.lock is held
  */
 static void
-irqfd_deactivate(struct _irqfd *irqfd)
+irqfd_deactivate(struct kvm_kernel_irqfd *irqfd)
 {
 	BUG_ON(!irqfd_is_active(irqfd));
 
@@ -224,7 +173,8 @@ irqfd_deactivate(struct _irqfd *irqfd)
 static int
 irqfd_wakeup(wait_queue_t *wait, unsigned mode, int sync, void *key)
 {
-	struct _irqfd *irqfd = container_of(wait, struct _irqfd, wait);
+	struct kvm_kernel_irqfd *irqfd =
+		container_of(wait, struct kvm_kernel_irqfd, wait);
 	unsigned long flags = (unsigned long)key;
 	struct kvm_kernel_irq_routing_entry irq;
 	struct kvm *kvm = irqfd->kvm;
@@ -274,12 +224,13 @@ static void
 irqfd_ptable_queue_proc(struct file *file, wait_queue_head_t *wqh,
 			poll_table *pt)
 {
-	struct _irqfd *irqfd = container_of(pt, struct _irqfd, pt);
+	struct kvm_kernel_irqfd *irqfd =
+		container_of(pt, struct kvm_kernel_irqfd, pt);
 	add_wait_queue(wqh, &irqfd->wait);
 }
 
 /* Must be called under irqfds.lock */
-static void irqfd_update(struct kvm *kvm, struct _irqfd *irqfd)
+static void irqfd_update(struct kvm *kvm, struct kvm_kernel_irqfd *irqfd)
 {
 	struct kvm_kernel_irq_routing_entry *e;
 	struct kvm_kernel_irq_routing_entry entries[KVM_NR_IRQCHIPS];
@@ -304,7 +255,7 @@ static void irqfd_update(struct kvm *kvm, struct _irqfd *irqfd)
 static int
 kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
 {
-	struct _irqfd *irqfd, *tmp;
+	struct kvm_kernel_irqfd *irqfd, *tmp;
 	struct fd f;
 	struct eventfd_ctx *eventfd = NULL, *resamplefd = NULL;
 	int ret;
@@ -340,7 +291,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
 	irqfd->eventfd = eventfd;
 
 	if (args->flags & KVM_IRQFD_FLAG_RESAMPLE) {
-		struct _irqfd_resampler *resampler;
+		struct kvm_kernel_irqfd_resampler *resampler;
 
 		resamplefd = eventfd_ctx_fdget(args->resamplefd);
 		if (IS_ERR(resamplefd)) {
@@ -525,7 +476,7 @@ kvm_eventfd_init(struct kvm *kvm)
 static int
 kvm_irqfd_deassign(struct kvm *kvm, struct kvm_irqfd *args)
 {
-	struct _irqfd *irqfd, *tmp;
+	struct kvm_kernel_irqfd *irqfd, *tmp;
 	struct eventfd_ctx *eventfd;
 
 	eventfd = eventfd_ctx_fdget(args->fd);
@@ -581,7 +532,7 @@ kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args)
 void
 kvm_irqfd_release(struct kvm *kvm)
 {
-	struct _irqfd *irqfd, *tmp;
+	struct kvm_kernel_irqfd *irqfd, *tmp;
 
 	spin_lock_irq(&kvm->irqfds.lock);
 
@@ -604,7 +555,7 @@ kvm_irqfd_release(struct kvm *kvm)
  */
 void kvm_irq_routing_update(struct kvm *kvm)
 {
-	struct _irqfd *irqfd;
+	struct kvm_kernel_irqfd *irqfd;
 
 	spin_lock_irq(&kvm->irqfds.lock);
 
-- 
2.1.0

--
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/

[toc] | [prev] | [next] | [standalone]


#1228075 — RE: [PATCH v9 04/18] KVM: create kvm_irqfd.h

From"Wu, Feng" <feng.wu@intel.com>
Date2015-09-18 17:40 +0200
SubjectRE: [PATCH v9 04/18] KVM: create kvm_irqfd.h
Message-ID<qa5Vw-6Jf-29@gated-at.bofh.it>
In reply to#1227971
Signed-off-by: Feng Wu <feng.wu@intel.com>

> -----Original Message-----
> From: iommu-bounces@lists.linux-foundation.org
> [mailto:iommu-bounces@lists.linux-foundation.org] On Behalf Of Feng Wu
> Sent: Friday, September 18, 2015 10:30 PM
> To: pbonzini@redhat.com; alex.williamson@redhat.com; joro@8bytes.org;
> mtosatti@redhat.com
> Cc: iommu@lists.linux-foundation.org; linux-kernel@vger.kernel.org;
> kvm@vger.kernel.org; eric.auger@linaro.org
> Subject: [PATCH v9 04/18] KVM: create kvm_irqfd.h
> 
> From: Eric Auger <eric.auger@linaro.org>
> 
> Move _irqfd_resampler and _irqfd struct declarations in a new
> public header: kvm_irqfd.h. They are respectively renamed into
> kvm_kernel_irqfd_resampler and kvm_kernel_irqfd. Those datatypes
> will be used by architecture specific code, in the context of
> IRQ bypass manager integration.
> 
> Signed-off-by: Eric Auger <eric.auger@linaro.org>
> ---
>  include/linux/kvm_irqfd.h | 69 ++++++++++++++++++++++++++++++++++
>  virt/kvm/eventfd.c        | 95 ++++++++++++-----------------------------------
>  2 files changed, 92 insertions(+), 72 deletions(-)
>  create mode 100644 include/linux/kvm_irqfd.h
> 
> diff --git a/include/linux/kvm_irqfd.h b/include/linux/kvm_irqfd.h
> new file mode 100644
> index 0000000..f926b39
> --- /dev/null
> +++ b/include/linux/kvm_irqfd.h
> @@ -0,0 +1,69 @@
> +/*
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * irqfd: Allows an fd to be used to inject an interrupt to the guest
> + * Credit goes to Avi Kivity for the original idea.
> + */
> +
> +#ifndef __LINUX_KVM_IRQFD_H
> +#define __LINUX_KVM_IRQFD_H
> +
> +#include <linux/kvm_host.h>
> +#include <linux/poll.h>
> +
> +/*
> + * Resampling irqfds are a special variety of irqfds used to emulate
> + * level triggered interrupts.  The interrupt is asserted on eventfd
> + * trigger.  On acknowledgment through the irq ack notifier, the
> + * interrupt is de-asserted and userspace is notified through the
> + * resamplefd.  All resamplers on the same gsi are de-asserted
> + * together, so we don't need to track the state of each individual
> + * user.  We can also therefore share the same irq source ID.
> + */
> +struct kvm_kernel_irqfd_resampler {
> +	struct kvm *kvm;
> +	/*
> +	 * List of resampling struct _irqfd objects sharing this gsi.
> +	 * RCU list modified under kvm->irqfds.resampler_lock
> +	 */
> +	struct list_head list;
> +	struct kvm_irq_ack_notifier notifier;
> +	/*
> +	 * Entry in list of kvm->irqfd.resampler_list.  Use for sharing
> +	 * resamplers among irqfds on the same gsi.
> +	 * Accessed and modified under kvm->irqfds.resampler_lock
> +	 */
> +	struct list_head link;
> +};
> +
> +struct kvm_kernel_irqfd {
> +	/* Used for MSI fast-path */
> +	struct kvm *kvm;
> +	wait_queue_t wait;
> +	/* Update side is protected by irqfds.lock */
> +	struct kvm_kernel_irq_routing_entry irq_entry;
> +	seqcount_t irq_entry_sc;
> +	/* Used for level IRQ fast-path */
> +	int gsi;
> +	struct work_struct inject;
> +	/* The resampler used by this irqfd (resampler-only) */
> +	struct kvm_kernel_irqfd_resampler *resampler;
> +	/* Eventfd notified on resample (resampler-only) */
> +	struct eventfd_ctx *resamplefd;
> +	/* Entry in list of irqfds for a resampler (resampler-only) */
> +	struct list_head resampler_link;
> +	/* Used for setup/shutdown */
> +	struct eventfd_ctx *eventfd;
> +	struct list_head list;
> +	poll_table pt;
> +	struct work_struct shutdown;
> +};
> +
> +#endif /* __LINUX_KVM_IRQFD_H */
> diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c
> index 9ff4193..647ffb8 100644
> --- a/virt/kvm/eventfd.c
> +++ b/virt/kvm/eventfd.c
> @@ -23,6 +23,7 @@
> 
>  #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>
> @@ -39,68 +40,14 @@
>  #include <kvm/iodev.h>
> 
>  #ifdef CONFIG_HAVE_KVM_IRQFD
> -/*
> - * --------------------------------------------------------------------
> - * irqfd: Allows an fd to be used to inject an interrupt to the guest
> - *
> - * Credit goes to Avi Kivity for the original idea.
> - * --------------------------------------------------------------------
> - */
> -
> -/*
> - * Resampling irqfds are a special variety of irqfds used to emulate
> - * level triggered interrupts.  The interrupt is asserted on eventfd
> - * trigger.  On acknowledgement through the irq ack notifier, the
> - * interrupt is de-asserted and userspace is notified through the
> - * resamplefd.  All resamplers on the same gsi are de-asserted
> - * together, so we don't need to track the state of each individual
> - * user.  We can also therefore share the same irq source ID.
> - */
> -struct _irqfd_resampler {
> -	struct kvm *kvm;
> -	/*
> -	 * List of resampling struct _irqfd objects sharing this gsi.
> -	 * RCU list modified under kvm->irqfds.resampler_lock
> -	 */
> -	struct list_head list;
> -	struct kvm_irq_ack_notifier notifier;
> -	/*
> -	 * Entry in list of kvm->irqfd.resampler_list.  Use for sharing
> -	 * resamplers among irqfds on the same gsi.
> -	 * Accessed and modified under kvm->irqfds.resampler_lock
> -	 */
> -	struct list_head link;
> -};
> -
> -struct _irqfd {
> -	/* Used for MSI fast-path */
> -	struct kvm *kvm;
> -	wait_queue_t wait;
> -	/* Update side is protected by irqfds.lock */
> -	struct kvm_kernel_irq_routing_entry irq_entry;
> -	seqcount_t irq_entry_sc;
> -	/* Used for level IRQ fast-path */
> -	int gsi;
> -	struct work_struct inject;
> -	/* The resampler used by this irqfd (resampler-only) */
> -	struct _irqfd_resampler *resampler;
> -	/* Eventfd notified on resample (resampler-only) */
> -	struct eventfd_ctx *resamplefd;
> -	/* Entry in list of irqfds for a resampler (resampler-only) */
> -	struct list_head resampler_link;
> -	/* Used for setup/shutdown */
> -	struct eventfd_ctx *eventfd;
> -	struct list_head list;
> -	poll_table pt;
> -	struct work_struct shutdown;
> -};
> 
>  static struct workqueue_struct *irqfd_cleanup_wq;
> 
>  static void
>  irqfd_inject(struct work_struct *work)
>  {
> -	struct _irqfd *irqfd = container_of(work, struct _irqfd, inject);
> +	struct kvm_kernel_irqfd *irqfd =
> +		container_of(work, struct kvm_kernel_irqfd, inject);
>  	struct kvm *kvm = irqfd->kvm;
> 
>  	if (!irqfd->resampler) {
> @@ -121,12 +68,13 @@ irqfd_inject(struct work_struct *work)
>  static void
>  irqfd_resampler_ack(struct kvm_irq_ack_notifier *kian)
>  {
> -	struct _irqfd_resampler *resampler;
> +	struct kvm_kernel_irqfd_resampler *resampler;
>  	struct kvm *kvm;
> -	struct _irqfd *irqfd;
> +	struct kvm_kernel_irqfd *irqfd;
>  	int idx;
> 
> -	resampler = container_of(kian, struct _irqfd_resampler, notifier);
> +	resampler = container_of(kian,
> +			struct kvm_kernel_irqfd_resampler, notifier);
>  	kvm = resampler->kvm;
> 
>  	kvm_set_irq(kvm, KVM_IRQFD_RESAMPLE_IRQ_SOURCE_ID,
> @@ -141,9 +89,9 @@ irqfd_resampler_ack(struct kvm_irq_ack_notifier *kian)
>  }
> 
>  static void
> -irqfd_resampler_shutdown(struct _irqfd *irqfd)
> +irqfd_resampler_shutdown(struct kvm_kernel_irqfd *irqfd)
>  {
> -	struct _irqfd_resampler *resampler = irqfd->resampler;
> +	struct kvm_kernel_irqfd_resampler *resampler = irqfd->resampler;
>  	struct kvm *kvm = resampler->kvm;
> 
>  	mutex_lock(&kvm->irqfds.resampler_lock);
> @@ -168,7 +116,8 @@ irqfd_resampler_shutdown(struct _irqfd *irqfd)
>  static void
>  irqfd_shutdown(struct work_struct *work)
>  {
> -	struct _irqfd *irqfd = container_of(work, struct _irqfd, shutdown);
> +	struct kvm_kernel_irqfd *irqfd =
> +		container_of(work, struct kvm_kernel_irqfd, shutdown);
>  	u64 cnt;
> 
>  	/*
> @@ -198,7 +147,7 @@ irqfd_shutdown(struct work_struct *work)
> 
>  /* assumes kvm->irqfds.lock is held */
>  static bool
> -irqfd_is_active(struct _irqfd *irqfd)
> +irqfd_is_active(struct kvm_kernel_irqfd *irqfd)
>  {
>  	return list_empty(&irqfd->list) ? false : true;
>  }
> @@ -209,7 +158,7 @@ irqfd_is_active(struct _irqfd *irqfd)
>   * assumes kvm->irqfds.lock is held
>   */
>  static void
> -irqfd_deactivate(struct _irqfd *irqfd)
> +irqfd_deactivate(struct kvm_kernel_irqfd *irqfd)
>  {
>  	BUG_ON(!irqfd_is_active(irqfd));
> 
> @@ -224,7 +173,8 @@ irqfd_deactivate(struct _irqfd *irqfd)
>  static int
>  irqfd_wakeup(wait_queue_t *wait, unsigned mode, int sync, void *key)
>  {
> -	struct _irqfd *irqfd = container_of(wait, struct _irqfd, wait);
> +	struct kvm_kernel_irqfd *irqfd =
> +		container_of(wait, struct kvm_kernel_irqfd, wait);
>  	unsigned long flags = (unsigned long)key;
>  	struct kvm_kernel_irq_routing_entry irq;
>  	struct kvm *kvm = irqfd->kvm;
> @@ -274,12 +224,13 @@ static void
>  irqfd_ptable_queue_proc(struct file *file, wait_queue_head_t *wqh,
>  			poll_table *pt)
>  {
> -	struct _irqfd *irqfd = container_of(pt, struct _irqfd, pt);
> +	struct kvm_kernel_irqfd *irqfd =
> +		container_of(pt, struct kvm_kernel_irqfd, pt);
>  	add_wait_queue(wqh, &irqfd->wait);
>  }
> 
>  /* Must be called under irqfds.lock */
> -static void irqfd_update(struct kvm *kvm, struct _irqfd *irqfd)
> +static void irqfd_update(struct kvm *kvm, struct kvm_kernel_irqfd *irqfd)
>  {
>  	struct kvm_kernel_irq_routing_entry *e;
>  	struct kvm_kernel_irq_routing_entry entries[KVM_NR_IRQCHIPS];
> @@ -304,7 +255,7 @@ static void irqfd_update(struct kvm *kvm, struct _irqfd
> *irqfd)
>  static int
>  kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd *args)
>  {
> -	struct _irqfd *irqfd, *tmp;
> +	struct kvm_kernel_irqfd *irqfd, *tmp;
>  	struct fd f;
>  	struct eventfd_ctx *eventfd = NULL, *resamplefd = NULL;
>  	int ret;
> @@ -340,7 +291,7 @@ kvm_irqfd_assign(struct kvm *kvm, struct kvm_irqfd
> *args)
>  	irqfd->eventfd = eventfd;
> 
>  	if (args->flags & KVM_IRQFD_FLAG_RESAMPLE) {
> -		struct _irqfd_resampler *resampler;
> +		struct kvm_kernel_irqfd_resampler *resampler;
> 
>  		resamplefd = eventfd_ctx_fdget(args->resamplefd);
>  		if (IS_ERR(resamplefd)) {
> @@ -525,7 +476,7 @@ kvm_eventfd_init(struct kvm *kvm)
>  static int
>  kvm_irqfd_deassign(struct kvm *kvm, struct kvm_irqfd *args)
>  {
> -	struct _irqfd *irqfd, *tmp;
> +	struct kvm_kernel_irqfd *irqfd, *tmp;
>  	struct eventfd_ctx *eventfd;
> 
>  	eventfd = eventfd_ctx_fdget(args->fd);
> @@ -581,7 +532,7 @@ kvm_irqfd(struct kvm *kvm, struct kvm_irqfd *args)
>  void
>  kvm_irqfd_release(struct kvm *kvm)
>  {
> -	struct _irqfd *irqfd, *tmp;
> +	struct kvm_kernel_irqfd *irqfd, *tmp;
> 
>  	spin_lock_irq(&kvm->irqfds.lock);
> 
> @@ -604,7 +555,7 @@ kvm_irqfd_release(struct kvm *kvm)
>   */
>  void kvm_irq_routing_update(struct kvm *kvm)
>  {
> -	struct _irqfd *irqfd;
> +	struct kvm_kernel_irqfd *irqfd;
> 
>  	spin_lock_irq(&kvm->irqfds.lock);
> 
> --
> 2.1.0
> 
> _______________________________________________
> iommu mailing list
> iommu@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/iommu
--
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/

[toc] | [prev] | [next] | [standalone]


#1227981 — [PATCH v9 02/18] KVM: x86: select IRQ_BYPASS_MANAGER

FromFeng Wu <feng.wu@intel.com>
Date2015-09-18 17:00 +0200
Subject[PATCH v9 02/18] KVM: x86: select IRQ_BYPASS_MANAGER
Message-ID<qa5iQ-5JO-59@gated-at.bofh.it>
In reply to#1227957
Select IRQ_BYPASS_MANAGER for x86 when CONFIG_KVM is set

Signed-off-by: Feng Wu <feng.wu@intel.com>
---
 arch/x86/kvm/Kconfig  | 2 ++
 arch/x86/kvm/Makefile | 3 +++
 2 files changed, 5 insertions(+)

diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig
index d8a1d56..c951d44 100644
--- a/arch/x86/kvm/Kconfig
+++ b/arch/x86/kvm/Kconfig
@@ -3,6 +3,7 @@
 #
 
 source "virt/kvm/Kconfig"
+source "virt/lib/Kconfig"
 
 menuconfig VIRTUALIZATION
 	bool "Virtualization"
@@ -28,6 +29,7 @@ config KVM
 	select ANON_INODES
 	select HAVE_KVM_IRQCHIP
 	select HAVE_KVM_IRQFD
+	select IRQ_BYPASS_MANAGER
 	select HAVE_KVM_IRQ_ROUTING
 	select HAVE_KVM_EVENTFD
 	select KVM_APIC_ARCHITECTURE
diff --git a/arch/x86/kvm/Makefile b/arch/x86/kvm/Makefile
index 67d215c..05cc2d7 100644
--- a/arch/x86/kvm/Makefile
+++ b/arch/x86/kvm/Makefile
@@ -6,6 +6,9 @@ CFLAGS_svm.o := -I.
 CFLAGS_vmx.o := -I.
 
 KVM := ../../../virt/kvm
+LIB := ../../../virt/lib
+
+obj-$(CONFIG_IRQ_BYPASS_MANAGER)	+= $(LIB)/
 
 kvm-y			+= $(KVM)/kvm_main.o $(KVM)/coalesced_mmio.o \
 				$(KVM)/eventfd.o $(KVM)/irqchip.o $(KVM)/vfio.o
-- 
2.1.0

--
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/

[toc] | [prev] | [next] | [standalone]


#1227986 — [PATCH v9 05/18] KVM: introduce kvm_arch functions for IRQ bypass

FromFeng Wu <feng.wu@intel.com>
Date2015-09-18 17:00 +0200
Subject[PATCH v9 05/18] KVM: introduce kvm_arch functions for IRQ bypass
Message-ID<qa5iQ-5JO-67@gated-at.bofh.it>
In reply to#1227957
From: Eric Auger <eric.auger@linaro.org>

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 <eric.auger@linaro.org>
Signed-off-by: Feng Wu <feng.wu@intel.com>
---
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 <linux/err.h>
 #include <linux/irqflags.h>
 #include <linux/context_tracking.h>
+#include <linux/irqbypass.h>
 #include <asm/signal.h>
 
 #include <linux/kvm.h>
@@ -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
-- 
2.1.0

--
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/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web