[PATCH v10 4/5] dt-bindings: arm-smmu: add binding for Tegra194 SMMU

2020-07-07 Thread Krishna Reddy
Add binding for NVIDIA's Tegra194 SoC SMMU. Signed-off-by: Krishna Reddy --- .../devicetree/bindings/iommu/arm,smmu.yaml| 18 ++ 1 file changed, 18 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/arm,smmu.yaml

[PATCH v10 1/5] iommu/arm-smmu: move TLB timeout and spin count macros

2020-07-07 Thread Krishna Reddy
Move TLB timeout and spin count macros to header file to allow using the same from vendor specific implementations. Signed-off-by: Krishna Reddy --- drivers/iommu/arm-smmu.c | 3 --- drivers/iommu/arm-smmu.h | 2 ++ 2 files changed, 2 insertions(+), 3 deletions(-) diff --git

[PATCH v10 2/5] iommu/arm-smmu: ioremap smmu mmio region before implementation init

2020-07-07 Thread Krishna Reddy
ioremap smmu mmio region before calling into implementation init. This is necessary to allow mapped address available during vendor specific implementation init. Signed-off-by: Krishna Reddy --- drivers/iommu/arm-smmu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git

[PATCH v10 0/5] NVIDIA ARM SMMU Implementation

2020-07-07 Thread Krishna Reddy
Changes in v10: Perform SMMU base ioremap before calling implementation init. Check for Global faults across both ARM MMU-500s during global interrupt. Check for context faults across all contexts of both ARM MMU-500s during context fault interrupt. Add new DT binding nvidia,smmu-500 for NVIDIA

[PATCH v10 5/5] iommu/arm-smmu: Add global/context fault implementation hooks

2020-07-07 Thread Krishna Reddy
Add global/context fault hooks to allow vendor specific implementations override default fault interrupt handlers. Update NVIDIA implementation to override the default global/context fault interrupt handlers and handle interrupts across the two ARM MMU-500s that are programmed identically.

[PATCH v10 3/5] iommu/arm-smmu: add NVIDIA implementation for ARM MMU-500 usage

2020-07-07 Thread Krishna Reddy
NVIDIA's Tegra194 SoC has three ARM MMU-500 instances. It uses two of the ARM MMU-500s together to interleave IOVA accesses across them and must be programmed identically. This implementation supports programming the two ARM MMU-500s that must be programmed identically. The third ARM MMU-500

Re: [PATCH v2 1/2] iommu: iommu_aux_at(de)tach_device() extension

2020-07-07 Thread Lu Baolu
Hi Alex, Thanks a lot for your comments. Please check my reply inline. On 7/8/20 5:04 AM, Alex Williamson wrote: On Tue, 7 Jul 2020 09:39:56 +0800 Lu Baolu wrote: The hardware assistant vfio mediated device is a use case of iommu aux-domain. The interactions between vfio/mdev and iommu

Re: [PATCH v4 3/5] iommu/uapi: Use named union for user data

2020-07-07 Thread Lu Baolu
Hi Jacob, On 7/8/20 7:43 AM, Jacob Pan wrote: IOMMU UAPI data size is filled by the user space which must be validated by ther kernel. To ensure backward compatibility, user data can only be extended by either re-purpose padding bytes or extend the variable sized union at the end. No size

Re: [PATCH v2 3/4] iommu/vt-d: Report page request faults for guest SVA

2020-07-07 Thread Lu Baolu
Hi Jean, On 7/7/20 7:23 PM, Jean-Philippe Brucker wrote: On Mon, Jul 06, 2020 at 08:25:34AM +0800, Lu Baolu wrote: A pasid might be bound to a page table from a VM guest via the iommu ops.sva_bind_gpasid. In this case, when a DMA page fault is detected on the physical IOMMU, we need to inject

Re: [PATCH v4 1/5] docs: IOMMU user API

