Re: [PATCH 1/1] iommu/vt-d: Correctly check format of page table in debugfs

2019-08-08 Thread Lu Baolu
Hi Joerg, Just a friendly reminder. What do you think of this fix? Best regards, Lu Baolu On 7/20/19 10:01 AM, Lu Baolu wrote: PASID support and enable bit in the context entry isn't the right indicator for the type of tables (legacy or scalable mode). Check the DMA_RTADDR_SMT bit in the root

Re: [PATCH 1/2] iommu/vt-d: Detach domain before using a private one

2019-08-08 Thread Lu Baolu
Hi Alex, On 8/9/19 4:10 AM, Alex Williamson wrote: On Tue, 6 Aug 2019 08:14:08 +0800 Lu Baolu wrote: When the default domain of a group doesn't work for a device, the iommu driver will try to use a private domain. The domain which was previously attached to the device must be detached. Cc:

Re: [PATCH 2/2] iommu/vt-d: Fix possible use-after-free of private domain

2019-08-08 Thread Alex Williamson
On Tue, 6 Aug 2019 08:14:09 +0800 Lu Baolu wrote: > Multiple devices might share a private domain. One real example > is a pci bridge and all devices behind it. When remove a private > domain, make sure that it has been detached from all devices to > avoid use-after-free case. > > Cc: Ashok Raj

Re: [PATCH 1/2] iommu/vt-d: Detach domain before using a private one

2019-08-08 Thread Alex Williamson
On Tue, 6 Aug 2019 08:14:08 +0800 Lu Baolu wrote: > When the default domain of a group doesn't work for a device, > the iommu driver will try to use a private domain. The domain > which was previously attached to the device must be detached. > > Cc: Ashok Raj > Cc: Jacob Pan > Cc: Kevin Tian

Re: [PATCH 3/8] of/fdt: add function to get the SoC wide DMA addressable memory size

2019-08-08 Thread Nicolas Saenz Julienne
On Thu, 2019-08-08 at 09:02 -0600, Rob Herring wrote: > On Tue, Aug 6, 2019 at 12:12 PM Nicolas Saenz Julienne > wrote: > > Hi Rob, > > > > On Mon, 2019-08-05 at 13:23 -0600, Rob Herring wrote: > > > On Mon, Aug 5, 2019 at 10:03 AM Nicolas Saenz Julienne > > > wrote: > > > > Hi Rob, > > > > Than

Re: [PATCH v3 1/4] firmware: qcom_scm-64: Add atomic version of qcom_scm_call

2019-08-08 Thread Will Deacon
On Thu, Aug 08, 2019 at 05:05:21PM +0530, Vivek Gautam wrote: > On Tue, Aug 6, 2019 at 3:58 AM Bjorn Andersson > wrote: > > Would you be able to respin this patch, so that we could unblock the > > introduction of the display nodes in the various device? > > Will pointed [1] to the restructuring o

[PATCH 8/8] dma-mapping: remove CONFIG_ARCH_NO_COHERENT_DMA_MMAP

2019-08-08 Thread Christoph Hellwig
CONFIG_ARCH_NO_COHERENT_DMA_MMAP is now functionally identical to !CONFIG_MMU, so remove the separate symbol. The only difference is that arm did not set it for !CONFIG_MMU, but arm uses a separate dma mapping implementation including its own mmap method, which is handled by moving the CONFIG_MMU

[PATCH 7/8] parisc: don't set ARCH_NO_COHERENT_DMA_MMAP

2019-08-08 Thread Christoph Hellwig
parisc is the only architecture that sets ARCH_NO_COHERENT_DMA_MMAP when an MMU is enabled. AFAIK this is because parisc CPUs use VIVT caches, which means exporting normally cachable memory to userspace is relatively dangrous due to cache aliasing. But normally cachable memory is only allocated b

[PATCH 2/8] dma-mapping: move the dma_get_sgtable API comments from arm to common code

2019-08-08 Thread Christoph Hellwig
The comments are spot on and should be near the central API, not just near a single implementation. Signed-off-by: Christoph Hellwig --- arch/arm/mm/dma-mapping.c | 11 --- kernel/dma/mapping.c | 11 +++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/arch/a

[PATCH 6/8] arm-nommu: call dma_mmap_from_dev_coherent directly

2019-08-08 Thread Christoph Hellwig
Ther is no need to go through dma_common_mmap for the arm-nommu dma mmap implementation as the only possible memory not handled above could be that from the per-device coherent pool. Signed-off-by: Christoph Hellwig --- arch/arm/mm/dma-mapping-nommu.c | 5 +++-- 1 file changed, 3 insertions(+),

[PATCH 5/8] ALSA: pcm: use dma_can_mmap() to check if a device supports dma_mmap_*

2019-08-08 Thread Christoph Hellwig
Replace the local hack with the dma_can_mmap helper to check if a given device supports mapping DMA allocations to userspace. Signed-off-by: Christoph Hellwig Reviewed-by: Takashi Iwai --- sound/core/pcm_native.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/

[PATCH 4/8] dma-mapping: add a dma_can_mmap helper

