[PATCH v2 0/2] Add vector-hashing support for lowest-priority interrupts delivery

2015-12-15 Thread Feng Wu
a module parameter to control the vector-hashing mechanism Feng Wu (2): KVM: x86: Use vector-hashing to deliver lowest-priority interrupts KVM: x86: Add lowest-priority support for vt-d posted-interrupts arch/x86/kvm/irq_comm.c | 27 +-- arch/x86/kvm/lapic.c| 124

[PATCH v2 2/2] KVM: x86: Add lowest-priority support for vt-d posted-interrupts

2015-12-15 Thread Feng Wu
Use vector-hashing to deliver lowest-priority interrupts for VT-d posted-interrupts. Signed-off-by: Feng Wu <feng...@intel.com> --- arch/x86/kvm/lapic.c | 67 arch/x86/kvm/lapic.h | 2 ++ arch/x86/kvm/vmx.c | 12 -- 3 files c

[PATCH v2 1/2] KVM: x86: Use vector-hashing to deliver lowest-priority interrupts

2015-12-15 Thread Feng Wu
Use vector-hashing to deliver lowest-priority interrupts, As an example, modern Intel CPUs in server platform use this method to handle lowest-priority interrupts. Signed-off-by: Feng Wu <feng...@intel.com> --- arch/x86/kvm/irq_comm.c | 27 ++- arch/x86/kvm/lapic.c

[PATCH] KVM: x86: Add lowest-priority support for vt-d posted-interrupts

2015-11-08 Thread Feng Wu
Use vector-hashing to handle lowest-priority interrupts for posted-interrupts. As an example, modern Intel CPUs use this method to handle lowest-priority interrupts. Signed-off-by: Feng Wu <feng...@intel.com> --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/irq_comm.c

[PATCH] genirq: Move irq_set_vcpu_affinity out of "#ifdef CONFIG_SMP"

2015-10-03 Thread Feng Wu
irq_set_vcpu_affinity() is needed when CONFIG_SMP=n, so move the definition out of "#ifdef CONFIG_SMP" Suggested-by: Paolo Bonzini <pbonz...@redhat.com> Signed-off-by: Feng Wu <feng...@intel.com> --- kernel/irq/manage.c | 62 ++-

[PATCH] Add virt directory to the top Makefile

2015-09-22 Thread Feng Wu
We need to build files in virt/lib/, which are now used by KVM and VFIO, so add virt directory to the top Makefile. Signed-off-by: Feng Wu <feng...@intel.com> --- Makefile | 8 +--- arch/x86/kvm/Makefile | 3 --- virt/Makefile | 1 + 3 files changed, 6 insertions

[PATCH v2] Add virt directory to the top Makefile

2015-09-22 Thread Feng Wu
We need to build files in virt/lib/, so add virt directory to the top Makefile. Signed-off-by: Feng Wu <feng...@intel.com> --- v2: - Remove the explicit 'virt' entry in the KBUILD_ALLDIRS assignment - Remove './' in virt/Makefile Makefile | 10 ++ arch/x86/kvm/Makefil

[PATCH v9 15/18] KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'

2015-09-18 Thread Feng Wu
This patch adds an arch specific hooks 'arch_update' in 'struct kvm_kernel_irqfd'. On Intel side, it is used to update the IRTE when VT-d posted-interrupts is used. Signed-off-by: Feng Wu <feng...@intel.com> --- v9: - Use 'if' instead of "? :" in kvm_arch_update_irqfd_routing() -

[PATCH v9 09/18] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-09-18 Thread Feng Wu
it single-CPU, we can use PI to deliver the interrupts to it. Full functionality of lowest-priority support will be added later. Signed-off-by: Feng Wu <feng...@intel.com> --- v9: - Move kvm_intr_is_single_vcpu_fast() to lapic.c - Remove incorrect WARN_ON_ONCE() v8: - Some optimiz

[PATCH v9 13/18] KVM: x86: Update IRTE for posted-interrupts

2015-09-18 Thread Feng Wu
This patch adds the routine to update IRTE for posted-interrupts when guest changes the interrupt configuration. Signed-off-by: Feng Wu <feng...@intel.com> --- v9: - Check !kvm_arch_has_assigned_device(kvm) first then !irq_remapping_cap(IRQ_POSTING_CAP) v8: - Move 'kvm_arch_update_p

[PATCH v9 10/18] KVM: Make struct kvm_irq_routing_table accessible

2015-09-18 Thread Feng Wu
Move struct kvm_irq_routing_table from irqchip.c to kvm_host.h, so we can use it outside of irqchip.c. Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> --- include/linux/kvm_host.h | 14 ++ virt/kvm/irqchip.c | 10 ---

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