2020-07-07 Thread Lu Baolu
Hi, On 7/8/20 7:43 AM, Jacob Pan wrote: +For UAPIs that are shared with in-kernel users, a wrapper function +is provided to distinguish the callers. For example, + +Userspace caller :: + + int iommu_sva_unbind_gpasid(struct iommu_domain *domain, struct device *dev, + void __user *udata) +

[PATCH v4 1/5] docs: IOMMU user API

2020-07-07 Thread Jacob Pan
IOMMU UAPI is newly introduced to support communications between guest virtual IOMMU and host IOMMU. There has been lots of discussions on how it should work with VFIO UAPI and userspace in general. This document is indended to clarify the UAPI design and usage. The mechenics of how future

[PATCH v4 0/5] IOMMU user API enhancement

2020-07-07 Thread Jacob Pan
IOMMU user API header was introduced to support nested DMA translation and related fault handling. The current UAPI data structures consist of three areas that cover the interactions between host kernel and guest: - fault handling - cache invalidation - bind guest page tables, i.e. guest PASID

[PATCH v4 3/5] iommu/uapi: Use named union for user data

2020-07-07 Thread Jacob Pan
IOMMU UAPI data size is filled by the user space which must be validated by ther kernel. To ensure backward compatibility, user data can only be extended by either re-purpose padding bytes or extend the variable sized union at the end. No size change is allowed before the union. Therefore, the

[PATCH v4 5/5] iommu/vt-d: Remove UAPI version check

2020-07-07 Thread Jacob Pan
IOMMU generic layer already does sanity checks on UAPI data which include version check. Remove the version check from vendor driver. Signed-off-by: Jacob Pan --- drivers/iommu/intel/iommu.c | 3 +-- drivers/iommu/intel/svm.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff

[PATCH v4 2/5] iommu/uapi: Add argsz for user filled data

2020-07-07 Thread Jacob Pan
As IOMMU UAPI gets extended, user data size may increase. To support backward compatibiliy, this patch introduces a size field to each UAPI data structures. It is *always* the responsibility for the user to fill in the correct size. Specific scenarios for user data handling are documented in:

[PATCH v4 4/5] iommu/uapi: Handle data and argsz filled by users

2020-07-07 Thread Jacob Pan
IOMMU UAPI data has a user filled argsz field which indicates the data length comes with the API call. User data is not trusted, argsz must be validated based on the current kernel data size, mandatory data size, and feature flags. User data may also be extended, results in possible argsz

[PATCH v4 2/4] PCI: Keep the ACS capability offset in device

2020-07-07 Thread Rajat Jain via iommu
Currently ACS capabiity is being looked up at a number of places. Read and store it once at bootup so that it can be used by all later. Signed-off-by: Rajat Jain --- v4: No change v3: fix commit log, remove forward declation of static function v2: Commit log cosmetic changes

[PATCH v4 1/4] PCI: Move pci_enable_acs() and its dependencies up in pci.c

2020-07-07 Thread Rajat Jain via iommu
Move pci_enable_acs() and the functions it depends on, further up in the source code to avoid having to forward declare it when we make it static in near future (next patch). No functional changes intended. Signed-off-by: Rajat Jain --- v4: Same as v3 v3: Initial version of the patch, created

[PATCH v4 4/4] PCI/ACS: Enable PCI_ACS_TB for untrusted/external-facing devices

2020-07-07 Thread Rajat Jain via iommu
When enabling ACS, enable translation blocking for external facing ports and untrusted devices. Signed-off-by: Rajat Jain --- v4: Add braces to avoid warning from kernel robot print warning for only external-facing devices. v3: print warning if ACS_TB not supported on

[PATCH v4 3/4] PCI: Treat "external-facing" devices as internal

2020-07-07 Thread Rajat Jain via iommu
The "ExternalFacingPort" devices (root ports) are internal devices that sit on the internal system fabric. Ref: https://docs.microsoft.com/en-us/windows-hardware/drivers/pci/dsd-for-pcie-root-ports Currently they were treated (marked as untrusted) at par with other external devices downstream