2019-08-08 Thread Christoph Hellwig
Add a helper to check if DMA allocations for a specific device can be mapped to userspace using dma_mmap_*. Signed-off-by: Christoph Hellwig --- include/linux/dma-mapping.h | 5 + kernel/dma/mapping.c| 23 +++ 2 files changed, 28 insertions(+) diff --git a/inclu

[PATCH 3/8] dma-mapping: explicitly wire up ->mmap and ->get_sgtable

2019-08-08 Thread Christoph Hellwig
While the default ->mmap and ->get_sgtable implementations work for the majority of our dma_map_ops impementations they are inherently safe for others that don't use the page allocator or CMA and/or use their own way of remapping not covered by the common code. So remove the defaults if these meth

remove default fallbacks in dma_map_ops v3

2019-08-08 Thread Christoph Hellwig
Hi all, we have a few places where the DMA mapping layer has non-trivial default actions that are questionable and/or dangerous. This series instead wires up the mmap, get_sgtable and get_required_mask methods explicitly and cleans up some surrounding areas. This also means we could get rid of t

[PATCH 1/8] dma-mapping: provide a better default ->get_required_mask

2019-08-08 Thread Christoph Hellwig
Most dma_map_ops instances are IOMMUs that work perfectly fine in 32-bits of IOVA space, and the generic direct mapping code already provides its own routines that is intelligent based on the amount of memory actually present. Wire up the dma-direct routine for the ARM direct mapping code as well,

Re: [PATCH 3/8] of/fdt: add function to get the SoC wide DMA addressable memory size

2019-08-08 Thread Rob Herring
On Tue, Aug 6, 2019 at 12:12 PM Nicolas Saenz Julienne wrote: > > Hi Rob, > > On Mon, 2019-08-05 at 13:23 -0600, Rob Herring wrote: > > On Mon, Aug 5, 2019 at 10:03 AM Nicolas Saenz Julienne > > wrote: > > > Hi Rob, > > > Thanks for the review! > > > > > > On Fri, 2019-08-02 at 11:17 -0600, Rob H

Re: [PATCH v3 1/4] firmware: qcom_scm-64: Add atomic version of qcom_scm_call

2019-08-08 Thread Vivek Gautam
On Tue, Aug 6, 2019 at 3:58 AM Bjorn Andersson wrote: > > On Wed 19 Jun 04:34 PDT 2019, Vivek Gautam wrote: > > > On Tue, Jun 18, 2019 at 11:25 PM Will Deacon wrote: > > > > > > On Wed, Jun 12, 2019 at 12:45:51PM +0530, Vivek Gautam wrote: > > > > There are scnenarios where drivers are required t

Re: [PATCH v3 hmm 11/11] mm/mmu_notifiers: remove unregister_no_release

2019-08-08 Thread Christoph Hellwig
On Tue, Aug 06, 2019 at 08:15:48PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > mmu_notifier_unregister_no_release() and mmu_notifier_call_srcu() no > longer have any users, they have all been converted to use > mmu_notifier_put(). > > So delete this difficult to use interface. > >

Re: [PATCH v3 hmm 05/11] hmm: use mmu_notifier_get/put for 'struct hmm'

2019-08-08 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v3 hmm 02/11] mm/mmu_notifiers: do not speculatively allocate a mmu_notifier_mm

2019-08-08 Thread Christoph Hellwig
On Tue, Aug 06, 2019 at 08:15:39PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > A prior commit e0f3c3f78da2 ("mm/mmu_notifier: init notifier if necessary") > made an attempt at doing this, but had to be reverted as calling > the GFP_KERNEL allocator under the i_mmap_mutex causes dead

Re: [PATCH v3 hmm 04/11] misc/sgi-gru: use mmu_notifier_get/put for struct gru_mm_struct

2019-08-08 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v3 hmm 01/11] mm/mmu_notifiers: hoist do_mmu_notifier_register down_write to the caller

2019-08-08 Thread Christoph Hellwig
On Tue, Aug 06, 2019 at 08:15:38PM -0300, Jason Gunthorpe wrote: > From: Jason Gunthorpe > > This simplifies the code to not have so many one line functions and extra > logic. __mmu_notifier_register() simply becomes the entry point to > register the notifier, and the other one calls it under loc

[PATCH] iommu/amd: Override wrong IVRS IOAPIC on Raven Ridge systems

2019-08-08 Thread Kai-Heng Feng
Raven Ridge systems may have malfunction touchpad or hang at boot if incorrect IVRS IOAPIC is provided by BIOS. Users already found correct "ivrs_ioapic=" values, let's put them inside kernel to workaround buggy BIOS. BugLink: https://bugs.launchpad.net/bugs/1795292 BugLink: https://bugs.launchpa

Re: Regression due to d98849aff879 (dma-direct: handle DMA_ATTR_NO_KERNEL_MAPPING in common code)

2019-08-08 Thread Christoph Hellwig
On Wed, Aug 07, 2019 at 05:24:17PM +0200, Lucas Stach wrote: > I would suggest to place this line above the comment, as the comment > only really applies to the return value. Other than this nitpick, this > matches my understanding of the required changes, so: > > Reviewed-by: Lucas Stach Thanks