2015-09-18 Thread Feng Wu
: 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_tab

[PATCH v9 18/18] iommu/vt-d: Add a command line parameter for VT-d posted-interrupts

2015-09-18 Thread Feng Wu
Enable VT-d Posted-Interrtups and add a command line parameter for it. Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> --- Documentation/kernel-parameters.txt | 1 + drivers/iommu/irq_remapping.c | 12 2 files changed,

[PATCH v9 17/18] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked

2015-09-18 Thread Feng Wu
This patch updates the Posted-Interrupts Descriptor when vCPU is blocked. pre-block: - Add the vCPU to the blocked per-CPU list - Set 'NV' to POSTED_INTR_WAKEUP_VECTOR post-block: - Remove the vCPU from the per-CPU list Signed-off-by: Feng Wu <feng...@intel.com> --- v9: - Add descr

[PATCH v9 07/18] KVM: Extend struct pi_desc for VT-d Posted-Interrupts

2015-09-18 Thread Feng Wu
Extend struct pi_desc for VT-d Posted-Interrupts. Signed-off-by: Feng Wu <feng...@intel.com> --- arch/x86/kvm/vmx.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 83b7b5c..271dd70 100644 --- a/arch/x

[PATCH v9 11/18] KVM: make kvm_set_msi_irq() public

2015-09-18 Thread Feng Wu
Make kvm_set_msi_irq() public, we can use this function outside. Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> --- v8: - Export kvm_set_msi_irq() so we can use it in vmx code arch/x86/include/asm/kvm_host.h | 4 arch/x86/kv

[PATCH v9 08/18] KVM: Add some helper functions for Posted-Interrupts

2015-09-18 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> --- arch/x86/kvm/vmx.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/

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

2015-09-18 Thread Feng Wu
From: Eric Auger 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

[PATCH v9 03/18] KVM: arm/arm64: select IRQ_BYPASS_MANAGER

2015-09-18 Thread Feng Wu
From: Eric Auger <eric.au...@linaro.org> Select IRQ_BYPASS_MANAGER when CONFIG_KVM is set Also add compilation of virt/lib. Signed-off-by: Eric Auger <eric.au...@linaro.org> Signed-off-by: Feng Wu <feng...@intel.com> --- v3 -> v4: - add compilation of virt/lib in arm/arm64 K

[PATCH v9 12/18] vfio: Register/unregister irq_bypass_producer

2015-09-18 Thread Feng Wu
This patch adds the registration/unregistration of an irq_bypass_producer for MSI/MSIx on vfio pci devices. Signed-off-by: Feng Wu <feng...@intel.com> --- v8: - Merge "[PATCH v7 08/17] vfio: Select IRQ_BYPASS_MANAGER for vfio PCI devices" into this patch. v6: - Make

[PATCH v9 14/18] KVM: Implement IRQ bypass consumer callbacks for x86

2015-09-18 Thread Feng Wu
Implement the following callbacks for x86: - kvm_arch_irq_bypass_add_producer - kvm_arch_irq_bypass_del_producer - kvm_arch_irq_bypass_stop: dummy callback - kvm_arch_irq_bypass_resume: dummy callback and set CONFIG_HAVE_KVM_IRQ_BYPASS for x86. Signed-off-by: Feng Wu <feng...@intel.com>

[PATCH v9 16/18] KVM: Update Posted-Interrupts Descriptor when vCPU is preempted

2015-09-18 Thread Feng Wu
This patch updates the Posted-Interrupts Descriptor when vCPU is preempted. sched out: - Set 'SN' to suppress furture non-urgent interrupts posted for the vCPU. sched in: - Clear 'SN' - Change NDST if vCPU is scheduled to a different CPU - Set 'NV' to POSTED_INTR_VECTOR Signed-off-by: Feng Wu

[PATCH v9 06/18] KVM: eventfd: add irq bypass consumer management

2015-09-18 Thread Feng Wu
From: Eric Auger <eric.au...@linaro.org> This patch adds the registration/unregistration of an irq_bypass_consumer on irqfd assignment/deassignment. Signed-off-by: Eric Auger <eric.au...@linaro.org> Signed-off-by: Feng Wu <feng...@intel.com> --- v4 -> v5: - due to removal o

[PATCH v9 01/18] virt: IRQ bypass manager