Re: [PATCH RESEND v2] PCI: Add device even if driver attach failed

2020-07-07 Thread Bjorn Helgaas
On Mon, Jul 06, 2020 at 04:32:40PM -0700, Rajat Jain wrote: > device_attach() returning failure indicates a driver error while trying to > probe the device. In such a scenario, the PCI device should still be added > in the system and be visible to the user. > > This patch partially reverts: >

Re: [PATCH v3 1/5] docs: IOMMU user API

2020-07-07 Thread Alex Williamson
On Mon, 29 Jun 2020 16:05:18 -0700 Jacob Pan wrote: > On Fri, 26 Jun 2020 16:19:23 -0600 > Alex Williamson wrote: > > > On Tue, 23 Jun 2020 10:03:53 -0700 > > Jacob Pan wrote: > > > > > IOMMU UAPI is newly introduced to support communications between > > > guest virtual IOMMU and host

Re: [PATCH v5 00/12] x86: tag application address space for devices

2020-07-07 Thread Fenghua Yu
Hi, Thomas, Joerg, Boris, Ingo, Baolu, and x86/iommu maintainers, On Tue, Jun 30, 2020 at 04:44:30PM -0700, Fenghua Yu wrote: > Typical hardware devices require a driver stack to translate application > buffers to hardware addresses, and a kernel-user transition to notify the > hardware of new

Re: [PATCH v2 1/2] iommu: iommu_aux_at(de)tach_device() extension

2020-07-07 Thread Alex Williamson
On Tue, 7 Jul 2020 09:39:56 +0800 Lu Baolu wrote: > The hardware assistant vfio mediated device is a use case of iommu > aux-domain. The interactions between vfio/mdev and iommu during mdev > creation and passthr are: > > - Create a group for mdev with iommu_group_alloc(); > - Add the device

Re: the XSK buffer pool needs be to reverted

2020-07-07 Thread Robin Murphy
On 2020-07-06 20:59, Jonathan Lemon wrote: On Wed, Jul 01, 2020 at 10:46:40AM +0100, Robin Murphy wrote: On 2020-06-30 20:08, Jonathan Lemon wrote: On Mon, Jun 29, 2020 at 02:15:16PM +0100, Robin Murphy wrote: On 2020-06-27 08:02, Christoph Hellwig wrote: On Fri, Jun 26, 2020 at 01:54:12PM

Re: IOASID set token

2020-07-07 Thread Jacob Pan
Hi Jean, All other points agreed. On Tue, 7 Jul 2020 12:07:18 +0200 Jean-Philippe Brucker wrote: > > > For the moment, though, we could actually specialize the IOASID > > > API to only take an mm_struct as token. > > That would be fine with VT-d. We can use init_mm for host PASID set, > >

Re: [PATCH 1/4] dma-mapping: add a new dma_need_sync API

2020-07-07 Thread Christoph Hellwig
On Tue, Jul 07, 2020 at 08:11:09AM -0700, Jonathan Lemon wrote: > > You need to check every mapping. E.g. this API pairs with a > > dma_map_single/page call. For S/G mappings you'd need to call it for > > each entry, although if you have a use case for that we really should > > add a

Re: [PATCH 1/4] dma-mapping: add a new dma_need_sync API

2020-07-07 Thread Jonathan Lemon
On Tue, Jul 07, 2020 at 08:47:30AM +0200, Christoph Hellwig wrote: > On Mon, Jul 06, 2020 at 12:42:27PM -0700, Jonathan Lemon wrote: > > On Mon, Jun 29, 2020 at 03:03:56PM +0200, Christoph Hellwig wrote: > > > Add a new API to check if calls to dma_sync_single_for_{device,cpu} are > > > required

Re: [Freedreno] [PATCH v2 1/6] iommu/arm-smmu: Add auxiliary domain support for arm-smmuv2

