Re: [PATCH 0/6] trivial cleanup for iommu/vt-d

2014-07-04 Thread Joerg Roedel
:00 2001 From: Joerg Roedel jroe...@suse.de Date: Fri, 4 Jul 2014 11:19:10 +0200 Subject: [PATCH] iommu/vt-d: Don't use magic number in dma_pte_superpage Use the already defined DMA_PTE_LARGE_PAGE for testing instead of hardcoding the value again. Signed-off-by: Joerg Roedel jroe...@suse.de

Re: [PATCH 0/7] iommu: Fix DMA alias problems

2014-07-04 Thread Joerg Roedel
On Thu, Jul 03, 2014 at 09:51:12AM -0600, Alex Williamson wrote: Alex Williamson (7): iommu: Remove pci.h iommu/fsl: Use iommu_group_get_for_dev() for IOMMU groups iommu/intel: Update to use PCI DMA aliases iommu/intel: Use iommu_group_get_for_dev() iommu/amd:

Re: [PATCH 0/3] iommu: Expose IOMMU information in sysfs

2014-07-04 Thread Joerg Roedel
On Thu, Jun 12, 2014 at 04:12:18PM -0600, Alex Williamson wrote: Alex Williamson (3): iommu: Add sysfs support for IOMMUs iommu/intel: Make use of IOMMU sysfs support iommu/amd: Add sysfs support Documentation/ABI/testing/sysfs-class-iommu| 17 +++