2015-09-18 Thread Feng Wu
allow the bypass facilities to be automatically enabled. Signed-off-by: Alex Williamson <alex.william...@redhat.com> Reviewed-by: Eric Auger <eric.au...@linaro.org> Tested-by: Eric Auger <eric.au...@linaro.org> Tested-by: Feng Wu <feng...@intel.com> --- v4: All producer callbacks

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

2015-09-18 Thread Feng Wu
is set. Signed-off-by: Eric Auger <eric.au...@linaro.org> Signed-off-by: Feng Wu <feng...@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_upda

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

2015-09-18 Thread Feng Wu
Select IRQ_BYPASS_MANAGER for x86 when CONFIG_KVM is set Signed-off-by: Feng Wu <feng...@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 ---

[PATCH v8 06/13] vfio: Register/unregister irq_bypass_producer

2015-09-16 Thread Feng Wu
This patch adds the registration/unregistration of an irq_bypass_producer for MSI/MSIx on vfio pci devices. Signed-off-by: Feng Wu <feng...@intel.com> --- v8: - Merge "[PATCH v7 08/17] vfio: Select IRQ_BYPASS_MANAGER for vfio PCI devices" into this patch. v6: - Make

[PATCH v8 05/13] KVM: make kvm_set_msi_irq() public

2015-09-16 Thread Feng Wu
Make kvm_set_msi_irq() public, we can use this function outside. Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> --- v8: - Export kvm_set_msi_irq() so we can use it in vmx code arch/x86/include/asm/kvm_host.h | 4 arch/x86/kv

[PATCH v8 02/13] KVM: Add some helper functions for Posted-Interrupts

2015-09-16 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> --- arch/x86/kvm/vmx.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/

[PATCH v8 04/13] KVM: Make struct kvm_irq_routing_table accessible

2015-09-16 Thread Feng Wu
Move struct kvm_irq_routing_table from irqchip.c to kvm_host.h, so we can use it outside of irqchip.c. Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> --- include/linux/kvm_host.h | 14 ++ virt/kvm/irqchip.c | 10 ---

[PATCH v8 10/13] KVM: Update Posted-Interrupts Descriptor when vCPU is preempted

2015-09-16 Thread Feng Wu
This patch updates the Posted-Interrupts Descriptor when vCPU is preempted. sched out: - Set 'SN' to suppress furture non-urgent interrupts posted for the vCPU. sched in: - Clear 'SN' - Change NDST if vCPU is scheduled to a different CPU - Set 'NV' to POSTED_INTR_VECTOR Signed-off-by: Feng Wu

[PATCH v8 11/13] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked

2015-09-16 Thread Feng Wu
This patch updates the Posted-Interrupts Descriptor when vCPU is blocked. pre-block: - Add the vCPU to the blocked per-CPU list - Set 'NV' to POSTED_INTR_WAKEUP_VECTOR post-block: - Remove the vCPU from the per-CPU list Signed-off-by: Feng Wu <feng...@intel.com> --- v8: - Rename 'pi_pre

[PATCH v8 09/13] KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'

2015-09-16 Thread Feng Wu
This patch adds an arch specific hooks 'arch_update' in 'struct kvm_kernel_irqfd'. On Intel side, it is used to update the IRTE when VT-d posted-interrupts is used. Signed-off-by: Feng Wu <feng...@intel.com> --- v8: - Remove callback .arch_update() - Remove kvm_arch_irqfd_init()

[PATCH v8 03/13] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-09-16 Thread Feng Wu
it single-CPU, we can use PI to deliver the interrupts to it. Full functionality of lowest-priority support will be added later. Signed-off-by: Feng Wu <feng...@intel.com> --- v8: - Some optimizations in kvm_intr_is_single_vcpu(). - Expose kvm_intr_is_single_vcpu() so we can use it in vmx code.

[PATCH v8 01/13] KVM: Extend struct pi_desc for VT-d Posted-Interrupts

2015-09-16 Thread Feng Wu
Extend struct pi_desc for VT-d Posted-Interrupts. Signed-off-by: Feng Wu <feng...@intel.com> --- arch/x86/kvm/vmx.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 83b7b5c..271dd70 100644 --- a/arch/x

[PATCH v8 13/13] iommu/vt-d: Add a command line parameter for VT-d posted-interrupts

2015-09-16 Thread Feng Wu
Enable VT-d Posted-Interrtups and add a command line parameter for it. Signed-off-by: Feng Wu <feng...@intel.com> Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> --- Documentation/kernel-parameters.txt | 1 + drivers/iommu/irq_remapping.c | 12 2 files changed,

[PATCH v8 12/13] KVM: Warn if 'SN' is set during posting interrupts by software