2020-07-07 Thread Rob Clark
On Tue, Jul 7, 2020 at 5:34 AM Robin Murphy wrote: > > On 2020-06-26 21:04, Jordan Crouse wrote: > > Support auxiliary domains for arm-smmu-v2 to initialize and support > > multiple pagetables for a single SMMU context bank. Since the smmu-v2 > > hardware doesn't have any built in support for

Re: [PATCH v7 08/36] drm: exynos: fix common struct sg_table related issues

2020-07-07 Thread Andrzej Hajda
On 07.07.2020 11:40, Andrzej Hajda wrote: > On 19.06.2020 12:36, Marek Szyprowski wrote: >> The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() function >> returns the number of the created entries in the DMA address space. >> However the subsequent calls to the

Re: [PATCH v7 07/36] drm: exynos: use common helper for a scatterlist contiguity check

2020-07-07 Thread Andrzej Hajda
On 07.07.2020 11:35, Andrzej Hajda wrote: > Hi, > > On 19.06.2020 12:36, Marek Szyprowski wrote: >> Use common helper for checking the contiguity of the imported dma-buf. >> >> Signed-off-by: Marek Szyprowski Just fixing my signature :) Reviewed-by: Andrzej Hajda Regards Andrzej

Re: [PATCH v7 01/36] drm: prime: add common helper to check scatterlist contiguity

2020-07-07 Thread Andrzej Hajda
On 07.07.2020 16:30, Andrzej Hajda wrote: > On 19.06.2020 12:36, Marek Szyprowski wrote: >> It is a common operation done by DRM drivers to check the contiguity >> of the DMA-mapped buffer described by a scatterlist in the >> sg_table object. Let's add a common helper for this operation. >> >>

Re: [PATCH v7 03/36] drm: core: fix common struct sg_table related issues

2020-07-07 Thread Andrzej Hajda
On 19.06.2020 12:36, Marek Szyprowski wrote: > The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() function > returns the number of the created entries in the DMA address space. > However the subsequent calls to the dma_sync_sg_for_{device,cpu}() and > dma_unmap_sg must be called

Re: [Freedreno] [PATCH v2 2/6] iommu/io-pgtable: Allow a pgtable implementation to skip TLB operations

2020-07-07 Thread Rob Clark
On Tue, Jul 7, 2020 at 7:25 AM Rob Clark wrote: > > On Tue, Jul 7, 2020 at 4:34 AM Robin Murphy wrote: > > > > On 2020-06-26 21:04, Jordan Crouse wrote: > > > Allow a io-pgtable implementation to skip TLB operations by checking for > > > NULL pointers in the helper functions. It will be up to to

Re: [PATCH 1/4] dma-mapping: move the remaining DMA API calls out of line

2020-07-07 Thread Christoph Hellwig
On Tue, Jul 07, 2020 at 10:43:10AM +1000, Alexey Kardashevskiy wrote: > Any luck there? I'd really like to cross this off my todo list :) Thanks, We had another incident with new net code poking into dma internals blocking this series. That is now sorted out, so the series is back on track.

Re: [PATCH v7 02/36] drm: prime: use sgtable iterators in drm_prime_sg_to_page_addr_arrays()

2020-07-07 Thread Andrzej Hajda
On 19.06.2020 12:36, Marek Szyprowski wrote: > Replace the current hand-crafted code for extracting pages and DMA > addresses from the given scatterlist by the much more robust > code based on the generic scatterlist iterators and recently > introduced sg_table-based wrappers. The resulting code

Re: [Freedreno] [PATCH v2 4/6] drm/msm: Add support to create a local pagetable

2020-07-07 Thread Rob Clark
On Tue, Jul 7, 2020 at 4:36 AM Robin Murphy wrote: > > On 2020-06-26 21:04, Jordan Crouse wrote: > > Add support to create a io-pgtable for use by targets that support > > per-instance pagetables. In order to support per-instance pagetables the > > GPU SMMU device needs to have the