Re: [PATCH 1/1] drivers/iommu/omap-iovmm.c: use PAGE_ALIGNED instead of IS_ALIGNED(PAGE_SIZE

2014-07-04 Thread Joerg Roedel
On Sat, Jun 14, 2014 at 11:58:34PM +0200, Fabian Frederick wrote: use mm.h definition Cc: Joerg Roedel j...@8bytes.org Cc: io...@lists.linux-foundation.org Signed-off-by: Fabian Frederick f...@skynet.be --- drivers/iommu/omap-iovmm.c | 10 +- 1 file changed, 5 insertions(+), 5

Re: [PATCH 1/3] iommu/fsl: Fix PAMU window size check.

2014-07-04 Thread Joerg Roedel
On Tue, Jun 24, 2014 at 07:27:15PM +0530, Varun Sethi wrote: /* window size is 2^(WSE+1) bytes */ - return __ffs(addrspace_size) - 1; + return fls64(addrspace_size) - 2; This looks bogus, why do you replace ffs (find-first-bit) by fls (find-last-bit)? Joerg -- To

Re: [PATCH 2/3] iommu/fsl: Fix the device domain attach condition.

2014-07-04 Thread Joerg Roedel
Hmm, On Tue, Jun 24, 2014 at 07:27:16PM +0530, Varun Sethi wrote: - old_domain_info = find_domain(dev); + old_domain_info = dev-archdata.iommu_domain; if (old_domain_info old_domain_info-domain != dma_domain) { spin_unlock_irqrestore(device_domain_lock, flags);

Re: [RFC 01/10] iommu: Add IOMMU device registry

2014-07-04 Thread Joerg Roedel
On Thu, Jun 26, 2014 at 10:49:41PM +0200, Thierry Reding wrote: Add an IOMMU device registry for drivers to register with and implement a method for users of the IOMMU API to attach to an IOMMU device. This allows to support deferred probing and gives the IOMMU API a convenient hook to perform

Re: [PATCH 1/1] iommu/fsl_pamu: Remove unnecessary null test before kfree

2014-07-04 Thread Joerg Roedel
On Sun, Jun 29, 2014 at 10:01:26AM +0200, Fabian Frederick wrote: Fix checkpatch warning: WARNING: kfree(NULL) is safe this check is probably not required Applied, thanks. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to

Re: [PATCH v2] iommu/vt-d: race setting IRQ CPU affinity while freeing IRQ

2014-07-29 Thread Joerg Roedel
On Wed, Jul 23, 2014 at 10:13:26AM -0600, Greg Edwards wrote: A user process setting the CPU affinity of an IRQ for a KVM direct-assigned device via /proc/irq/IRQ#/smp_affinity can race with the IRQ being released by QEMU, resulting in a NULL iommu pointer dereference in get_irte(). Maybe I

Re: [Patch Part3 V4 00/21] Enable support of Intel DMAR device hotplug

2014-07-29 Thread Joerg Roedel
On Fri, Jul 11, 2014 at 02:19:24PM +0800, Jiang Liu wrote: Patch 1-13 are bugfixes and code improvement for current drivers. Okay, I applied these for now (1-13 only) so that you don't have to rebase everything next time. Patch 14-17 enhances DMAR framework to support hotplug Patch 18

Re: [RESEND PATCH v2] iommu/intel: Exclude devices using RMRRs from IOMMU API domains

2014-07-29 Thread Joerg Roedel
On Thu, Jul 03, 2014 at 09:57:02AM -0600, Alex Williamson wrote: The user of the IOMMU API domain expects to have full control of the IOVA space for the domain. RMRRs are fundamentally incompatible with that idea. We can neither map the RMRR into the IOMMU API domain, nor can we guarantee

Re: [PATCH] iommu/exynos: Select ARM_DMA_USE_IOMMU

2014-07-29 Thread Joerg Roedel
On Fri, Jul 04, 2014 at 03:01:08PM +0530, Tushar Behera wrote: For IOMMU to use on Exynos platforms, we need to enable ARM_DMA_USE_IOMMU. It would be better to select it by default when EXYNOS_IOMMU is enabled. Signed-off-by: Tushar Behera tusha...@samsung.com Applied, thanks. Please always

[PATCH 1/3] mmu_notifier: Add mmu_notifier_invalidate_range()

2014-07-29 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de This notifier closes two important gaps with the current invalidate_range_start()/end() notifiers. The _start() part is called when all pages are still mapped while the _end() notifier is called when all pages are potentially unmapped and already freed

[PATCH 0/3 v2] mmu_notifier: Allow to manage CPU external TLBs

2014-07-29 Thread Joerg Roedel
, Joerg Joerg Roedel (3): mmu_notifier: Add mmu_notifier_invalidate_range() mmu_notifier: Call mmu_notifier_invalidate_range() from VMM mmu_notifier: Add the call-back for mmu_notifier_invalidate_range() include/linux/mmu_notifier.h | 75

[PATCH 2/3] mmu_notifier: Call mmu_notifier_invalidate_range() from VMM

2014-07-29 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Add calls to the new mmu_notifier_invalidate_range() function to all places if the VMM that need it. Signed-off-by: Joerg Roedel jroe...@suse.de --- include/linux/mmu_notifier.h | 28 kernel/events/uprobes.c | 2 +- mm

[PATCH 3/3] mmu_notifier: Add the call-back for mmu_notifier_invalidate_range()

2014-07-29 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Now that the mmu_notifier_invalidate_range() calls are in place, add the call-back to allow subsystems to register against it. Signed-off-by: Joerg Roedel jroe...@suse.de --- include/linux/mmu_notifier.h | 37 - mm

Re: [PATCH v4] devicetree: Add generic IOMMU device tree bindings

2014-07-30 Thread Joerg Roedel
On Wed, Jul 30, 2014 at 03:23:50PM +0200, Thierry Reding wrote: I think there weren't any comments left for me to address and I've mostly been waiting for Joerg to pick it up. Joerg, can you take this through the iommu tree for 3.17? Will acked this, but perhaps you were waiting for an ACK

[PATCH 3/4] iommu/amd: Fix device_state reference counting

2014-07-30 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de The references to the device state are not dropped everywhere. This might cause a dead-lock in amd_iommu_free_device(). Fix it. Signed-off-by: Joerg Roedel jroe...@suse.de Tested-by: Oded Gabbay oded.gab...@amd.com --- drivers/iommu/amd_iommu_v2.c | 7

[PATCH 1/4] iommu/amd: Don't set pasid_state-mm to NULL in unbind_pasid

2014-07-30 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de With calling te mmu_notifier_register function we hold a reference to the mm_struct that needs to be released in mmu_notifier_unregister. This is true even if the notifier was already unregistered from exit_mmap and the .release call-back has already run. So

[PATCH 2/4] iommu/amd: Remove change_pte mmu_notifier call-back

2014-07-30 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de All calls to this call-back are wrapped with mmu_notifer_invalidate_range_start()/end(), making this notifier pretty useless, so remove it. Signed-off-by: Joerg Roedel jroe...@suse.de Tested-by: Oded Gabbay oded.gab...@amd.com --- drivers/iommu/amd_iommu_v2.c

[PATCH 4/4] iommu/amd: Fix 2 typos in comments

2014-07-30 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de amd_iommu_pasid_bind - amd_iommu_bind_pasid Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/amd_iommu_v2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/amd_iommu_v2.c b/drivers/iommu/amd_iommu_v2.c index

[PATCH 4/6] PM / Hibernate: Iterate over set bits instead of PFNs in swsusp_free()

2014-07-18 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de The existing implementation of swsusp_free iterates over all pfns in the system and checks every bit in the two memory bitmaps. This doesn't scale very well with large numbers of pfns, especially when the bitmaps are not populated very densly. Change

[PATCH 3/6] PM / Hibernate: Implement position keeping in radix tree

2014-07-18 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Add code to remember the last position that was requested in the radix tree. Use it as a cache for faster linear walking of the bitmap in the memory_bm_rtree_next_pfn() function which is also added with this patch. Signed-off-by: Joerg Roedel jroe...@suse.de

[PATCH 2/6] PM / Hibernate: Add memory_rtree_find_bit function

2014-07-18 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Add a function to find a bit in the radix tree for a given pfn. Also add code to the memory bitmap wrapper functions to use the radix tree together with the existing memory bitmap implementation. On read accesses compare the results of both bitmaps to make sure

[PATCH 5/6] PM / Hibernate: Remove the old memory-bitmap implementation

2014-07-18 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de The radix tree implementatio is proved to work the same as the old implementation now. So the old implementation can be removed to finish the switch to the radix tree for the memory bitmaps. Signed-off-by: Joerg Roedel jroe...@suse.de --- kernel/power

[PATCH 1/6] PM / Hibernate: Create a Radix-Tree to store memory bitmap

2014-07-18 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de This patch adds the code to allocate and build the radix tree to store the memory bitmap. The old data structure is left in place until the radix tree implementation is finished. Signed-off-by: Joerg Roedel jroe...@suse.de --- kernel/power/snapshot.c | 224

[PATCH 6/6] PM / Hibernate: Touch Soft Lockup Watchdog in rtree_next_node

2014-07-18 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de When a memory bitmap is fully populated on a large memory machine (several TB of RAM) it can take more than a minute to walk through all bits. This causes the soft lockup detector on these machine to report warnings. Avoid this by touching the soft lockup

[PATCH 0/6] PM / Hibernate: Memory bitmap scalability improvements

2014-07-18 Thread Joerg Roedel
on these results these patches improve the scalability significantly. Please review, any comments appreciated. Thanks, Joerg Joerg Roedel (6): PM / Hibernate: Create a Radix-Tree to store memory bitmap PM / Hibernate: Add memory_rtree_find_bit function PM / Hibernate: Implement position

[git pull] IOMMU Fixes for Linux v3.16-rc5

2014-07-18 Thread Joerg Roedel
Hi Linus, The following changes since commit cd3de83f147601356395b57a8673e9c5ff1e59d1: Linux 3.16-rc4 (2014-07-06 12:37:51 -0700) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v3.16-rc5 for you to fetch changes up to

Re: [PATCH 04/29] drivers: base: add notifier for failed driver bind

2014-08-25 Thread Joerg Roedel
On Tue, Aug 05, 2014 at 12:47:32PM +0200, Marek Szyprowski wrote: + if (failed dev-bus) + blocking_notifier_call_chain(dev-bus-p-bus_notifier, + BUS_NOTIFY_DRVBIND_FAILED, dev); + Why can't you just use the notifier for

[PATCH 4/4] iommu/amd: Remove device binding reference count

2014-08-26 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de This reference count is not used anymore, as all devices in an alias group are now attached and detached together. Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/amd_iommu.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/iommu

[PATCH 0/4] AMD IOMMU: Assign/de-assign complete alias groups

2014-08-26 Thread Joerg Roedel
, Joerg Joerg Roedel (4): iommu/amd: Move struct iommu_dev_data to amd_iommu.c iommu/amd: Keep a list of devices in an alias group iommu/amd: Attach and detach complete alias group iommu/amd: Remove device binding reference count drivers/iommu/amd_iommu.c | 74

[PATCH 2/4] iommu/amd: Keep a list of devices in an alias group

2014-08-26 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Some broken devices might use any request-id from the alias group, so we need to set a DTE entry for every device in there. This patch adds creation of those lists. Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/amd_iommu.c | 6 ++ 1 file

[PATCH 3/4] iommu/amd: Attach and detach complete alias group

2014-08-26 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Change tha device attach and detach semantic to apply to all devices in an alias group. This means all devices in an alias group are now attached and detached at the same time. Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/amd_iommu.c | 46

[PATCH 1/4] iommu/amd: Move struct iommu_dev_data to amd_iommu.c

2014-08-26 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de The struct is only used there, so it doesn't need to be in the header file. Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/amd_iommu.c | 21 + drivers/iommu/amd_iommu_types.h | 21 - 2 files changed

Re: [PATCH v4] devicetree: Add generic IOMMU device tree bindings

2014-07-31 Thread Joerg Roedel
On Thu, Jul 31, 2014 at 12:18:08PM +0200, Thierry Reding wrote: It looks like this hasn't been applied yet, so I can send out a v5 shortly with the requested changes addressed. Yes, please send a v5 with the requested changes and all Reviewed-bys and Acked-bys this got so far. I'll take it into

Re: [PATCH v2] iommu/vt-d: race setting IRQ CPU affinity while freeing IRQ

2014-07-31 Thread Joerg Roedel
On Tue, Jul 29, 2014 at 11:21:58AM -0600, Greg Edwards wrote: [ 6638.327851] BUG: unable to handle kernel NULL pointer dereference at 0090 [ 6638.335955] IP: [8190a652] intel_ioapic_set_affinity+0x82/0x1b0 [ 6638.343012] PGD 99172e067 PUD 1026979067 PMD 0 [ 6638.347858]

[PATCH] iommu/vt-d: Do not BUG_ON in intel_unmap if no domain

2014-08-04 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de This BUG_ON is easy to trigger with device-hotplug (e.g. SR-IOV). The device_notifier function in the Intel IOMMU driver listens to the BUS_NOTIFY_DEL_DEVICE event and frees the domain for the device if it is reveived. But this event is triggered before

Re: [PATCH] iommu/vt-d: Do not BUG_ON in intel_unmap if no domain

2014-08-04 Thread Joerg Roedel
On Mon, Aug 04, 2014 at 01:42:05PM +0200, Borislav Petkov wrote: It is always questionable when people remove BUG_ONs because relaxing assertions sound like a temporary fix more often than not. Sounds to me that the original commit which deals with BUS_NOTIFY_DEL_DEVICE needs to try again with

[PATCH 2/2] iommu/vt-d: Check return value of acpi_bus_get_device()

2014-08-21 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Checking adev == NULL is not sufficient as acpi_bus_get_device() might not touch the value of this parameter in an error case, so check the return value directly. Fixes: ed40356b5fcf1ce28e026ab39c5b2b6939068b50 Cc: David Woodhouse dw...@infradead.org Signed-off

[PATCH 0/2] More IOMMU Fixes

2014-08-21 Thread Joerg Roedel
Hi, here are two patches that fix valid issues discovered by Coverity. Please review. Thanks, Joerg Joerg Roedel (2): iommu: Make iommu_group_get_for_dev() more robust iommu/vt-d: Check return value of acpi_bus_get_device() drivers/iommu/dmar.c | 3 +-- drivers/iommu/iommu.c | 8

[PATCH 1/2] iommu: Make iommu_group_get_for_dev() more robust

2014-08-21 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de When a non-PCI device is passed to that function it might pass group == NULL to iommu_group_add_device() which then dereferences it and cause a crash this way. Fix it by just returning an error for non-PCI devices. Fixes

[git pull] IOMMU Fixes for Linux v3.17-rc1

2014-08-21 Thread Joerg Roedel
pointer is checked before calling. Joerg Roedel (3): iommu/vt-d: Defer domain removal if device is assigned to a driver iommu/amd: Fix cleanup_domain for mass device removal iommu/core: Check for the right function

LPC IOMMU and VFIO MicroConference - Call for Participation

2014-08-12 Thread Joerg Roedel
your formal proposal on the Linux Plumbers website (OpenID login required) until August 31st at: http://www.linuxplumbersconf.org/2014/how-to-submit-microconference-discussions-topics/ Hope to see you in Düsseldorf! Joerg Roedel and Alex Williamson -- To unsubscribe from

Re: [PATCH] iommu/vt-d: fix race between free_irte() and get_irte()

2014-07-23 Thread Joerg Roedel
On Tue, Jul 22, 2014 at 08:27:19AM -0600, Greg Edwards wrote: get_irte() can race with free_irte() and dereference a NULL iommu pointer. Have you seen any real occurance of this race? Get_irte is called in the set_affinity path, how can that race with the irq being freed? Joerg -- To

Re: [PATCH] iommu/vt-d: fix race between free_irte() and get_irte()

2014-07-23 Thread Joerg Roedel
On Wed, Jul 23, 2014 at 08:49:17AM -0600, Greg Edwards wrote: On Wed, Jul 23, 2014 at 04:40:24PM +0200, Joerg Roedel wrote: On Tue, Jul 22, 2014 at 08:27:19AM -0600, Greg Edwards wrote: get_irte() can race with free_irte() and dereference a NULL iommu pointer. Have you seen any real

Re: [Patch Part3 V4 16/21] iommu/vt-d: Implement DMAR unit hotplug framework

2014-07-23 Thread Joerg Roedel
On Fri, Jul 11, 2014 at 02:19:40PM +0800, Jiang Liu wrote: On Intel platforms, an IO Hub (PCI/PCIe host bridge) may contain DMAR units, so we need to support DMAR hotplug when supporting PCI host bridge hotplug on Intel platforms. According to Section 8.8 Remapping Hardware Unit Hot Plug in

[PATCH 2/3] mmu_notifier: Call mmu_notifier_invalidate_range() from VMM

2014-07-24 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Add calls to the new mmu_notifier_invalidate_range() function to all places if the VMM that need it. Signed-off-by: Joerg Roedel jroe...@suse.de --- include/linux/mmu_notifier.h | 28 kernel/events/uprobes.c | 2 +- mm

[PATCH 0/3] mmu_notifier: Allow to manage CPU external TLBs

2014-07-24 Thread Joerg Roedel
that this happens before invalidate_range_end() is called. Any comments and review appreciated! Thanks, Joerg Joerg Roedel (3): mmu_notifier: Add mmu_notifier_invalidate_range() mmu_notifier: Call mmu_notifier_invalidate_range() from VMM mmu_notifier: Add the call-back

[PATCH 3/3] mmu_notifier: Add the call-back for mmu_notifier_invalidate_range()

2014-07-24 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Now that the mmu_notifier_invalidate_range() calls are in place, add the call-back to allow subsystems to register against it. Signed-off-by: Joerg Roedel jroe...@suse.de --- include/linux/mmu_notifier.h | 28 ++-- mm/mmu_notifier.c

[PATCH 1/3] mmu_notifier: Add mmu_notifier_invalidate_range()

2014-07-24 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de This notifier closes an important gap with the current invalidate_range_start()/end() notifiers. The _start() part is called when all pages are still mapped while the _end() notifier is called when all pages are potentially unmapped and already freed. This does

Re: [PATCH 0/3] mmu_notifier: Allow to manage CPU external TLBs

2014-07-25 Thread Joerg Roedel
Hi Andrew, On Thu, Jul 24, 2014 at 04:33:03PM -0700, Andrew Morton wrote: On Thu, 24 Jul 2014 16:35:38 +0200 Joerg Roedel j...@8bytes.org wrote: Any comments and review appreciated! It looks pretty simple and harmless. I assume the AMD IOMMUv2 driver actually uses this and it's all

Re: [PATCH 1/3] mmu_notifier: Add mmu_notifier_invalidate_range()

2014-07-25 Thread Joerg Roedel
On Fri, Jul 25, 2014 at 01:16:39PM -0700, Jesse Barnes wrote: To allow managing external TLBs the MMU-notifiers need to catch the moment when pages are unmapped but not yet freed. This new notifier catches that moment and notifies the interested subsytem when pages that were unmapped are

Re: [PATCH 1/3] mmu_notifier: Add mmu_notifier_invalidate_range()

2014-07-25 Thread Joerg Roedel
On Fri, Jul 25, 2014 at 02:42:13PM -0700, Jesse Barnes wrote: On Fri, 25 Jul 2014 23:38:06 +0200 Joerg Roedel j...@8bytes.org wrote: I though about removing the need for invalidate_range_end too when writing the patches, and possible solutions are 1) Add

[PATCH] iommu/vt-d: Defer domain removal if device is assigned to a driver

2014-08-05 Thread Joerg Roedel
with the fix. :-) Actually, as I thought about it again, there is a better fix for this issue that does not require to remove the BUG_ON :) See attached patch: From 57e2519d5b6e4d8ee840a921300d201ff742c826 Mon Sep 17 00:00:00 2001 From: Joerg Roedel jroe...@suse.de Date: Tue, 5 Aug 2014 12:55:45

