Re: [V3, 2/2] media: i2c: Add Omnivision OV02A10 camera sensor driver

2019-09-06 Thread Tomasz Figa
On Fri, Sep 6, 2019 at 10:33 AM Dongchun Zhu wrote: > > On Fri, 2019-09-06 at 06:58 +0800, Nicolas Boichat wrote: > > On Fri, Sep 6, 2019 at 12:05 AM Sakari Ailus > > wrote: > > > > > > On Thu, Sep 05, 2019 at 07:53:37PM +0900, Tomasz Figa wrote: > > > > On Thu, Sep 5, 2019 at 7:45 PM Sakari

[PATCH v4 4/4] vfio: pci: Using a device region to retrieve zPCI information

2019-09-06 Thread Matthew Rosato
From: Pierre Morel We define a new configuration entry for VFIO/PCI, VFIO_PCI_ZDEV When the VFIO_PCI_ZDEV feature is configured we initialize a new device region, VFIO_REGION_SUBTYPE_ZDEV_CLP, to hold the information from the ZPCI device the use Signed-off-by: Pierre Morel Signed-off-by:

[PATCH v4 3/4] vfio: zpci: defining the VFIO headers

2019-09-06 Thread Matthew Rosato
From: Pierre Morel We define a new device region in vfio.h to be able to get the ZPCI CLP information by reading this region from userland. We create a new file, vfio_zdev.h to define the structure of the new region we defined in vfio.h Signed-off-by: Pierre Morel Signed-off-by: Matthew

[PATCH v4 2/4] s390: pci: Define the maxstbl CLP response entry

2019-09-06 Thread Matthew Rosato
From: Pierre Morel This entry is already defined in QEMU but not in Linux. We need this to export this entry to QEMU through a VFIO device region. Signed-off-by: Pierre Morel --- arch/s390/include/asm/pci_clp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v4 1/4] s390: pci: Exporting access to CLP PCI function and PCI group

2019-09-06 Thread Matthew Rosato
From: Pierre Morel For the generic implementation of VFIO PCI we need to retrieve the hardware configuration for the PCI functions and the PCI function groups. We modify the internal function using CLP Query PCI function and CLP query PCI function group so that they can be called from outside

[PATCH v4 0/4] Retrieving zPCI specific info with VFIO

2019-09-06 Thread Matthew Rosato
Note: These patches by Pierre got lost in the ether a few months back as he has been unavailable to carry them forward. I've made changes based upon comments received on his last version. We define a new configuration entry for VFIO/PCI, VFIO_PCI_ZDEV to configure access to a zPCI region

[PATCH v2 2/2] drm/msm: mark devices where iommu is managed by driver

2019-09-06 Thread Rob Clark
From: Rob Clark Signed-off-by: Rob Clark --- drivers/gpu/drm/msm/adreno/adreno_device.c | 1 + drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c| 1 + drivers/gpu/drm/msm/disp/mdp5/mdp5_kms.c | 1 + drivers/gpu/drm/msm/msm_drv.c | 1 + 4 files changed, 4 insertions(+) diff --git

[PATCH v2 1/2] iommu: add support for drivers that manage iommu explicitly

2019-09-06 Thread Rob Clark
From: Rob Clark Avoid attaching any non-driver managed domain if the driver indicates that it manages the iommu directly. Signed-off-by: Rob Clark --- drivers/iommu/iommu.c| 2 +- drivers/iommu/of_iommu.c | 3 +++ include/linux/device.h | 3 ++- 3 files changed, 6 insertions(+), 2

[PATCH v3 0/2] iommu: handle drivers that manage iommu directly

