Re: [RFC PATCH 2/2] iommu: rockchip: Handle system-wide and runtime PM

2014-12-12 Thread Laurent Pinchart
Hello, On Friday 12 December 2014 13:15:51 Tomasz Figa wrote: > On Fri, Dec 12, 2014 at 5:48 AM, Rafael J. Wysocki wrote: > > On Thursday, December 11, 2014 04:51:37 PM Ulf Hansson wrote: > >> On 11 December 2014 at 16:31, Kevin Hilman wrote: > >> > [+ Laurent Pinchart] > >> > > >> > Tomasz Figa

Re: [RFC PATCH 2/2] iommu: rockchip: Handle system-wide and runtime PM

2014-12-12 Thread Kevin Hilman
[+ Laurent Pinchart] Tomasz Figa writes: > On Thu, Dec 11, 2014 at 8:58 PM, Ulf Hansson wrote: [...] >>> @@ -988,11 +1107,28 @@ static int rk_iommu_probe(struct platform_device >>> *pdev) >>> return -ENXIO; >>> } >>> >>> + pm_runtime_no_callbacks(dev); >>> +

Re: [RFC PATCH 2/2] iommu: rockchip: Handle system-wide and runtime PM

2014-12-12 Thread Kevin Hilman
Tomasz Figa writes: [...] > We have a power domain, which contains an IOMMU and an IP block, which > can do bus transactions through that IOMMU. Of course the IP block is > not aware of the IOMMU, because this is just an integration detail and > on other platforms using the same IP block the IOM

Re: [PATCH 0/5] iommu/vt-d: Fix crash dump failure caused by legacy DMA/IO

2014-12-12 Thread Joerg Roedel
On Fri, Dec 12, 2014 at 10:25:31AM +0800, Li, ZhenHua wrote: > Sorry I have no plan yet. > Could you send me your logs on your AMD system? > On 12/10/2014 04:46 PM, Baoquan He wrote: > >This issue happens on AMD iommu too, do you have any plans or > >thoughts on that? I think the best approach fo

Re: [PATCH 2/2] iommu/vt-d: Only remove domain when device is removed

2014-12-12 Thread Joerg Roedel
Hi Jerry, On Thu, Dec 11, 2014 at 09:35:34AM -0700, Jerry Hoemann wrote: > On Tue, Dec 09, 2014 at 01:15:25PM +0100, Joerg Roedel wrote: > > >From d65b236d0f27fe3ef7ac4d12cceb0da67aec86ce Mon Sep 17 00:00:00 2001 > > From: Joerg Roedel > > Date: Tue, 9 Dec 2014 12:56:45 +0100 > > Subject: [PATCH]

[git pull] IOMMU Updates for Linux v3.19