2015-09-16 Thread Feng Wu
-by: Feng Wu <feng...@intel.com> Reviewed-by: Paolo Bonzini <pbonz...@redhat.com> --- arch/x86/kvm/vmx.c | 16 1 file changed, 16 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 9888c43..58fbbc6 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x

[PATCH v8 00/13] Add VT-d Posted-Interrupts support

2015-09-16 Thread Feng Wu
is 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....@linux.intel.com> Feng Wu (13): KVM: Extend struct pi_desc for VT-d Posted-Interrupts KVM: Add some helper functi

[PATCH v8 07/13] KVM: x86: Update IRTE for posted-interrupts

2015-09-16 Thread Feng Wu
This patch adds the routine to update IRTE for posted-interrupts when guest changes the interrupt configuration. Signed-off-by: Feng Wu <feng...@intel.com> --- v8: - Move 'kvm_arch_update_pi_irte' to vmx.c as a callback - Only update the PI irte when VM has assigned devices - Add a trace

[PATCH v8 08/13] KVM: Implement IRQ bypass consumer callbacks for x86

2015-09-16 Thread Feng Wu
Implement the following callbacks for x86: - kvm_arch_irq_bypass_add_producer - kvm_arch_irq_bypass_del_producer - kvm_arch_irq_bypass_stop: dummy callback - kvm_arch_irq_bypass_resume: dummy callback and set CONFIG_HAVE_KVM_IRQ_BYPASS for x86. Signed-off-by: Feng Wu <feng...@intel.com>

[PATCH v7 16/17] KVM: Warn if 'SN' is set during posting interrupts by software

2015-08-25 Thread Feng Wu
-by: Feng Wu feng...@intel.com --- arch/x86/kvm/vmx.c | 16 1 file changed, 16 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 64e35ea..eb640a1 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -4494,6 +4494,22 @@ static inline bool

[PATCH v7 02/17] KVM: Add some helper functions for Posted-Interrupts

2015-08-25 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/vmx.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 271dd70..316f9bf

[PATCH v7 05/17] KVM: Add interfaces to control PI outside vmx

2015-08-25 Thread Feng Wu
This patch adds pi_clear_sn and pi_set_sn to struct kvm_x86_ops, so we can set/clear SN outside vmx. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 3 +++ arch/x86/kvm/vmx.c | 13 + 2 files changed, 16 insertions(+) diff --git a/arch/x86

[PATCH v7 00/17] Add VT-d Posted-Interrupts support

2015-08-25 Thread Feng Wu
, then revise some irq logic based on the new hierarchy irqdomain patches provided by Jiang Liu jiang@linux.intel.com Feng Wu (17): 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

[PATCH v7 06/17] KVM: Make struct kvm_irq_routing_table accessible

2015-08-25 Thread Feng Wu
Move struct kvm_irq_routing_table from irqchip.c to kvm_host.h, so we can use it outside of irqchip.c. Signed-off-by: Feng Wu feng...@intel.com --- include/linux/kvm_host.h | 14 ++ virt/kvm/irqchip.c | 10 -- 2 files changed, 14 insertions(+), 10 deletions(-) diff

[PATCH v7 03/17] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-08-25 Thread Feng Wu
it single-CPU, we can use PI to deliver the interrupts to it. Full functionality of lowest-priority support will be added later. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 3 +++ arch/x86/kvm/irq_comm.c | 24 2 files changed, 27

[PATCH v7 09/17] vfio: Register/unregister irq_bypass_producer

2015-08-25 Thread Feng Wu
irq_bypass_register_producer fails - Remove optional dummy callbacks for irq producer Signed-off-by: Feng Wu feng...@intel.com --- drivers/vfio/pci/vfio_pci_intrs.c | 9 + drivers/vfio/pci/vfio_pci_private.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b

[PATCH v7 13/17] KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'

2015-08-25 Thread Feng Wu
This patch adds an arch specific hooks 'arch_update' in 'struct kvm_kernel_irqfd'. On Intel side, it is used to update the IRTE when VT-d posted-interrupts is used. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/x86.c | 5

[PATCH v7 11/17] KVM: Define two weak arch callbacks for irq bypass manager

2015-08-25 Thread Feng Wu
Define two weak arch callbacks so that archs that don't need them don't need define them. Signed-off-by: Feng Wu feng...@intel.com --- virt/kvm/eventfd.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/virt/kvm/eventfd.c b/virt/kvm/eventfd.c index d7a230f..f3050b9 100644

[PATCH v7 10/17] KVM: x86: Update IRTE for posted-interrupts