[git pull] IOMMU Updates for Linux v3.17

2014-08-05 Thread Joerg Roedel
intel_unmap_sg() and kill duplicated code iommu/vt-d: Introduce helper domain_pfn_within_range() to simplify code iommu/vt-d: Introduce helper function iova_size() to improve code readability iommu/vt-d: Fix issue in computing domain's iommu_snooping flag Joerg Roedel (18

Re: [PATCH 2/2] iommu: Implement a dummy bus_set_iommu()

2014-08-18 Thread Joerg Roedel
On Fri, Aug 01, 2014 at 02:45:13PM +0200, Thierry Reding wrote: From: Thierry Reding tred...@nvidia.com This allows IOMMU drivers to compile even if IOMMU_API is not selected and helps improve compile coverage. IOMMU drivers usually implement the IOMMU-API, so they have a strong dependency

Re: [PATCH] iommu/msm: Switch to using managed resources

2014-08-18 Thread Joerg Roedel
On Mon, Aug 04, 2014 at 05:37:37PM +0530, Pramod Gurav wrote: This switches the driver to using managed resources to simplify error handling and to do away with remove function. CC: Stepan Moskovchenko step...@codeaurora.org CC: Joerg Roedel j...@8bytes.org CC: Stephen Boyd sb

[PATCH 0/3] IOMMU Fixes