2019-09-06 Thread Rob Clark
From: Rob Clark One of the challenges we have to enable the aarch64 laptops upstream is dealing with the fact that the bootloader enables the display and takes the corresponding SMMU context-bank out of BYPASS. Unfortunately, currently, the IOMMU framework attaches a DMA (or potentially an

Re: [git pull] IOMMU Fixes for Linux v5.3-rc7

2019-09-06 Thread pr-tracker-bot
The pull request you sent on Fri, 6 Sep 2019 17:12:26 +0200: > git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git > tags/iommu-fixes-v5.3-rc7 has been merged into torvalds/linux.git: https://git.kernel.org/torvalds/c/76f5e9f870b045546b9a429f21b65205baf69c0c Thank you! --

[PATCH] iommu/vt-d: Add Scalable Mode fault information

2019-09-06 Thread Kyung Min Park
Intel VT-d specification revision 3 added support for Scalable Mode Translation for DMA remapping. Add the Scalable Mode fault reasons to show detailed fault reasons when the translation fault happens. Link: https://software.intel.com/sites/default/files/managed/c5/15/vt-directed-io-spec.pdf

Re: [PATCH] iommu: omap: mark pm functions __maybe_unused

2019-09-06 Thread Arnd Bergmann
On Fri, Sep 6, 2019 at 5:24 PM Suman Anna wrote: > > Hi Arnd, > > On 9/6/19 10:15 AM, Arnd Bergmann wrote: > > The runtime_pm functions are unused when CONFIG_PM is disabled: > > > > drivers/iommu/omap-iommu.c:1022:12: error: unused function > > 'omap_iommu_runtime_suspend'

Re: [PATCH] iommu: omap: mark pm functions __maybe_unused

2019-09-06 Thread Joerg Roedel
On Fri, Sep 06, 2019 at 05:15:38PM +0200, Arnd Bergmann wrote: > drivers/iommu/omap-iommu.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) Applied, thanks Arnd.

Re: [PATCH] iommu: omap: mark pm functions __maybe_unused