2015-08-25 Thread Feng Wu
This patch adds the routine to update IRTE for posted-interrupts when guest changes the interrupt configuration. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/x86.c | 73 ++ 1 file changed, 73 insertions(+) diff --git a/arch/x86

[PATCH v7 08/17] vfio: Select IRQ_BYPASS_MANAGER for vfio PCI devices

2015-08-25 Thread Feng Wu
Enable irq bypass manager for vfio PCI devices. Signed-off-by: Feng Wu feng...@intel.com --- drivers/vfio/pci/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig index 579d83b..02912f1 100644 --- a/drivers/vfio/pci/Kconfig +++ b/drivers

[PATCH v7 12/17] KVM: Implement IRQ bypass consumer callbacks for x86

2015-08-25 Thread Feng Wu
Implement the following callbacks for x86: - kvm_arch_irq_bypass_add_producer - kvm_arch_irq_bypass_del_producer - kvm_arch_irq_bypass_stop: dummy callback - kvm_arch_irq_bypass_resume: dummy callback and set CONFIG_HAVE_KVM_IRQ_BYPASS for x86. Signed-off-by: Feng Wu feng...@intel.com --- arch

[PATCH v7 14/17] KVM: Update Posted-Interrupts Descriptor when vCPU is preempted

2015-08-25 Thread Feng Wu
This patch updates the Posted-Interrupts Descriptor when vCPU is preempted. sched out: - Set 'SN' to suppress furture non-urgent interrupts posted for the vCPU. sched in: - Clear 'SN' - Change NDST if vCPU is scheduled to a different CPU - Set 'NV' to POSTED_INTR_VECTOR Signed-off-by: Feng Wu

[PATCH v7 01/17] KVM: Extend struct pi_desc for VT-d Posted-Interrupts

2015-08-25 Thread Feng Wu
Extend struct pi_desc for VT-d Posted-Interrupts. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/vmx.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 83b7b5c..271dd70 100644 --- a/arch/x86/kvm

[PATCH v7 17/17] iommu/vt-d: Add a command line parameter for VT-d posted-interrupts

2015-08-25 Thread Feng Wu
Enable VT-d Posted-Interrtups and add a command line parameter for it. Signed-off-by: Feng Wu feng...@intel.com --- Documentation/kernel-parameters.txt | 1 + drivers/iommu/irq_remapping.c | 12 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Documentation

[PATCH v7 15/17] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked

2015-08-25 Thread Feng Wu
This patch updates the Posted-Interrupts Descriptor when vCPU is blocked. pre-block: - Add the vCPU to the blocked per-CPU list - Set 'NV' to POSTED_INTR_WAKEUP_VECTOR post-block: - Remove the vCPU from the per-CPU list Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm

[PATCH v7 04/17] KVM: Get Posted-Interrupts descriptor address from 'struct kvm_vcpu'

2015-08-25 Thread Feng Wu
Define an interface to get PI descriptor address from the vCPU structure. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/vmx.c | 11 +++ 2 files changed, 13 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch

[PATCH v7 07/17] KVM: make kvm_set_msi_irq() public

2015-08-25 Thread Feng Wu
Make kvm_set_msi_irq() public, we can use this function outside. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 4 arch/x86/kvm/irq_comm.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch

[PATCH v6 12/16] KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'

2015-08-11 Thread Feng Wu
This patch adds an arch specific hooks 'arch_update' in 'struct kvm_kernel_irqfd'. On Intel side, it is used to update the IRTE when VT-d posted-interrupts is used. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/x86.c | 5

[PATCH v6 13/16] KVM: Update Posted-Interrupts Descriptor when vCPU is preempted

2015-08-11 Thread Feng Wu
This patch updates the Posted-Interrupts Descriptor when vCPU is preempted. sched out: - Set 'SN' to suppress furture non-urgent interrupts posted for the vCPU. sched in: - Clear 'SN' - Change NDST if vCPU is scheduled to a different CPU - Set 'NV' to POSTED_INTR_VECTOR Signed-off-by: Feng Wu

[PATCH v6 11/16] KVM: Implement IRQ bypass consumer callbacks for x86

2015-08-11 Thread Feng Wu
Implement the following callbacks for x86: - kvm_arch_irq_bypass_add_producer - kvm_arch_irq_bypass_del_producer - kvm_arch_irq_bypass_stop: dummy callback - kvm_arch_irq_bypass_resume: dummy callback and set CONFIG_HAVE_KVM_IRQ_BYPASS for x86. Signed-off-by: Feng Wu feng...@intel.com --- arch

[PATCH v6 07/16] KVM: make kvm_set_msi_irq() public