2014-08-18 Thread Joerg Roedel
Hi, here are a few fixes for the x86 iommu drivers and a small one for the iommu core-code I plan to send for -rc2. Joerg Joerg Roedel (3): iommu/vt-d: Defer domain removal if device is assigned to a driver iommu/amd: Fix cleanup_domain for mass device removal iommu/core: Check

[PATCH 1/3] iommu/vt-d: Defer domain removal if device is assigned to a driver

2014-08-18 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de When the BUS_NOTIFY_DEL_DEVICE event is received the device might still be attached to a driver. In this case the domain can't be released as the mappings might still be in use. Defer the domain removal in this case until we receivce

[PATCH 3/3] iommu/core: Check for the right function pointer in iommu_map()

2014-08-18 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Check for the -map and not the -unmap pointer. Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 1698360..ac4adb3 100644

[PATCH 2/3] iommu/amd: Fix cleanup_domain for mass device removal

2014-08-18 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de When multiple devices are detached in __detach_device, they are also removed from the domains dev_list. This makes it unsafe to use list_for_each_entry_safe, as the next pointer might also not be in the list anymore after __detach_device returns. So just

Re: [PATCH 1/1] iommu/vt-d : clear old root entry for dump kernel

2014-08-18 Thread Joerg Roedel
On Mon, Aug 18, 2014 at 11:01:56PM +, Li, Zhen-Hua wrote: There is a bug when Linux running on an HP large system: when kdump kernel runs, the hardware is still using the old root entry. This causes error message when iommu not finished initialization. What error message are you