Re: [PATCH v7 01/36] drm: prime: add common helper to check scatterlist contiguity

2020-07-07 Thread Andrzej Hajda
On 19.06.2020 12:36, Marek Szyprowski wrote: > It is a common operation done by DRM drivers to check the contiguity > of the DMA-mapped buffer described by a scatterlist in the > sg_table object. Let's add a common helper for this operation. > > Signed-off-by: Marek Szyprowski > --- >

Re: [Freedreno] [PATCH v2 2/6] iommu/io-pgtable: Allow a pgtable implementation to skip TLB operations

2020-07-07 Thread Rob Clark
On Tue, Jul 7, 2020 at 4:34 AM Robin Murphy wrote: > > On 2020-06-26 21:04, Jordan Crouse wrote: > > Allow a io-pgtable implementation to skip TLB operations by checking for > > NULL pointers in the helper functions. It will be up to to the owner > > of the io-pgtable instance to make sure that

Re: [PATCH v4 4/7] iommu/vt-d: Handle non-page aligned address

2020-07-07 Thread kernel test robot
Hi Jacob, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on iommu/next] [also build test WARNING on linux/master linus/master v5.8-rc4 next-20200707] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest

Re: [PATCH v7 04/36] drm: amdgpu: fix common struct sg_table related issues

2020-07-07 Thread Marek Szyprowski
Hi Christian, On 22.06.2020 15:27, Christian König wrote: > Am 19.06.20 um 12:36 schrieb Marek Szyprowski: >> The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() >> function >> returns the number of the created entries in the DMA address space. >> However the subsequent calls to the

Re: [PATCH v2 1/6] iommu/arm-smmu: Add auxiliary domain support for arm-smmuv2

2020-07-07 Thread Robin Murphy
On 2020-06-26 21:04, Jordan Crouse wrote: Support auxiliary domains for arm-smmu-v2 to initialize and support multiple pagetables for a single SMMU context bank. Since the smmu-v2 hardware doesn't have any built in support for switching the pagetable base it is left as an exercise to the caller

[PATCH] dma-pool: use single atomic pool for both DMA zones

2020-07-07 Thread Nicolas Saenz Julienne
When allocating atomic DMA memory for a device, the dma-pool core queries __dma_direct_optimal_gfp_mask() to check which atomic pool to use. It turns out the GFP flag returned is only an optimistic guess. The pool selected might sometimes live in a zone higher than the device's view of memory. As

Re: [PATCH v3 4/4] PCI/ACS: Enable PCI_ACS_TB for untrusted/external-facing devices

2020-07-07 Thread kernel test robot
Hi Rajat, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on pci/next] [also build test WARNING on iommu/next pm/linux-next v5.8-rc4 next-20200707] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use

Re: [PATCH v2 4/6] drm/msm: Add support to create a local pagetable

2020-07-07 Thread Robin Murphy
On 2020-06-26 21:04, Jordan Crouse wrote: Add support to create a io-pgtable for use by targets that support per-instance pagetables. In order to support per-instance pagetables the GPU SMMU device needs to have the qcom,adreno-smmu compatible string and split pagetables and auxiliary domains

Re: [PATCH v2 2/6] iommu/io-pgtable: Allow a pgtable implementation to skip TLB operations

2020-07-07 Thread Robin Murphy
On 2020-06-26 21:04, Jordan Crouse wrote: Allow a io-pgtable implementation to skip TLB operations by checking for NULL pointers in the helper functions. It will be up to to the owner of the io-pgtable instance to make sure that they independently handle the TLB correctly. I don't really

Re: [PATCH v2 3/4] iommu/vt-d: Report page request faults for guest SVA