2014-12-12 Thread Joerg Roedel
Hi Linus, The following changes since commit fc14f9c1272f62c3e8d01300f52467c0d9af50f9: Linux 3.18-rc5 (2014-11-16 16:36:20 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-updates-v3.19 for you to fetch changes up to 76

[v3 24/26] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked

2014-12-12 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 - Clear 'SN' - Set 'NV' to POSTED_INTR_WAKEUP_VECTOR post-block: - Remove the vCPU from the per-CPU list Signed-off-by: Feng Wu --- arch/x86/include/asm/kvm_host.h |

[v3 26/26] iommu/vt-d: Add a command line parameter for VT-d posted-interrupts

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

[v3 23/26] KVM: Update Posted-Interrupts Descriptor when vCPU is preempted

2014-12-12 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 -

[v3 25/26] KVM: Suppress posted-interrupt when 'SN' is set

2014-12-12 Thread Feng Wu
Currently, we don't support urgent interrupt, all interrupts are recognized as non-urgent interrupt, so we cannot send posted-interrupt when 'SN' is set. Signed-off-by: Feng Wu --- arch/x86/kvm/vmx.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx

[v3 22/26] KVM: Define a wakeup worker thread for vCPU

2014-12-12 Thread Feng Wu
Define a wakeup worker thread for a vCPU. Signed-off-by: Feng Wu --- include/linux/kvm_host.h | 1 + virt/kvm/kvm_main.c | 9 + 2 files changed, 10 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index ca9a393..3d7242c 100644 --- a/include/linux/kvm_h

[v3 18/26] KVM: kvm-vfio: User API for VT-d Posted-Interrupts

2014-12-12 Thread Feng Wu
This patch adds and documents two new attributes KVM_DEV_VFIO_DEVICE_POST_IRQ and KVM_DEV_VFIO_DEVICE_UNPOST_IRQ in KVM_DEV_VFIO_DEVICE group. The new attributes are used for VT-d Posted-Interrupts. When guest OS changes the interrupt configuration for an assigned device, such as, MSI/MSIx data/ad

[v3 19/26] KVM: kvm-vfio: implement the VFIO skeleton for VT-d Posted-Interrupts

2014-12-12 Thread Feng Wu
This patch adds the kvm-vfio interface for VT-d Posted-Interrrupts. When guests update MSI/MSI-x information for an assigned-device, QEMU will use KVM_DEV_VFIO_DEVICE_POST_IRQ attribute to setup IRTE for VT-d PI. Userspace program can also use KVM_DEV_VFIO_DEVICE_UNPOST_IRQ to change back to irq re

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

2014-12-12 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. Howev

[v3 21/26] x86, irq: Define a global vector for VT-d Posted-Interrupts

2014-12-12 Thread Feng Wu
Currently, we use a global vector as the Posted-Interrupts Notification Event for all the vCPUs in the system. We need to introduce another global vector for VT-d Posted-Interrtups, which will be used to wakeup the sleep vCPU when an external interrupt from a direct-assigned device happens for that

[v3 11/26] KVM: Add some helper functions for Posted-Interrupts

2014-12-12 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. Signed-off-by: Feng Wu --- 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 abdb84f..0b1383e 100644 --- a/arch/x86

[v3 04/26] iommu, x86: Implement irq_set_vcpu_affinity for intel_ir_chip

2014-12-12 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 | 35 +++ 2 files changed, 40 insertions(+) diff --git a/arch/x86/include/a

[v3 10/26] KVM: change struct pi_desc for VT-d Posted-Interrupts

2014-12-12 Thread Feng Wu
Change struct pi_desc for VT-d Posted-Interrupts. Signed-off-by: Feng Wu --- arch/x86/kvm/vmx.c | 15 +-- 1 file 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/kvm/v

[v3 09/26] iommu, x86: define irq_remapping_cap()

2014-12-12 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

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

2014-12-12 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 file changed, 32 insertions(+) diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 8473756..c7f9cda 100644 --- a/in

[v3 12/26] KVM: Initialize VT-d Posted-Interrupts Descriptor

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

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

2014-12-12 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 file changed, 1 insertion(+) diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index ecaf3a9..8174ae8 100644 --- a/includ

[v3 17/26] KVM: make kvm_set_msi_irq() public

2014-12-12 Thread Feng Wu
Make kvm_set_msi_irq() public, we can use this function outside. Signed-off-by: Feng Wu --- include/linux/kvm_host.h | 2 ++ virt/kvm/irq_comm.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index cfa85ac..5cd4420 1

[v3 20/26] KVM: x86: kvm-vfio: VT-d posted-interrupts setup

2014-12-12 Thread Feng Wu
This patch defines macro __KVM_HAVE_ARCH_KVM_VFIO_POST and implement kvm_arch_vfio_update_pi_irte for x86 architecture. Signed-off-by: Feng Wu --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/kvm/Makefile | 2 +- arch/x86/kvm/kvm_vfio_x86.c | 77 ++

[v3 16/26] KVM: Make struct kvm_irq_routing_table accessible

2014-12-12 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/include

[v3 15/26] KVM: add interfaces to control PI outside vmx

2014-12-12 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 --- arch/x86/include/asm/kvm_host.h | 3 +++ arch/x86/kvm/vmx.c | 13 + 2 files changed, 16 insertions(+) diff --git a/arch/x86/include/asm/kvm_h

[v3 05/26] x86, irq: Implement irq_set_vcpu_affinity for pci_msi_ir_controller

2014-12-12 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(+) diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c index da163da

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

2014-12-12 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

[v3 08/26] iommu, x86: Add intel_irq_remapping_capability() for Intel

2014-12-12 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 files c

[v3 14/26] KVM: Get Posted-Interrupts descriptor address from struct kvm_vcpu

2014-12-12 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(+) diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kv

[v3 02/26] iommu: Add new member capability to struct irq_remap_ops

2014-12-12 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_rem

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

2014-12-12 Thread Feng Wu
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 to a specific virt

[v3 00/26] Add VT-d Posted-Interrupts support

2014-12-12 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

Re: [PATCH] memory: Add NVIDIA SMMU suspend/resume support

2014-12-12 Thread Alexandre Courbot
Hi Mark, On Mon, Dec 8, 2014 at 3:20 PM, Mark Zhang wrote: > This patch adds suspend/resume support for NVIDIA SMMU. > This patch is created on top of Thierry Reding's patch set: > > "[PATCH v7 00/12] NVIDIA Tegra memory controller and IOMMU support" You should have this comment under the "---