[v2 15/25] KVM: Make struct kvm_irq_routing_table accessible

2014-12-02 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 --- include/linux/kvm_host.h | 19 +++ virt/kvm/irqchip.c | 11 --- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/inc

[v2 14/25] KVM: Get Posted-Interrupts descriptor address from struct kvm_vcpu

2014-12-02 Thread Feng Wu
Define a interface to get PI descriptor address from the vCPU structure. Signed-off-by: Feng Wu --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/vmx.c | 12 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/kvm_host.h b/arc

[v2 12/25] KVM: Initialize VT-d Posted-Interrupts Descriptor

2014-12-02 Thread Feng Wu
This patch initializes the VT-d Posted-Interrupts Descriptor. Signed-off-by: Feng Wu --- arch/x86/kvm/vmx.c | 27 +++ 1 files changed, 27 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 0b1383e..66ca275 100644 --- a/arch/x86/kvm

[v2 09/25] iommu, x86: define irq_remapping_cap()

2014-12-02 Thread Feng Wu
This patch adds a new interface irq_remapping_cap() to detect whether irq remapping supports new features, such as VT-d Posted-Interrupts. We export this function out, so that KVM code can check this and use this mechanism properly. Signed-off-by: Feng Wu Reviewed-by: Jiang Liu --- arch/x86/inc

[v2 13/25] KVM: Define a new interface kvm_find_dest_vcpu() for VT-d PI

2014-12-02 Thread Feng Wu
This patch defines a new interface kvm_find_dest_vcpu for VT-d PI, which can returns the destination vCPU of the interrupt for guests. Since VT-d PI cannot handle broadcast/multicast interrupt, Here we only handle Fixed and Lowest priority interrupts. The current method of handling guest lowest p

[v2 10/25] KVM: change struct pi_desc for VT-d Posted-Interrupts

2014-12-02 Thread Feng Wu
Change struct pi_desc for VT-d Posted-Interrupts. Signed-off-by: Feng Wu --- arch/x86/kvm/vmx.c | 15 +-- 1 files changed, 13 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 3e556c6..abdb84f 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kv

[v2 08/25] iommu, x86: Add intel_irq_remapping_capability() for Intel

2014-12-02 Thread Feng Wu
Add the Intel side implementation for capability in struct irq_remap_ops. Signed-off-by: Feng Wu Reviewed-by: Jiang Liu --- drivers/iommu/intel_irq_remapping.c | 27 +++ drivers/iommu/irq_remapping.c |2 ++ drivers/iommu/irq_remapping.h |4 3 f

[v2 07/25] iommu, x86: Add cap_pi_support() to detect VT-d PI capability

2014-12-02 Thread Feng Wu
Add helper function to detect VT-d Posted-Interrupts capability. Signed-off-by: Feng Wu Reviewed-by: Jiang Liu --- include/linux/intel-iommu.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index ecaf3a9..8174ae

[v2 04/25] iommu, x86: Implement irq_set_vcpu_affinity for intel_ir_chip

2014-12-02 Thread Feng Wu
Implement irq_set_vcpu_affinity for intel_ir_chip. Signed-off-by: Feng Wu Reviewed-by: Jiang Liu --- arch/x86/include/asm/irq_remapping.h |5 + drivers/iommu/intel_irq_remapping.c | 27 +++ 2 files changed, 32 insertions(+), 0 deletions(-) diff --git a/arch/x

[v2 06/25] iommu, x86: No need to migrating irq for VT-d Posted-Interrupts

2014-12-02 Thread Feng Wu
We don't need to migrate the irqs for VT-d Posted-Interrupts here. When 'pst' is set in IRTE, the associated irq will be posted to guests instead of interrupt remapping. The destination of the interrupt is set in Posted-Interrupts Descriptor, and the migration happens during vCPU scheduling. Signe

[v2 03/25] iommu, x86: Define new irte structure for VT-d Posted-Interrupts

2014-12-02 Thread Feng Wu
Add a new irte_pi structure for VT-d Posted-Interrupts. Signed-off-by: Feng Wu Reviewed-by: Jiang Liu --- include/linux/dmar.h | 32 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 8473756..c7f9

[v2 05/25] x86, irq: Implement irq_set_vcpu_affinity for pci_msi_ir_controller

2014-12-02 Thread Feng Wu
Implement irq_set_vcpu_affinity for pci_msi_ir_controller. Signed-off-by: Feng Wu Reviewed-by: Jiang Liu --- arch/x86/kernel/apic/msi.c |1 + include/linux/irq.h|3 +++ 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/ap

[v2 02/25] iommu: Add new member capability to struct irq_remap_ops

2014-12-02 Thread Feng Wu
This patch adds a new member capability to struct irq_remap_ops, this new function ops can be used to check whether some features are supported, such as VT-d Posted-Interrupts. Signed-off-by: Feng Wu Reviewed-by: Jiang Liu --- arch/x86/include/asm/irq_remapping.h |4 drivers/iommu/irq_

[v2 01/25] genirq: Introduce irq_set_vcpu_affinity() to target an interrupt to a VCPU

2014-12-02 Thread Feng Wu
From: Jiang Liu With Posted-Interrupts support in Intel CPU and IOMMU, an external interrupt from assigned-devices could be directly delivered to a virtual CPU in a virtual machine. Instead of hacking KVM and Intel IOMMU drivers, we propose a platform independent interface to target an interrupt

<    1   2