2020-07-07 Thread Jean-Philippe Brucker
On Mon, Jul 06, 2020 at 08:25:34AM +0800, Lu Baolu wrote: > A pasid might be bound to a page table from a VM guest via the iommu > ops.sva_bind_gpasid. In this case, when a DMA page fault is detected > on the physical IOMMU, we need to inject the page fault request into > the guest. After the

Re: [PATCH v2 1/6] iommu/arm-smmu: Add auxiliary domain support for arm-smmuv2

2020-07-07 Thread Jean-Philippe Brucker
Hi Jordan, On Fri, Jun 26, 2020 at 02:04:09PM -0600, Jordan Crouse wrote: > Support auxiliary domains for arm-smmu-v2 to initialize and support > multiple pagetables for a single SMMU context bank. Since the smmu-v2 > hardware doesn't have any built in support for switching the pagetable > base

Re: IOASID set token

2020-07-07 Thread Jean-Philippe Brucker
On Mon, Jul 06, 2020 at 01:51:37PM -0700, Jacob Pan wrote: > Hi Jean, > Thanks for the feedback, please see replies inline. > > On Mon, 6 Jul 2020 12:30:41 +0200 > Jean-Philippe Brucker wrote: > > > Hi Jacob, > > > > On Thu, Jul 02, 2020 at 06:48:25AM -0700, Jacob Pan wrote: > > > Hi Jean, > >

RE: [PATCH v4 07/15] vfio/type1: Add VFIO_IOMMU_PASID_REQUEST (alloc/free)

2020-07-07 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 11:18 PM > > Hi Yi, > > On 7/4/20 1:26 PM, Liu Yi L wrote: > > This patch allows user space to request PASID allocation/free, e.g. when > > serving the request from the guest. > > > > PASIDs that are not freed by userspace are

Re: [PATCH v7 08/36] drm: exynos: fix common struct sg_table related issues

2020-07-07 Thread Andrzej Hajda
On 19.06.2020 12:36, Marek Szyprowski wrote: > The Documentation/DMA-API-HOWTO.txt states that the dma_map_sg() function > returns the number of the created entries in the DMA address space. > However the subsequent calls to the dma_sync_sg_for_{device,cpu}() and > dma_unmap_sg must be called

RE: [PATCH v4 05/15] vfio: Add PASID allocation/free support

2020-07-07 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 10:52 PM > > Hi Yi, > > On 7/4/20 1:26 PM, Liu Yi L wrote: > > Shared Virtual Addressing (a.k.a Shared Virtual Memory) allows sharing > > multiple process virtual address spaces with the device for simplified > > programming model. PASID

Re: [PATCH v7 07/36] drm: exynos: use common helper for a scatterlist contiguity check

2020-07-07 Thread Andrzej Hajda
Hi, On 19.06.2020 12:36, Marek Szyprowski wrote: > Use common helper for checking the contiguity of the imported dma-buf. > > Signed-off-by: Marek Szyprowski > --- > drivers/gpu/drm/exynos/exynos_drm_gem.c | 23 +++ > 1 file changed, 3 insertions(+), 20 deletions(-) > >

RE: [PATCH v4 06/15] iommu/vt-d: Support setting ioasid set to domain

2020-07-07 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 10:52 PM > > Hi Yi, > > On 7/4/20 1:26 PM, Liu Yi L wrote: > > From IOMMU p.o.v., PASIDs allocated and managed by external components > > (e.g. VFIO) will be passed in for gpasid_bind/unbind operation. IOMMU > > needs some knowledge to

RE: [PATCH v4 04/15] vfio/type1: Report iommu nesting info to userspace

