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

2015-06-05 Thread Marcelo Tosatti
On Tue, Apr 14, 2015 at 07:37:44AM +, Wu, Feng wrote: > > > > -Original Message- > > From: Marcelo Tosatti [mailto:mtosa...@redhat.com] > > Sent: Tuesday, March 31, 2015 7:56 AM > > To: Wu, Feng > > Cc: h...@zytor.com; t...@linutronix.de; mi...@redhat.com; x...@kernel.org; > > g...@ke

Re: [PATCH 00/22 v2] Introduce default domains for iommu groups

2015-06-05 Thread jroe...@suse.de
Hi Will, Thanks for having a look! On Fri, Jun 05, 2015 at 03:22:06PM +0100, Will Deacon wrote: > > Most of this looks fine to me, modulo by comments about the dm regions > (which I'm not sure how to implement for ARM). When there are no direct mapping requirements from the firmware on ARM, you

Re: [PATCH 10/22] iommu: Introduce direct mapped region handling

2015-06-05 Thread jroe...@suse.de
Hi Will, On Fri, Jun 05, 2015 at 03:17:50PM +0100, Will Deacon wrote: > On Thu, May 28, 2015 at 05:41:33PM +0100, Joerg Roedel wrote: > > +/** > > + * struct iommu_dm_region - descriptor for a direct mapped memory region > > + * @list: Linked list pointers > > + * @start: System physical start add

Re: [PATCH 00/22 v2] Introduce default domains for iommu groups

2015-06-05 Thread Will Deacon
Hi Joerg, On Thu, May 28, 2015 at 05:41:23PM +0100, Joerg Roedel wrote: > here is the second version of my patch-set to introduce > default domains into the iommu core. This time it has a lot > more patches, mostly because I added a proof of concept > implementation by converting the AMD IOMMU dri

[PATCH 13/17] iommu/vt-d: Split up iommu_set_irq_remapping

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel Split out the part that enables irq remapping into the new function iommu_enable_irq_remapping. This allows to program the irq remapping table to the hardware without enabling irq remapping. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/intel_irq_remap

[PATCH 17/17] iommu/vt-d: Remove update code for old ir-table

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel The code to update the irq remapping table of the old kernel is not necessary anymore because we switch immidiatly to the new table after we copied the data over. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/intel_irq_remapping.c | 44

[PATCH 14/17] iommu/vt-d: Move kdump pointer intialization to __iommu_load_old_irte

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel We initialize the base_old_phys and base_old_virt in this function. This cleans up the caller and makes the code more readable. Also add a check for the size of the irq remapping table of the old kernel, break out if it does not match our size. Rename the function to iommu_load

[PATCH 12/17] iommu/vt-d: Move EIM detection to intel_prepare_irq_remapping

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel This needs to be set up before the ir-table can be programmed to the iommu hardware register. This programming will be moved to intel_setup_irq_remapping, so EIM needs to be set up earlier too. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/intel_irq_re

Re: [PATCH 10/22] iommu: Introduce direct mapped region handling

2015-06-05 Thread Will Deacon
Hi Joerg, On Thu, May 28, 2015 at 05:41:33PM +0100, Joerg Roedel wrote: > From: Joerg Roedel > > Add two new functions to the IOMMU-API to allow the IOMMU > drivers to export the requirements for direct mapped regions > per device. > This is useful for exporting the information in Intel VT-d's >

[PATCH 16/17] iommu/vt-d: Copy old irte in intel_setup_irq_remapping

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel Copy over the old irq remapping table in the intel_setup_irq_remapping function. The reason is that intel_enable_irq_remapping runs with irqs disabled and thus we can not safely call ioremap. Therefore we need to copy in the prepare stage when irqs are still enabled. Tested-by

[PATCH 15/17] iommu/vt-d: Mark irt entries from old kernel as allocated

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel After we copied over all irq remapping entries from the old kernel we need to mark the present entries as allocated in our table too. Otherwise we might overwrite entries from the previous kernel and cause DMAR faults. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- d

[PATCH 09/17] iommu/vt-d: Clean up log messages in intel-iommu.c

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel Give them a common prefix and fix some message spellings. Also make the meaning of some messages more clear. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/dmar.c| 26 ++--- drivers/iommu/intel-iommu.c | 46 ++

[PATCH 03/17] iommu/vt-d: Make two functions static

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel These functions are only used in intel-iommu.c and can be static: * __iommu_load_from_oldmem() * __iommu_free_mapped_mem() Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 5 +++-- include/linux/intel-iommu.h | 4 2 f

[PATCH 06/17] iommu/vt-d: Rework loading of old root-entry table

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel Instead of keeping pointers to the old data structures around forever, just map the old root entry table to copy the context entries and make the new table immidiatly visible to the hardware. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c

[PATCH 11/17] iommu/vt-d: Move QI initialization to intel_setup_irq_remapping

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel This function needs a working QI later when kdump recovery is moved to this function. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/intel_irq_remapping.c | 63 ++--- 1 file changed, 16 insertions(+), 47 deletions(-) dif

[PATCH 05/17] iommu/vt-d: Mark root-entry present in set_root_entry

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel When we do no memcpy from the old to the new kernel for the root entry table, we have to set the present bit ourself. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/driv

[PATCH 07/17] iommu/vt-d: Copy context-tables outside of spin_lock

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel This allows to to ioremap_nocache and iounmap in the same path, so we don't need to collect all pointers returned from ioremap to free them after the spinlock is released. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 127 ++

[PATCH 01/17] iommu/vt-d: Fix compile error when CONFIG_INTEL_IOMMU=n

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel The patches for the Intel IOMMU driver to fix issues with kdump introduced a compile error with: CONFIG_DMAR_TABLE=y CONFIG_INTEL_IOMMU=n CONFIG_IRQ_REMAP=y The error manifests as: drivers/iommu/intel_irq_remapping.c: In function ‘modify_irte’: drivers/iommu/intel_irq_remapp

[PATCH 00/17] Fixes and Cleanups for the Intel VT-d driver

2015-06-05 Thread Joerg Roedel
Hey, here are a couple of patches to fix the fall-out from the patch set fixing the kdump faults with VT-d enabled. A few important issues have been fixed: * Moved sleeping functions out of atomic sections, mainly iremap_cache/iounmap. * Mark domain ids used in the old

[PATCH 04/17] iommu/vt-d: Load old data structures only in kdump kernel

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel If we are not in a kdump kernel anybody could have left the iommu enabled. We have no reason at all to trust the data the data structures in this case, so don't even try to preserve anything. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c

[PATCH 02/17] iommu/vt-d: Remove __iommu_save_to_oldmem() function

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel This function is unused and can be removed. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/intel-iommu.c | 36 include/linux/intel-iommu.h | 2 -- 2 files changed, 38 deletions(-) diff --git a/drivers/iommu/intel-i

[PATCH 10/17] iommu/vt-d: Allocate irq remapping table bitmap with GFP_KERNEL

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel This function does not run in atomic context, so no reason to do a GFP_ATOMIC allocation. Tested-by: Baoquan He Signed-off-by: Joerg Roedel --- drivers/iommu/intel_irq_remapping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/intel_irq_re

[PATCH 08/17] iommu/vt-d: Don't reuse domain-ids from old kernel

2015-06-05 Thread Joerg Roedel
From: Joerg Roedel Change the context table copy code to copy context entrys one by one and check whether they are present and mark the used domain-id as reserved in the allocation bitmap. This way the domain-id will not be reused by new domains allocated in the kdump kernel. Tested-by: Baoquan

Re: [v9 0/9] Add VT-d Posted-Interrupts support - IOMMU part

2015-06-05 Thread Joerg Roedel
On Fri, Jun 05, 2015 at 01:47:06PM +0200, Thomas Gleixner wrote: > On Fri, 5 Jun 2015, Feng Wu wrote: > > Divide the whole series which contain multiple components into three parts: > > - Prerequisite changes to irq subsystem (already merged in tip tree > > x86/apic branch) > > - IOMMU part (in th

Re: [PATCH v2 5/6] iommu/mediatek: Add mt8173 IOMMU driver

2015-06-05 Thread Will Deacon
On Fri, May 15, 2015 at 10:43:28AM +0100, Yong Wu wrote: > This patch adds support for mediatek m4u (MultiMedia Memory Management Unit). After looking at the page table code, I thought I'd come and check your TLB invalidate code here. > +static void mtk_iommu_tlb_flush_all(void *cookie) > +{ > +

Re: [PATCH v2 3/6] iommu: add ARM short descriptor page table allocator.

2015-06-05 Thread Will Deacon
Hello, Thanks for the patch, it's good to see another user of the generic IO page-table code. However, I have quite a lot of comments on the code. On Fri, May 15, 2015 at 10:43:26AM +0100, Yong Wu wrote: > This patch is for ARM Short Descriptor Format.It has 2-levels > pagetable and the allocator

Re: [v9 0/9] Add VT-d Posted-Interrupts support - IOMMU part

2015-06-05 Thread Thomas Gleixner
On Fri, 5 Jun 2015, Feng Wu wrote: > Divide the whole series which contain multiple components into three parts: > - Prerequisite changes to irq subsystem (already merged in tip tree x86/apic > branch) > - IOMMU part (in this series) Please add Reviewed-by: Thomas Gleixner Which tree should t

[git pull] IOMMU Fix for Linux v4.1-rc6

2015-06-05 Thread Joerg Roedel
Hi Linus, The following changes since commit c65b99f046843d2455aa231747b5a07a999a9f3d: Linux 4.1-rc6 (2015-05-31 19:01:07 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v4.1-rc6 for you to fetch changes up to 2d

Re: Master-aware devices and sideband ID data

2015-06-05 Thread Will Deacon
On Thu, Jun 04, 2015 at 11:19:30PM +0100, Chalamarla, Tirumalesh wrote: > > On Jun 1, 2015, at 3:22 AM, Mark Rutland wrote: > > It's possible to specify that the paths exist. I expect that software > > would select which to use at runtime. > > > My worry is how to define any priorities/preference