2015-08-11 Thread Feng Wu
Make kvm_set_msi_irq() public, we can use this function outside. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 4 arch/x86/kvm/irq_comm.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch

[PATCH v6 09/16] vfio: Register/unregister irq_bypass_producer

2015-08-11 Thread Feng Wu
irq_bypass_register_producer fails - Remove optional dummy callbacks for irq producer Signed-off-by: Feng Wu feng...@intel.com --- drivers/vfio/pci/vfio_pci_intrs.c | 9 + drivers/vfio/pci/vfio_pci_private.h | 2 ++ 2 files changed, 11 insertions(+) diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b

[PATCH v6 08/16] vfio: Select IRQ_BYPASS_MANAGER for vfio PCI devices

2015-08-11 Thread Feng Wu
Enable irq bypass manager for vfio PCI devices. Signed-off-by: Feng Wu feng...@intel.com --- drivers/vfio/pci/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig index 579d83b..02912f1 100644 --- a/drivers/vfio/pci/Kconfig +++ b/drivers

[PATCH v6 06/16] KVM: Make struct kvm_irq_routing_table accessible

2015-08-11 Thread Feng Wu
Move struct kvm_irq_routing_table from irqchip.c to kvm_host.h, so we can use it outside of irqchip.c. Signed-off-by: Feng Wu feng...@intel.com --- include/linux/kvm_host.h | 14 ++ virt/kvm/irqchip.c | 10 -- 2 files changed, 14 insertions(+), 10 deletions(-) diff

[PATCH v6 10/16] KVM: x86: Update IRTE for posted-interrupts

2015-08-11 Thread Feng Wu
This patch adds the routine to update IRTE for posted-interrupts when guest changes the interrupt configuration. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/x86.c | 73 ++ 1 file changed, 73 insertions(+) diff --git a/arch/x86

[PATCH v6 16/16] iommu/vt-d: Add a command line parameter for VT-d posted-interrupts

2015-08-11 Thread Feng Wu
Enable VT-d Posted-Interrtups and add a command line parameter for it. Signed-off-by: Feng Wu feng...@intel.com --- Documentation/kernel-parameters.txt | 1 + drivers/iommu/irq_remapping.c | 12 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Documentation

[PATCH v6 14/16] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked

2015-08-11 Thread Feng Wu
This patch updates the Posted-Interrupts Descriptor when vCPU is blocked. pre-block: - Add the vCPU to the blocked per-CPU list - Set 'NV' to POSTED_INTR_WAKEUP_VECTOR post-block: - Remove the vCPU from the per-CPU list Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm

[PATCH v6 15/16] KVM: Warn if 'SN' is set during posting interrupts by software

2015-08-11 Thread Feng Wu
-by: Feng Wu feng...@intel.com --- arch/x86/kvm/vmx.c | 16 1 file changed, 16 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 6b50eba..b4f5600 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -4477,6 +4477,22 @@ static inline bool

[PATCH v6 01/16] KVM: Extend struct pi_desc for VT-d Posted-Interrupts

2015-08-11 Thread Feng Wu
Extend struct pi_desc for VT-d Posted-Interrupts. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/vmx.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 83b7b5c..271dd70 100644 --- a/arch/x86/kvm

[PATCH v6 00/16] Add VT-d Posted-Interrupts support

2015-08-11 Thread Feng Wu
on the new hierarchy irqdomain patches provided by Jiang Liu jiang@linux.intel.com Feng Wu (16): 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: Get Posted-Interrupts

[PATCH v6 02/16] KVM: Add some helper functions for Posted-Interrupts

2015-08-11 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/vmx.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 271dd70..316f9bf

[PATCH v6 05/16] KVM: Add interfaces to control PI outside vmx

2015-08-11 Thread Feng Wu
This patch adds pi_clear_sn and pi_set_sn to struct kvm_x86_ops, so we can set/clear SN outside vmx. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 3 +++ arch/x86/kvm/vmx.c | 13 + 2 files changed, 16 insertions(+) diff --git a/arch/x86

[PATCH v6 03/16] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-08-11 Thread Feng Wu
it single-CPU, we can use PI to deliver the interrupts to it. Full functionality of lowest-priority support will be added later. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 3 +++ arch/x86/kvm/irq_comm.c | 24 2 files changed, 27

[PATCH v6 04/16] KVM: Get Posted-Interrupts descriptor address from 'struct kvm_vcpu'

2015-08-11 Thread Feng Wu
Define an interface to get PI descriptor address from the vCPU structure. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/vmx.c | 11 +++ 2 files changed, 13 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch

[v3 4/5] KVM: introduce kvm_arch functions for IRQ bypass

2015-07-29 Thread Feng Wu
CONFIG_IRQ_BYPASS_MANAGER - rename all functions according to Paolo's proposal - add kvm_arch_irq_bypass_update according to Feng's need Signed-off-by: Eric Auger eric.au...@linaro.org Signed-off-by: Feng Wu feng...@intel.com --- include/linux/kvm_host.h | 33 + virt/kvm

[v3 1/5] KVM: x86: select IRQ_BYPASS_MANAGER

2015-07-29 Thread Feng Wu
Select IRQ_BYPASS_MANAGER for x86 when CONFIG_KVM is set Signed-off-by: Feng Wu feng...@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

[v3 3/5] KVM: create kvm_irqfd.h

2015-07-29 Thread Feng Wu
From: Eric Auger eric.au...@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

[v3 5/5] KVM: eventfd: add irq bypass consumer management

2015-07-29 Thread Feng Wu
kvm_kernel_irqfd', it is needed by posted interrupt. - Remove 'irq_bypass_unregister_consumer' in kvm_irqfd_deassign() v1 - v2: - populate of kvm and gsi removed - unregister the consumer on irqfd_shutdown Signed-off-by: Eric Auger eric.au...@linaro.org Signed-off-by: Feng Wu feng...@intel.com

[v3 0/5] KVM: irqfd consumer based on IRQ bypass manager

2015-07-29 Thread Feng Wu
management Feng Wu (1): KVM: x86: select IRQ_BYPASS_MANAGER arch/arm/kvm/Kconfig | 1 + arch/arm64/kvm/Kconfig| 1 + arch/x86/kvm/Kconfig | 2 + arch/x86/kvm/Makefile | 3 ++ include/linux/kvm_host.h | 33 +++ include/linux/kvm_irqfd.h | 71

[v3 2/5] KVM: arm/arm64: select IRQ_BYPASS_MANAGER

2015-07-29 Thread Feng Wu
From: Eric Auger eric.au...@linaro.org Select IRQ_BYPASS_MANAGER when CONFIG_KVM is set v2 - v3: - Correct a typo in 'arch/arm64/kvm/Kconfig' v1 - v2: - also set IRQ_BYPASS_MANAGER for arm64 Signed-off-by: Eric Auger eric.au...@linaro.org Signed-off-by: Feng Wu feng...@intel.com --- arch/arm

[v5 06/19] KVM: Make struct kvm_irq_routing_table accessible

2015-07-13 Thread Feng Wu
Move struct kvm_irq_routing_table from irqchip.c to kvm_host.h, so we can use it outside of irqchip.c. Signed-off-by: Feng Wu feng...@intel.com --- include/linux/kvm_host.h | 15 +++ virt/kvm/irqchip.c | 11 --- 2 files changed, 15 insertions(+), 11 deletions(-) diff

[v5 13/19] KVM: x86: Update IRTE for posted-interrupts

2015-07-13 Thread Feng Wu
This patch adds the routine to update IRTE for posted-interrupts when guest changes the interrupt configuration. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/x86.c | 73 ++ 1 file changed, 73 insertions(+) diff --git a/arch/x86

[v5 19/19] KVM: Warn if 'SN' is set during posting interrupts by software

2015-07-13 Thread Feng Wu
-by: Feng Wu feng...@intel.com --- arch/x86/kvm/vmx.c | 16 1 file changed, 16 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index cecd018..d4d5abc 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -4484,6 +4484,22 @@ static inline bool

[v5 04/19] KVM: Get Posted-Interrupts descriptor address from struct kvm_vcpu