2020-07-07 Thread Liu, Yi L
Hi Eric, > From: Auger Eric > Sent: Monday, July 6, 2020 10:07 PM > > Hi Yi, > On 7/4/20 1:26 PM, Liu Yi L wrote: > > This patch exports iommu nesting capability info to user space through > > VFIO. User space is expected to check this info for supported uAPIs (e.g. > > PASID alloc/free, bind

RE: [PATCH v4 04/15] vfio/type1: Report iommu nesting info to userspace

2020-07-07 Thread Liu, Yi L
Hi Eric, > From: Auger Eric < eric.au...@redhat.com > > Sent: Monday, July 6, 2020 9:45 PM > > Hi Yi, > > On 7/6/20 3:10 PM, Liu, Yi L wrote: > > Hi Eric, > > > >> From: Auger Eric > >> Sent: Monday, July 6, 2020 6:37 PM > >> > >> Yi, > >> > >> On 7/4/20 1:26 PM, Liu Yi L wrote: > >>> This

Re: [Issue]platform/x86: iommu: System can't shutdown because iommu driver keeps checking the status of DMA_GSTS_TES

2020-07-07 Thread Lu Baolu
Hi Koba KO, On 2020/7/7 11:27, Koba Ko wrote: Dear Baolu, On Tue, Jun 30, 2020 at 3:52 PM Lu Baolu wrote: Hi Koba, On 2020/6/30 15:31, Koba Ko wrote: On Mon, Jun 15, 2020 at 3:20 PM Lu Baolu wrote: Hi Koba Ko, On 2020/6/15 11:19, Koba Ko wrote: hi All, I have a machine and there's

Re: [PATCH RESEND v2] PCI: Add device even if driver attach failed

2020-07-07 Thread Greg Kroah-Hartman
On Mon, Jul 06, 2020 at 04:32:40PM -0700, Rajat Jain wrote: > device_attach() returning failure indicates a driver error while trying to > probe the device. In such a scenario, the PCI device should still be added > in the system and be visible to the user. > > This patch partially reverts: >

Re: [PATCH 1/4] dma-mapping: add a new dma_need_sync API

2020-07-07 Thread Christoph Hellwig
On Mon, Jul 06, 2020 at 12:42:27PM -0700, Jonathan Lemon wrote: > On Mon, Jun 29, 2020 at 03:03:56PM +0200, Christoph Hellwig wrote: > > Add a new API to check if calls to dma_sync_single_for_{device,cpu} are > > required for a given DMA streaming mapping. > > > > +:: > > + > > + bool > > +

[PATCH v3 4/4] PCI/ACS: Enable PCI_ACS_TB for untrusted/external-facing devices

2020-07-07 Thread Rajat Jain via iommu
When enabling ACS, enable translation blocking for external facing ports and untrusted devices. Signed-off-by: Rajat Jain --- v3: print warning if ACS_TB not supported on external-facing/untrusted ports. Minor code comments fixes. v2: Commit log change drivers/pci/pci.c| 7 +++

Re: [PATCH] iommu: Remove unused IOMMU_SYS_CACHE_ONLY flag

2020-07-07 Thread Christoph Hellwig
On Fri, Jul 03, 2020 at 05:25:48PM +0100, Will Deacon wrote: > The IOMMU_SYS_CACHE_ONLY flag was never exposed via the DMA API and > has no in-tree users. Remove it. Looks good, Reviewed-by: Christoph Hellwig ___ iommu mailing list

Re: [RFC PATCH] vfio: type1: fix kthread use case

2020-07-07 Thread Markus Elfring
… > +++ b/drivers/vfio/vfio_iommu_type1.c > @@ -2798,7 +2798,7 @@ static int vfio_iommu_type1_dma_rw_chunk … > - bool kthread = current->mm == NULL; > + bool kthread_load_mm; > size_t offset; How do you think about to reduce the scope for such variables?

Re: [PATCH v2 5/7] driver core: Add device location to "struct device" and expose it in sysfs

2020-07-07 Thread Rajat Jain via iommu
On Wed, Jul 1, 2020 at 10:23 PM Oliver O'Halloran wrote: > > On Thu, Jul 2, 2020 at 4:07 AM Rajat Jain wrote: > > > > *snip* > > > > > > I guess it would make sense to have an attribute for user space to > > > > write to in order to make the kernel reject device plug-in events > > > > coming