Re: [PATCH 00/29] Exynos SYSMMU (IOMMU) integration with DT and DMA-mapping subsystem

2014-08-18 Thread Joerg Roedel
On Tue, Aug 05, 2014 at 12:47:28PM +0200, Marek Szyprowski wrote: .../devicetree/bindings/iommu/samsung,sysmmu.txt | 93 ++- Documentation/power/notifiers.txt | 14 + arch/arm/boot/dts/exynos4.dtsi | 118 arch/arm/boot/dts/exynos4210.dtsi

Re: [PATCH 1/1] iommu/vt-d : clear old root entry for dump kernel

2014-08-19 Thread Joerg Roedel
On Mon, Aug 18, 2014 at 11:27:01PM +, Li, Zhen-Hua wrote: : [fault reason 01] Present bit in root entry is clear It appears when iommu initializing in the kdump kernel. Hmm, do you have an explanation how this can happen? From how I read the code, the kdump kernel disables translation on

Re: [PATCH] iommu/vt-d: Don't store SIRTP request

2014-08-19 Thread Joerg Roedel
On Mon, Aug 11, 2014 at 01:13:25PM +0200, Jan Kiszka wrote: Don't store the SIRTP request bit in the register state. It will otherwise become sticky and could request an Interrupt Remap Table Pointer update on each command register write. Found while starting to emulate IR in QEMU, not by