2019-09-06 Thread Suman Anna
Hi Arnd, On 9/6/19 10:15 AM, Arnd Bergmann wrote: > The runtime_pm functions are unused when CONFIG_PM is disabled: > > drivers/iommu/omap-iommu.c:1022:12: error: unused function > 'omap_iommu_runtime_suspend' [-Werror,-Wunused-function] > static int omap_iommu_runtime_suspend(struct device

[PATCH] iommu: omap: mark pm functions __maybe_unused

2019-09-06 Thread Arnd Bergmann
The runtime_pm functions are unused when CONFIG_PM is disabled: drivers/iommu/omap-iommu.c:1022:12: error: unused function 'omap_iommu_runtime_suspend' [-Werror,-Wunused-function] static int omap_iommu_runtime_suspend(struct device *dev) drivers/iommu/omap-iommu.c:1064:12: error: unused function

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

2019-09-06 Thread Stephen Boyd
Quoting Vivek Gautam (2019-08-22 23:32:46) > There are scnenarios where drivers are required to make a > scm call in atomic context, such as in one of the qcom's > arm-smmu-500 errata [1]. > > [1] ("https://source.codeaurora.org/quic/la/kernel/msm-4.9/ >

[git pull] IOMMU Fixes for Linux v5.3-rc7

2019-09-06 Thread Joerg Roedel
Hi Linus, The following changes since commit a55aa89aab90fae7c815b0551b07be37db359d76: Linux 5.3-rc6 (2019-08-25 12:01:23 -0700) are available in the Git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git tags/iommu-fixes-v5.3-rc7 for you to fetch changes up to

Re: [PATCH v4 3/3] iommu: arm-smmu-impl: Add sdm845 implementation hook

2019-09-06 Thread Stephen Boyd
Quoting Vivek Gautam (2019-08-22 23:32:48) > diff --git a/drivers/iommu/arm-smmu-impl.c b/drivers/iommu/arm-smmu-impl.c > index 3f88cd078dd5..0aef87c41f9c 100644 > --- a/drivers/iommu/arm-smmu-impl.c > +++ b/drivers/iommu/arm-smmu-impl.c > @@ -102,7 +103,6 @@ static struct arm_smmu_device >

Re: [PATCH 09/11] swiotlb-xen: simplify cache maintainance

2019-09-06 Thread Boris Ostrovsky
On 9/6/19 10:43 AM, Konrad Rzeszutek Wilk wrote: > On Fri, Sep 06, 2019 at 10:19:01AM -0400, Boris Ostrovsky wrote: >> On 9/6/19 10:01 AM, Christoph Hellwig wrote: >>> On Fri, Sep 06, 2019 at 09:52:12AM -0400, Boris Ostrovsky wrote: We need nop definitions of these two for x86.

Re: [PATCH 09/11] swiotlb-xen: simplify cache maintainance

2019-09-06 Thread Konrad Rzeszutek Wilk
On Fri, Sep 06, 2019 at 10:19:01AM -0400, Boris Ostrovsky wrote: > On 9/6/19 10:01 AM, Christoph Hellwig wrote: > > On Fri, Sep 06, 2019 at 09:52:12AM -0400, Boris Ostrovsky wrote: > >> We need nop definitions of these two for x86. > >> > >> Everything builds now but that's probably because the

Re: [PATCH] media: staging: tegra-vde: Disable building with COMPILE_TEST

2019-09-06 Thread Yuehaibing
On 2019/9/6 21:38, Dmitry Osipenko wrote: > 29.08.2019 18:49, Thierry Reding пишет: >> On Thu, Aug 29, 2019 at 04:58:22PM +0300, Dmitry Osipenko wrote: >>> 29.08.2019 15:40, Thierry Reding пишет: On Thu, Aug 29, 2019 at 01:39:32PM +0200, Hans Verkuil wrote: > On 8/26/19 3:31 PM,

Re: [PATCH 09/11] swiotlb-xen: simplify cache maintainance

2019-09-06 Thread Boris Ostrovsky
On 9/6/19 10:01 AM, Christoph Hellwig wrote: > On Fri, Sep 06, 2019 at 09:52:12AM -0400, Boris Ostrovsky wrote: >> We need nop definitions of these two for x86. >> >> Everything builds now but that's probably because the calls are under >> 'if (!dev_is_dma_coherent(dev))' which is always false so

Re: [Xen-devel] [PATCH 09/11] swiotlb-xen: simplify cache maintainance

2019-09-06 Thread Andrew Cooper
On 06/09/2019 15:01, Christoph Hellwig wrote: > On Fri, Sep 06, 2019 at 09:52:12AM -0400, Boris Ostrovsky wrote: >> We need nop definitions of these two for x86. >> >> Everything builds now but that's probably because the calls are under >> 'if (!dev_is_dma_coherent(dev))' which is always false so

Re: [PATCH 09/11] swiotlb-xen: simplify cache maintainance

2019-09-06 Thread Christoph Hellwig
On Fri, Sep 06, 2019 at 09:52:12AM -0400, Boris Ostrovsky wrote: > We need nop definitions of these two for x86. > > Everything builds now but that's probably because the calls are under > 'if (!dev_is_dma_coherent(dev))' which is always false so compiler > optimized is out. I don't think we

Re: [PATCH 09/11] swiotlb-xen: simplify cache maintainance

2019-09-06 Thread Boris Ostrovsky
On 9/5/19 7:34 AM, Christoph Hellwig wrote: > diff --git a/include/xen/swiotlb-xen.h b/include/xen/swiotlb-xen.h > index 5e4b83f83dbc..d71380f6ed0b 100644 > --- a/include/xen/swiotlb-xen.h > +++ b/include/xen/swiotlb-xen.h > @@ -4,6 +4,11 @@ > > #include > > +void xen_dma_sync_for_cpu(struct

Re: [PATCH] media: staging: tegra-vde: Disable building with COMPILE_TEST

2019-09-06 Thread Dmitry Osipenko
29.08.2019 18:49, Thierry Reding пишет: > On Thu, Aug 29, 2019 at 04:58:22PM +0300, Dmitry Osipenko wrote: >> 29.08.2019 15:40, Thierry Reding пишет: >>> On Thu, Aug 29, 2019 at 01:39:32PM +0200, Hans Verkuil wrote: On 8/26/19 3:31 PM, YueHaibing wrote: > If COMPILE_TEST is y and

Re: [PATCH v2] swiotlb-xen: Convert to use macro

2019-09-06 Thread Souptick Joarder
On Fri, Sep 6, 2019 at 7:02 PM Boris Ostrovsky wrote: > > On 9/6/19 8:27 AM, Souptick Joarder wrote: > > On Mon, Sep 2, 2019 at 2:04 PM Souptick Joarder > > wrote: > >> Rather than using static int max_dma_bits, this > >> can be coverted to use as macro. > >> > >> Signed-off-by: Souptick

Re: [PATCH v2] swiotlb-xen: Convert to use macro

2019-09-06 Thread Boris Ostrovsky
On 9/6/19 8:27 AM, Souptick Joarder wrote: > On Mon, Sep 2, 2019 at 2:04 PM Souptick Joarder wrote: >> Rather than using static int max_dma_bits, this >> can be coverted to use as macro. >> >> Signed-off-by: Souptick Joarder >> Reviewed-by: Juergen Gross > If it is still not late, can we get

Re: [PATCH v2] swiotlb-xen: Convert to use macro

2019-09-06 Thread Souptick Joarder
On Mon, Sep 2, 2019 at 2:04 PM Souptick Joarder wrote: > > Rather than using static int max_dma_bits, this > can be coverted to use as macro. > > Signed-off-by: Souptick Joarder > Reviewed-by: Juergen Gross If it is still not late, can we get this patch in queue for 5.4 ? > --- >

[PATCH] iommu/amd: Fix race in increase_address_space()

2019-09-06 Thread Joerg Roedel
On Thu, Sep 05, 2019 at 04:57:21PM -0400, Qian Cai wrote: > On Thu, 2019-09-05 at 13:43 +0200, Joerg Roedel wrote: > > But I think the right fix is to lock the operation in > > increase_address_space() directly, and not the calls around it, like in > > the diff below. It is untested, so can you

Re: [PATCH] amd/iommu: flush old domains in kdump kernel

2019-09-06 Thread Joerg Roedel
On Thu, Sep 05, 2019 at 12:09:48PM -0500, Stuart Hayes wrote: > When devices are attached to the amd_iommu in a kdump kernel, the old device > table entries (DTEs), which were copied from the crashed kernel, will be > overwritten with a new domain number. When the new DTE is written, the IOMMU >

Re: [PATCH v4 3/3] iommu: arm-smmu-impl: Add sdm845 implementation hook

2019-09-06 Thread Vivek Gautam
On Fri, Aug 23, 2019 at 12:03 PM Vivek Gautam wrote: > > Add reset hook for sdm845 based platforms to turn off > the wait-for-safe sequence. > > Understanding how wait-for-safe logic affects USB and UFS performance > on MTP845 and DB845 boards: > > Qcom's implementation of arm,mmu-500 adds a

[PATCH v9 5/5] iommu/vt-d: Use bounce buffer for untrusted devices

2019-09-06 Thread Lu Baolu
The Intel VT-d hardware uses paging for DMA remapping. The minimum mapped window is a page size. The device drivers may map buffers not filling the whole IOMMU window. This allows the device to access to possibly unrelated memory and a malicious device could exploit this to perform DMA attacks. To

[PATCH v9 4/5] iommu/vt-d: Add trace events for device dma map/unmap

2019-09-06 Thread Lu Baolu
This adds trace support for the Intel IOMMU driver. It also declares some events which could be used to trace the events when an IOVA is being mapped or unmapped in a domain. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Mika Westerberg Signed-off-by: Lu Baolu Reviewed-by: Steven

[PATCH v9 3/5] iommu/vt-d: Don't switch off swiotlb if bounce page is used

2019-09-06 Thread Lu Baolu
The bounce page implementation depends on swiotlb. Hence, don't switch off swiotlb if the system has untrusted devices or could potentially be hot-added with any untrusted devices. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig ---

[PATCH v9 0/5] iommu: Bounce page for untrusted devices

2019-09-06 Thread Lu Baolu
The Thunderbolt vulnerabilities are public and have a nice name as Thunderclap [1] [3] nowadays. This patch series aims to mitigate those concerns. An external PCI device is a PCI peripheral device connected to the system through an external bus, such as Thunderbolt. What makes it different is

[PATCH v9 2/5] iommu/vt-d: Check whether device requires bounce buffer

2019-09-06 Thread Lu Baolu
This adds a helper to check whether a device needs to use bounce buffer. It also provides a boot time option to disable the bounce buffer. Users can use this to prevent the iommu driver from using the bounce buffer for performance gain. Cc: Ashok Raj Cc: Jacob Pan Cc: Kevin Tian Signed-off-by:

[PATCH v9 1/5] swiotlb: Split size parameter to map/unmap APIs

2019-09-06 Thread Lu Baolu
This splits the size parameter to swiotlb_tbl_map_single() and swiotlb_tbl_unmap_single() into an alloc_size and a mapping_size parameter, where the latter one is rounded up to the iommu page size. Suggested-by: Christoph Hellwig Signed-off-by: Lu Baolu Reviewed-by: Christoph Hellwig ---