Re: [PATCH v4 7/9] iommu/vt-d: Add trace events for domain map/unmap

2019-06-05 Thread Lu Baolu
Hi Steve, On 6/4/19 5:01 PM, Steven Rostedt wrote: On Mon, 3 Jun 2019 09:16:18 +0800 Lu Baolu wrote: +TRACE_EVENT(bounce_unmap_single, + TP_PROTO(struct device *dev, dma_addr_t dev_addr, size_t size), + + TP_ARGS(dev, dev_addr, size), + + TP_STRUCT__entry( +

Re: [PATCH] of/device: add blacklist for iommu dma_ops

2019-06-05 Thread Tomasz Figa
On Mon, Jun 3, 2019 at 7:48 PM Rob Clark wrote: > > On Sun, Jun 2, 2019 at 11:25 PM Tomasz Figa wrote: > > > > On Mon, Jun 3, 2019 at 4:40 AM Rob Clark wrote: > > > > > > On Fri, May 10, 2019 at 7:35 AM Rob Clark wrote: > > > > > > > > On Tue, Dec 4, 2018 at 2:29 PM Rob Herring wrote: > > > >

Re: [PATCH v2 3/3] xen/swiotlb: remember having called xen_create_contiguous_region()

2019-06-05 Thread Juergen Gross
On 31.05.19 13:38, Juergen Gross wrote: On 30/05/2019 14:46, Boris Ostrovsky wrote: On 5/30/19 5:04 AM, Christoph Hellwig wrote: Please don't add your private flag to page-flags.h. The whole point of the private flag is that you can use it in any way you want withou touching the common code.

RE: [PATCH v2 2/4] iommu: Introduce device fault data

2019-06-05 Thread Tian, Kevin
> From: Jacob Pan > Sent: Tuesday, June 4, 2019 6:09 AM > > On Mon, 3 Jun 2019 15:57:47 +0100 > Jean-Philippe Brucker wrote: > > > +/** > > + * struct iommu_fault_page_request - Page Request data > > + * @flags: encodes whether the corresponding fields are valid and > > whether this > > + *

[RFC PATCH v5 0/8] treewide: improve R-Car SDHI performance

2019-06-05 Thread Yoshihiro Shimoda
This patch series is based on iommu.git / next branch. Since SDHI host internal DMAC of the R-Car Gen3 cannot handle two or more segments, the performance rate (especially, eMMC HS400 reading) is not good. However, if IOMMU is enabled on the DMAC, since IOMMU will map multiple scatter gather

Re: [PATCH v2 0/4] iommu: Add device fault reporting API

2019-06-05 Thread Jean-Philippe Brucker
On 03/06/2019 22:59, Jacob Pan wrote: > On Mon, 3 Jun 2019 15:57:45 +0100 > Jean-Philippe Brucker wrote: > >> Allow device drivers and VFIO to get notified on IOMMU translation >> fault, and handle recoverable faults (PCI PRI). Several series require >> this API (Intel VT-d and Arm SMMUv3

Re: [PATCH v3] iommu/arm-smmu: Avoid constant zero in TLBI writes

2019-06-05 Thread Will Deacon
[+Joerg on To:] On Mon, Jun 03, 2019 at 02:15:37PM +0200, Marc Gonzalez wrote: > From: Robin Murphy > > Apparently, some Qualcomm arm64 platforms which appear to expose their > SMMU global register space are still, in fact, using a hypervisor to > mediate it by trapping and emulating register

Re: [RFC PATCH v5 3/8] iommu: add a new capable IOMMU_CAP_MERGING

2019-06-05 Thread Robin Murphy
On 05/06/2019 12:11, Yoshihiro Shimoda wrote: This patch adds a new capable IOMMU_CAP_MERGING to check whether the IOVA would be contiguous strictly if a device requires and the IOMMU driver has the capable. Signed-off-by: Yoshihiro Shimoda --- drivers/iommu/dma-iommu.c | 26

[RFC PATCH v5 4/8] iommu/ipmmu-vmsa: add capable ops

2019-06-05 Thread Yoshihiro Shimoda
This patch adds the .capable into iommu_ops that can merge scatter gather segments. Signed-off-by: Yoshihiro Shimoda --- drivers/iommu/ipmmu-vmsa.c | 13 + 1 file changed, 13 insertions(+) diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c index 408ad0b..81170b8

[RFC PATCH v5 6/8] mmc: tmio: Add a definition for default max_segs

2019-06-05 Thread Yoshihiro Shimoda
This patch adds a definition for default max_segs to be used by other driver (renesas_sdhi) in the future. Signed-off-by: Yoshihiro Shimoda Reviewed-by: Wolfram Sang --- drivers/mmc/host/tmio_mmc.h | 1 + drivers/mmc/host/tmio_mmc_core.c | 2 +- 2 files changed, 2 insertions(+), 1

[RFC PATCH v5 3/8] iommu: add a new capable IOMMU_CAP_MERGING

2019-06-05 Thread Yoshihiro Shimoda
This patch adds a new capable IOMMU_CAP_MERGING to check whether the IOVA would be contiguous strictly if a device requires and the IOMMU driver has the capable. Signed-off-by: Yoshihiro Shimoda --- drivers/iommu/dma-iommu.c | 26 -- include/linux/iommu.h | 1 + 2

[RFC PATCH v5 5/8] mmc: tmio: No memory size limitation if runs on IOMMU

2019-06-05 Thread Yoshihiro Shimoda
This patch adds a condition to avoid a memory size limitation of swiotlb if the driver runs on IOMMU. Tested-by: Takeshi Saito Signed-off-by: Yoshihiro Shimoda Reviewed-by: Simon Horman Reviewed-by: Wolfram Sang --- drivers/mmc/host/tmio_mmc_core.c | 5 +++-- 1 file changed, 3 insertions(+),

[RFC PATCH v5 8/8] mmc: renesas_sdhi: use multiple segments if possible

2019-06-05 Thread Yoshihiro Shimoda
If the IOMMU driver has a capable for merging segments to a segment strictly, this can expose the host->mmc->max_segs with multiple segments to a block layer by using blk_queue_max_segments() that mmc_setup_queue() calls. Notes that an sdio card may be possible to use multiple segments with non

[RFC PATCH v5 2/8] iommu/dma: move iommu_dma_unmap_sg() place

2019-06-05 Thread Yoshihiro Shimoda
iommu_dma_map_sg() will use the unmap function in the future. To avoid a forward declaration, this patch move the function place. Signed-off-by: Yoshihiro Shimoda --- drivers/iommu/dma-iommu.c | 48 +++ 1 file changed, 24 insertions(+), 24

[RFC PATCH v5 7/8] mmc: renesas_sdhi: sort headers

2019-06-05 Thread Yoshihiro Shimoda
This patch ports the headers in alphabetic order to ease the maintenance for this part. Signed-off-by: Yoshihiro Shimoda --- drivers/mmc/host/renesas_sdhi_core.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/mmc/host/renesas_sdhi_core.c

[RFC PATCH v5 1/8] dma-mapping: add a device driver helper for iova contiguous

2019-06-05 Thread Yoshihiro Shimoda
This API can set a flag whether a device requires iova contiguous strictly. Signed-off-by: Yoshihiro Shimoda --- include/linux/device.h | 1 + include/linux/dma-mapping.h | 16 2 files changed, 17 insertions(+) diff --git a/include/linux/device.h b/include/linux/device.h

Re: [PATCH v2 2/4] iommu: Introduce device fault data

2019-06-05 Thread Jean-Philippe Brucker
On 05/06/2019 09:51, Tian, Kevin wrote: >> From: Jacob Pan >> Sent: Tuesday, June 4, 2019 6:09 AM >> >> On Mon, 3 Jun 2019 15:57:47 +0100 >> Jean-Philippe Brucker wrote: >> >>> +/** >>> + * struct iommu_fault_page_request - Page Request data >>> + * @flags: encodes whether the corresponding

Re: [RFC PATCH v5 3/8] iommu: add a new capable IOMMU_CAP_MERGING

2019-06-05 Thread Christoph Hellwig
On Wed, Jun 05, 2019 at 01:21:59PM +0100, Robin Murphy wrote: > And if the problem is really that you're not getting merging because of > exposing the wrong parameters to the DMA API and/or the block layer, or > that you just can't quite express your requirement to the block layer in > the

Re: [Freedreno] [PATCH] of/device: add blacklist for iommu dma_ops

2019-06-05 Thread Rob Clark
On Tue, Jun 4, 2019 at 11:58 PM Tomasz Figa wrote: > > But first of all, I remember Marek already submitted some patches long > ago that extended struct driver with some flag that means that the > driver doesn't want the IOMMU to be attached before probe. Why > wouldn't that work? Sounds like a

Re: [PATCH] driver: core: Allow subsystems to continue deferring probe

2019-06-05 Thread Greg Kroah-Hartman
On Wed, Jun 05, 2019 at 04:23:12PM +0200, Thierry Reding wrote: > From: Thierry Reding > > Some subsystems, such as pinctrl, allow continuing to defer probe > indefinitely. This is useful for devices that depend on resources > provided by devices that are only probed after the init stage. > >

Re: [PATCH v2 2/4] iommu: Introduce device fault data

2019-06-05 Thread Jacob Pan
On Wed, 5 Jun 2019 08:51:45 + "Tian, Kevin" wrote: > > From: Jacob Pan > > Sent: Tuesday, June 4, 2019 6:09 AM > > > > On Mon, 3 Jun 2019 15:57:47 +0100 > > Jean-Philippe Brucker wrote: > > > > > +/** > > > + * struct iommu_fault_page_request - Page Request data > > > + * @flags:

Re: [RFC PATCH v5 3/8] iommu: add a new capable IOMMU_CAP_MERGING

2019-06-05 Thread Sergei Shtylyov
On 06/05/2019 02:11 PM, Yoshihiro Shimoda wrote: > This patch adds a new capable IOMMU_CAP_MERGING to check whether > the IOVA would be contiguous strictly if a device requires and > the IOMMU driver has the capable. s/has/is/? Or capable what? > Signed-off-by: Yoshihiro Shimoda > --- >

[RFC 2/2] iommu: arm-smmu: Don't blindly use first SMR to calculate mask

2019-06-05 Thread Bjorn Andersson
With the SMRs inherited from the bootloader the first SMR might actually be valid and in use. As such probing the SMR mask using the first SMR might break a stream in use. Search for an unused stream and use this to probe the SMR mask. Signed-off-by: Bjorn Andersson --- drivers/iommu/arm-smmu.c

[RFC 1/2] iommu: arm-smmu: Handoff SMR registers and context banks

2019-06-05 Thread Bjorn Andersson
Boot splash screen or EFI framebuffer requires the display hardware to operate while the Linux iommu driver probes. Therefore, we cannot simply wipe out the SMR register settings programmed by the bootloader. Detect which SMR registers are in use during probe, and which context banks they are

[RFC 0/2] iommu: arm-smmu: Inherit SMR and CB config during init

2019-06-05 Thread Bjorn Andersson
Qualcomm devices typically boot with some sort of splash screen on the display, or for some devices (i.e. recent Qualcomm laptops) an EFI framebuffer. For this the bootloader allocates a static framebuffer, configures the display hardware to output this on the display, sets up the SMMU for the

Re: [PATCH v2 2/4] iommu: Introduce device fault data

2019-06-05 Thread Jacob Pan
On Wed, 5 Jun 2019 12:24:09 +0100 Jean-Philippe Brucker wrote: > On 05/06/2019 09:51, Tian, Kevin wrote: > >> From: Jacob Pan > >> Sent: Tuesday, June 4, 2019 6:09 AM > >> > >> On Mon, 3 Jun 2019 15:57:47 +0100 > >> Jean-Philippe Brucker wrote: > >> > >>> +/** > >>> + * struct

Re: [PATCH v8 26/29] vfio-pci: Register an iommu fault handler

2019-06-05 Thread Jacob Pan
On Tue, 4 Jun 2019 18:11:08 +0200 Auger Eric wrote: > Hi Alex, > > On 6/4/19 12:31 AM, Alex Williamson wrote: > > On Sun, 26 May 2019 18:10:01 +0200 > > Eric Auger wrote: > > > >> This patch registers a fault handler which records faults in > >> a circular buffer and then signals an

RE: [RFC PATCH v5 3/8] iommu: add a new capable IOMMU_CAP_MERGING

2019-06-05 Thread Yoshihiro Shimoda
Hi Robin, Thank you for your comments! > From: Robin Murphy, Sent: Wednesday, June 5, 2019 9:22 PM > > @@ -902,8 +914,18 @@ static int iommu_dma_map_sg(struct device *dev, struct > > scatterlist *sg, > > if (iommu_map_sg(domain, iova, sg, nents, prot) < iova_len) > > goto

[PATCH] driver: core: Allow subsystems to continue deferring probe

2019-06-05 Thread Thierry Reding
From: Thierry Reding Some subsystems, such as pinctrl, allow continuing to defer probe indefinitely. This is useful for devices that depend on resources provided by devices that are only probed after the init stage. One example of this can be seen on Tegra, where the DPAUX hardware contains

Re: [Freedreno] [PATCH] of/device: add blacklist for iommu dma_ops

2019-06-05 Thread Marek Szyprowski
Hi Rob, On 2019-06-05 14:57, Rob Clark wrote: > On Tue, Jun 4, 2019 at 11:58 PM Tomasz Figa wrote: >> But first of all, I remember Marek already submitted some patches long >> ago that extended struct driver with some flag that means that the >> driver doesn't want the IOMMU to be attached

Re: [Freedreno] [PATCH] of/device: add blacklist for iommu dma_ops

2019-06-05 Thread Rob Clark
On Wed, Jun 5, 2019 at 6:18 AM Marek Szyprowski wrote: > > Hi Rob, > > On 2019-06-05 14:57, Rob Clark wrote: > > On Tue, Jun 4, 2019 at 11:58 PM Tomasz Figa wrote: > >> But first of all, I remember Marek already submitted some patches long > >> ago that extended struct driver with some flag that