Re: [PATCH 1/1] iommu/vt-d: Add new macros for invalidation event

2014-08-19 Thread Joerg Roedel
On Fri, Aug 15, 2014 at 09:55:51AM +0800, Li, Zhen-Hua wrote: According to intel's spec Intel® Virtualization Technology for Directed I/O, Revision: 1.3 , February 2011, Chaper 10.4.25 to 10.4.28 There are four registers IECTL_REG 0xa0Invalidation

Re: [PATCH] iommu: Replace rcu_assign_pointer() with RCU_INIT_POINTER()

2014-08-19 Thread Joerg Roedel
On Mon, Aug 18, 2014 at 03:20:56PM +0300, Andreea-Cristina Bernat wrote: The use of rcu_assign_pointer() is NULLing out the pointer. According to RCU_INIT_POINTER()'s block comment: 1. This use of RCU_INIT_POINTER() is NULLing out the pointer it is better to use it instead of

Re: [PATCH linux-next] iommu: add iommu for s390 platform

2014-10-23 Thread Joerg Roedel
On Wed, Oct 22, 2014 at 05:43:20PM +0200, Frank Blaschka wrote: Basically there are no limitations. Depending on the s390 maschine generation a device starts its IOVA at a specific address (announced by the HW). But as I already told each device starts at the same address. I think this

Re: [PATCH linux-next] iommu: add iommu for s390 platform

2014-10-24 Thread Joerg Roedel
Hi Frank, On Thu, Oct 23, 2014 at 04:04:37PM +0200, Frank Blaschka wrote: A domain is basically an abstraction for a DMA page table (or a dma_table, as you call it on s390). So you can easily create similar mappings for more than one device with it. the clp instructions reports a

Re: PCIe PASID (Process Address Space ID) and iommu code

2014-10-16 Thread Joerg Roedel
On Wed, Oct 15, 2014 at 09:50:58PM -0600, Bjorn Helgaas wrote: [+cc Joerg, Suravee, Jay, iommu list, linux-pci] On Wed, Oct 15, 2014 at 5:44 PM, Kallol Biswas nucleod...@gmail.com wrote: Resending, as message got bounced for html content. Hi,

Re: [PATCH v5 1/3] iommu/rockchip: rk3288 iommu driver

2014-10-17 Thread Joerg Roedel
On Fri, Oct 17, 2014 at 10:22:13AM +0800, Daniel Kurtz wrote: Gentle ping. Any more feedback on the rockchip iommu driver? I'll look at it in more detail when the merge window is over. Joerg -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a