2015-07-13 Thread Feng Wu
Define an interface to get PI descriptor address from the vCPU structure. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/vmx.c | 11 +++ 2 files changed, 13 insertions(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch

[v5 00/19] Add VT-d Posted-Interrupts support

2015-07-13 Thread Feng Wu
/10/663 - Reuse some common patch from Eric Eric Auger (3): KVM: create kvm_irqfd.h KVM: eventfd: add irq bypass information in irqfd KVM: eventfd: add irq bypass consumer management Feng Wu (16): KVM: Extend struct pi_desc for VT-d Posted-Interrupts KVM: Add some helper functions

[v5 08/19] vfio: Select IRQ_BYPASS_MANAGER for vfio PCI devices

2015-07-13 Thread Feng Wu
Enable irq bypass manager for vfio PCI devices. Signed-off-by: Feng Wu feng...@intel.com --- drivers/vfio/pci/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vfio/pci/Kconfig b/drivers/vfio/pci/Kconfig index 579d83b..02912f1 100644 --- a/drivers/vfio/pci/Kconfig +++ b/drivers

[v5 02/19] KVM: Add some helper functions for Posted-Interrupts

2015-07-13 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/vmx.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 765539e..1e815b6

[v5 01/19] KVM: Extend struct pi_desc for VT-d Posted-Interrupts

2015-07-13 Thread Feng Wu
Extend struct pi_desc for VT-d Posted-Interrupts. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/vmx.c | 20 ++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index e11dd59..765539e 100644 --- a/arch/x86/kvm

[v5 07/19] KVM: make kvm_set_msi_irq() public

2015-07-13 Thread Feng Wu
Make kvm_set_msi_irq() public, we can use this function outside. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 4 arch/x86/kvm/irq_comm.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arch

[v5 05/19] KVM: Add interfaces to control PI outside vmx

2015-07-13 Thread Feng Wu
This patch adds pi_clear_sn and pi_set_sn to struct kvm_x86_ops, so we can set/clear SN outside vmx. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 3 +++ arch/x86/kvm/vmx.c | 13 + 2 files changed, 16 insertions(+) diff --git a/arch/x86

[v5 03/19] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-07-13 Thread Feng Wu
it single-CPU, we can use PI to deliver the interrupts to it. Full functionality of lowest-priority support will be added later. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/irq_comm.c | 24 2 files changed, 26

[v5 09/19] vfio: Register/unregister irq_bypass_producer

2015-07-13 Thread Feng Wu
This patch adds the registration/unregistration of an irq_bypass_producer for MSI/MSIx on vfio pci devices. Signed-off-by: Feng Wu feng...@intel.com --- drivers/vfio/pci/vfio_pci_intrs.c | 19 +++ drivers/vfio/pci/vfio_pci_private.h | 2 ++ 2 files changed, 21 insertions

[v5 16/19] KVM: Add an arch specific hooks in 'struct kvm_kernel_irqfd'

2015-07-13 Thread Feng Wu
This patch adds an arch specific hooks 'arch_update' in 'struct kvm_kernel_irqfd'. On Intel side, it is used to update the IRTE when VT-d posted-interrupts is used. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/x86.c| 5 + include/linux/kvm_host.h | 3 +++ include

[v5 14/19] KVM: x86: Add arch specific routines for irqbypass manager

2015-07-13 Thread Feng Wu
Add the following x86 specific routines for irqbypass manger: - kvm_arch_irq_bypass_add_producer - kvm_arch_irq_bypass_del_producer Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm/kvm_host.h | 1 + arch/x86/kvm/x86.c | 40

[v5 15/19] KVM: eventfd: add irq bypass consumer management

2015-07-13 Thread Feng Wu
From: Eric Auger eric.au...@linaro.org This patch adds the registration/unregistration of an irq_bypass_consumer on irqfd assignment/deassignment. Signed-off-by: Eric Auger eric.au...@linaro.org Signed-off-by: Feng Wu feng...@intel.com --- virt/kvm/eventfd.c | 7 +++ 1 file changed, 7

[v5 18/19] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked

2015-07-13 Thread Feng Wu
This patch updates the Posted-Interrupts Descriptor when vCPU is blocked. pre-block: - Add the vCPU to the blocked per-CPU list - Set 'NV' to POSTED_INTR_WAKEUP_VECTOR post-block: - Remove the vCPU from the per-CPU list Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/include/asm

[v5 10/19] KVM, x86: Select IRQ_BYPASS_MANAGER for KVM_INTEL

2015-07-13 Thread Feng Wu
Enable irq bypass manager for kvm-intel. Signed-off-by: Feng Wu feng...@intel.com --- arch/x86/kvm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kvm/Kconfig b/arch/x86/kvm/Kconfig index 921a8f9..be125bc 100644 --- a/arch/x86/kvm/Kconfig +++ b/arch/x86/kvm/Kconfig @@ -61,6

[v5 12/19] KVM: eventfd: add irq bypass information in irqfd

2015-07-13 Thread Feng Wu
From: Eric Auger eric.au...@linaro.org This patch adds the following new members in 'struct kvm_kernel_irqfd' - struct irq_bypass_consumer consumer - struct irq_bypass_producer *producer Signed-off-by: Eric Auger eric.au...@linaro.org Signed-off-by: Feng Wu feng...@intel.com --- include

[v5 11/19] KVM: create kvm_irqfd.h

2015-07-13 Thread Feng Wu
From: Eric Auger eric.au...@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

  1   2   3   >