Re: [PATCH] Fix bug in iommu_context_addr: Always get pointer to lower extended-context-table

2015-08-25 Thread j...@8bytes.org
Hi Nan, On Mon, Aug 24, 2015 at 06:26:33AM +, Xiao, Nan (Nan@HPS Performance, Beijing) wrote: drivers/iommu/intel-iommu.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/intel-iommu.c b/drivers/iommu/intel-iommu.c index 0649b94..4213598 100644

Re: [PATCH] Documentation/Intel-IOMMU.txt: Modify definition of DRHD

2015-08-25 Thread j...@8bytes.org
Hi Nan, I applied this patch with some formatting fixes, thanks. Details below: From: Xiao, Nan (Nan@HPS Performance, Beijing) nan.x...@hp.com git-am made this author-line out of your patch: (Nan@HPS (Nan@HPS Which doesn't even look like a valid email address. I fixed it, but please include a

Re: [PATCH] Fix bug in iommu_context_addr: Always get pointer to lower extended-context-table

2015-08-25 Thread j...@8bytes.org
On Tue, Aug 25, 2015 at 08:46:27AM +, Xiao, Nan (Nan@HPservers-Core-OE-PSC) wrote: Yes, your patch is simple and better! Okay, I queued this patch to my x86/vt-d branch: From 03932776424a799c3f065a69e98076a78530288b Mon Sep 17 00:00:00 2001 From: Joerg Roedel jroe...@suse.de Date: Tue, 25

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

[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

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

[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 +++

[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

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

RE: [PATCH] Documentation/Intel-IOMMU.txt: Modify definition of DRHD

2015-08-25 Thread Xiao, Nan (Nan@HPservers-Core-OE-PSC)
Hi Joerg, Firstly, thanks very much for your detailed comments! I first send this patch to linux-ker...@vger.kernel.org only (the result of get_maintainer.pl ), but after about 3 days, there is no any responses. I thought no one would notice this bug, so I resend the patch to you. But this

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

2015-08-25 Thread Feng Wu
Currently, we don't support urgent interrupt, all interrupts are recognized as non-urgent interrupt, so we cannot post interrupts when 'SN' is set. If the vcpu is in guest mode, it cannot have been scheduled out, and that's the only case when SN is set currently, warning if SN is set.

[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

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

2015-08-25 Thread Feng Wu
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

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

2015-08-25 Thread Feng Wu
This patch adds the registration/unregistration of an irq_bypass_producer for MSI/MSIx on vfio pci devices. v6: - 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

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

[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 03/17] KVM: Define a new interface kvm_intr_is_single_vcpu()

2015-08-25 Thread Feng Wu
This patch defines a new interface kvm_intr_is_single_vcpu(), which can returns whether the interrupt is for single-CPU or not. It is used by VT-d PI, since now we only support single-CPU interrupts, For lowest-priority interrupts, if user configures it via /proc/irq or uses irqbalance to make it

[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 +

RE: [PATCH] Fix bug in iommu_context_addr: Always get pointer to lower extended-context-table

2015-08-25 Thread Xiao, Nan (Nan@HPservers-Core-OE-PSC)
Hi Joerg, Yes, your patch is simple and better! Best Regards Nan Xiao -Original Message- From: j...@8bytes.org [mailto:j...@8bytes.org] Sent: Tuesday, August 25, 2015 4:42 PM To: Xiao, Nan (Nan@HPservers-Core-OE-PSC) Cc: dw...@infradead.org; iommu@lists.linux-foundation.org;

RE: [PATCH] Fix bug in iommu_context_addr: Always get pointer to lower extended-context-table

2015-08-25 Thread Xiao, Nan (Nan@HPservers-Core-OE-PSC)
Hi Joerg, In commit message: There is a bug in iommu_context_addr() which will always use the lower context table, event when the upper context table needs to be used. Fix this issue. I think it should be even when the upper context table , not event. Thanks! Best Regards Nan Xiao

Re: [PATCH] Fix bug in iommu_context_addr: Always get pointer to lower extended-context-table

2015-08-25 Thread j...@8bytes.org
On Tue, Aug 25, 2015 at 09:15:39AM +, Xiao, Nan (Nan@HPservers-Core-OE-PSC) wrote: In commit message: There is a bug in iommu_context_addr() which will always use the lower context table, event when the upper context table needs to be used. Fix this issue. I think it should be

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

2015-08-25 Thread Alex Williamson
On Tue, 2015-08-25 at 16:50 +0800, Feng Wu wrote: 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 ++

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

2015-08-25 Thread Wu, Feng
-Original Message- From: Alex Williamson [mailto:alex.william...@redhat.com] Sent: Wednesday, August 26, 2015 3:58 AM To: Wu, Feng Cc: pbonz...@redhat.com; j...@8bytes.org; mtosa...@redhat.com; eric.au...@linaro.org; k...@vger.kernel.org; iommu@lists.linux-foundation.org;