Re: dmar messages caused by graphics.

2014-10-20 Thread Joerg Roedel
Adding David and Jiang, they might have an idea whats going wrong. On Fri, Oct 17, 2014 at 05:17:16PM -0400, Dave Jones wrote: Just hit this while fuzz-testing, (curiously, no graphics related stuff was happening, X isn't even loaded on that box). dmar: DRHD: handling fault status reg 2

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

2014-10-22 Thread Joerg Roedel
and then re-enable the IOMMU. On Wed, Jul 2, 2014 at 7:32 AM, Joerg Roedel j...@8bytes.org wrote: That is a solution to prevent the in-flight DMA failures. But what happens when there is some in-flight DMA to a disk to write some inodes or a new superblock. Then this scratch address-space may

Re: [PATCH linux-next] iommu: add iommu for s390 platform

2014-10-22 Thread Joerg Roedel
Hi Frank, On Tue, Oct 21, 2014 at 01:57:25PM +0200, Frank Blaschka wrote: Add a basic iommu for the s390 platform. The code is pretty simple since on s390 each PCI device has its own virtual io address space starting at the same vio address. Are there any limitations on IOVA address space for

Re: [PATCH 2/2] iommu: Implement a dummy bus_set_iommu()

2014-10-22 Thread Joerg Roedel
On Wed, Oct 15, 2014 at 11:10:44AM +0200, Thierry Reding wrote: It seems like I never got back to you on this. The reason here is that for Tegra the IOMMU is part of a larger IP block. The IP block is primarily a memory controller with a bunch of configuration knobs for arbitration,

Re: [PATCH] iommu: use dev_get_platdata()

2014-10-22 Thread Joerg Roedel
On Fri, Oct 10, 2014 at 07:01:10PM +0530, Kiran Padwal wrote: Use the wrapper function for retrieving the platform data instead of accessing dev-platform_data directly. Signed-off-by: Kiran Padwal kiran.pad...@smartplayin.com --- drivers/iommu/msm_iommu_dev.c |4 ++--

Re: [PATCH v5 1/3] iommu/rockchip: rk3288 iommu driver

2014-10-22 Thread Joerg Roedel
On Tue, Oct 14, 2014 at 04:02:40PM +0800, Daniel Kurtz wrote: +static void rk_iommu_detach_device(struct iommu_domain *domain, +struct device *dev) +{ + struct rk_iommu *iommu = dev_get_drvdata(dev-archdata.iommu); + struct rk_iommu_domain *rk_domain =

Re: [PATCH 0/3] Rockchip IOMMU driver and devicetree bindings

2014-10-22 Thread Joerg Roedel
On Wed, Oct 01, 2014 at 06:20:40PM +0800, Daniel Kurtz wrote: Add a driver and devicetree bindings for the IOMMU found in Rockchip RK3288 SoCs. Daniel Kurtz (3): iommu/rockchip: rk3288 iommu driver dt-bindings: iommu: Add documentation for rockchip iommu ARM: dts: rk3288: add VOP

[PATCH 02/12] iommu: Convert iommu-caps from define to enum

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Allow compile-time type-checking. Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/iommu.c | 2 +- include/linux/iommu.h | 11 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu

[PATCH 09/12] kvm: iommu: Convert to use new iommu_capable() API function

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Cc: Gleb Natapov g...@kernel.org Cc: Paolo Bonzini pbonz...@redhat.com Signed-off-by: Joerg Roedel jroe...@suse.de --- virt/kvm/iommu.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/virt/kvm/iommu.c b/virt/kvm/iommu.c index 714b949

[PATCH 12/12] iommu: Remove iommu_domain_has_cap() API function

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/iommu.c | 13 - include/linux/iommu.h | 11 --- 2 files changed, 24 deletions(-) diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c index 319d40e..41c6a7d 100644

[PATCH 07/12] iommu/msm: Convert to iommu_capable() API function

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/msm_iommu.c | 7 +++ 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/msm_iommu.c b/drivers/iommu/msm_iommu.c index 49f41d6..6e3dcc28 100644 --- a/drivers/iommu

[PATCH 10/12] vfio: Convert to use new iommu_capable() API function

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Cc: Alex Williamson alex.william...@redhat.com Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/vfio/vfio_iommu_type1.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio

[PATCH 06/12] iommu/vt-d: Convert to iommu_capable() API function

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Cc: Jiang Liu jiang@linux.intel.com Cc: David Woodhouse dw...@infradead.org Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/intel-iommu.c | 13 + 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/intel

[PATCH 11/12] IB/usnic: Convert to use new iommu_capable() API function

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Cc: Upinder Malhi uma...@cisco.com Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/infiniband/hw/usnic/usnic_uiom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/infiniband/hw/usnic/usnic_uiom.c b/drivers/infiniband/hw

[PATCH 03/12] iommu/amd: Convert to iommu_capable() API function

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/amd_iommu.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c index ecb0109..7de9276 100644 --- a/drivers/iommu

[PATCH 08/12] iommu/tegra: Convert to iommu_capable() API function

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Cc: Hiroshi Doyu hd...@nvidia.com Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/tegra-gart.c | 7 +++ drivers/iommu/tegra-smmu.c | 7 +++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/tegra-gart.c b/drivers

[PATCH 04/12] iommu/arm-smmu: Convert to iommu_capable() API function

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Cc: Will Deacon will.dea...@arm.com Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/arm-smmu.c | 35 ++- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm

[PATCH 00/12] iommu: Convert iommu_domain_has_cap() to iommu_capable()

2014-09-05 Thread Joerg Roedel
they are not a function of the domain. This should be reflected in the IOMMU-API. Please review. Thanks, Joerg Joerg Roedel (12): iommu: Introduce iommu_capable API function iommu: Convert iommu-caps from define to enum iommu/amd: Convert to iommu_capable() API function iommu/arm-smmu

[PATCH 05/12] iommu/fsl: Convert to iommu_capable() API function

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de Cc: Varun Sethi varun.se...@freescale.com Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/fsl_pamu_domain.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/fsl_pamu_domain.c b/drivers/iommu/fsl_pamu_domain.c

[PATCH 01/12] iommu: Introduce iommu_capable API function

2014-09-05 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de This function will replace the current iommu_domain_has_cap function and clean up the interface while at it. Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/iommu.c | 18 +++--- include/linux/iommu.h | 7 +++ 2 files changed, 22

Re: [PATCH v2 1/1] iommu/amd: set iommu for early mapped ioapic/hpet

2014-09-05 Thread Joerg Roedel
On Fri, Sep 05, 2014 at 07:25:14PM +0800, Su, Friendy wrote: This issue is found on a mother board whose BIOS reports wrong IOAPIC devid in IVHD table. Without this fix, the early mapped does not really override IVHD. So that the wrong reported IOAPIC does not work. The problem you describe

Re: [PATCH v2] iommu/fsl: Fix warning resulting from adding PCI device twice

2014-09-05 Thread Joerg Roedel
On Thu, Sep 04, 2014 at 05:08:45PM +0530, Varun Sethi wrote: iommu_group_get_for_dev determines the iommu group for the PCI device and adds the device to the group. In the PAMU driver we were again adding the device to the same group without checking if the device already had an iommu

[git pull] IOMMU Fixes for Linux v3.17-rc4

2014-09-12 Thread Joerg Roedel
* Various fixes for the ARM SMMU driver * A warning fix for the FSL PAMU driver Hans Wennborg (1): iommu/arm-smmu: fix decimal printf format specifiers prefixed with 0x Joerg Roedel (3): iommu/core: Make

Re: [PATCH 0/3 v3] mmu_notifier: Allow to manage CPU external TLBs

2014-09-12 Thread Joerg Roedel
Hi Andrew, thanks for your review, I tried to answer your questions below. On Wed, Sep 10, 2014 at 03:01:25PM -0700, Andrew Morton wrote: On Tue, 9 Sep 2014 17:43:51 +0200 Joerg Roedel j...@8bytes.org wrote: So both call-backs can't be used to safely flush any non-CPU TLB because _start

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

2014-09-30 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de This makes sure any RMRR mappings stay in place when the driver is unbound from the device. Signed-off-by: Joerg Roedel jroe...@suse.de --- drivers/iommu/intel-iommu.c | 11 +-- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers

[PATCH 0/2] iommu/vt-d: Keep RMRR mappings around on driver unbind

2014-09-30 Thread Joerg Roedel
change is necessary to catch the right point in time for the IOMMU code to destroy any mappings for a device. With this patch-set the RMRR mappings are only destroyed when the device is actually removed from the system. Please review. Thanks, Joerg Joerg Roedel (2): driver core: Add

[PATCH 1/2] driver core: Add BUS_NOTIFY_REMOVED_DEVICE event

2014-09-30 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de This event closes an important gap in the bus notifiers. There is already the BUS_NOTIFY_DEL_DEVICE event, but that is sent when the device is still bound to its device driver. This is too early for the IOMMU code to destroy any mappings for the device

[PATCH] PM / Hibernate: Iterate over set bits instead of PFNs in swsusp_free()

2014-09-30 Thread Joerg Roedel
From: Joerg Roedel jroe...@suse.de The existing implementation of swsusp_free iterates over all pfns in the system and checks every bit in the two memory bitmaps. This doesn't scale very well with large numbers of pfns, especially when the bitmaps are not populated very densly. Change

<    3   4   5   6   7   8   9   10   11   12   >