Re: [RFC PATCH] iommu/amd: fix a race in increase_address_space()

2019-09-05 Thread Joerg Roedel
Hi Qian, On Wed, Sep 04, 2019 at 05:24:22PM -0400, Qian Cai wrote: > if (domain->mode == PAGE_MODE_6_LEVEL) > /* address space already 64 bit large */ > return false; > > This gives a clue that there must be a race between multiple concurrent > threads in

[PATCH 04/11] xen/arm: simplify dma_cache_maint

2019-09-05 Thread Christoph Hellwig
Calculate the required operation in the caller, and pass it directly instead of recalculating it for each page, and use simple arithmetics to get from the physical address to Xen page size aligned chunks. Signed-off-by: Christoph Hellwig Reviewed-by: Stefano Stabellini --- arch/arm/xen/mm.c |

[PATCH 07/11] swiotlb-xen: remove xen_swiotlb_dma_mmap and xen_swiotlb_dma_get_sgtable

2019-09-05 Thread Christoph Hellwig
There is no need to wrap the common version, just wire them up directly. Signed-off-by: Christoph Hellwig Reviewed-by: Stefano Stabellini --- drivers/xen/swiotlb-xen.c | 29 ++--- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c

[PATCH 03/11] xen/arm: use dev_is_dma_coherent

2019-09-05 Thread Christoph Hellwig
Use the dma-noncoherent dev_is_dma_coherent helper instead of the home grown variant. Note that both are always initialized to the same value in arch_setup_dma_ops. Signed-off-by: Christoph Hellwig Reviewed-by: Julien Grall Reviewed-by: Stefano Stabellini ---

[PATCH 02/11] xen/arm: consolidate page-coherent.h

2019-09-05 Thread Christoph Hellwig
Shared the duplicate arm/arm64 code in include/xen/arm/page-coherent.h. Signed-off-by: Christoph Hellwig --- arch/arm/include/asm/xen/page-coherent.h | 75 arch/arm64/include/asm/xen/page-coherent.h | 75 include/xen/arm/page-coherent.h|

[PATCH 06/11] xen: remove the exports for xen_{create,destroy}_contiguous_region

2019-09-05 Thread Christoph Hellwig
These routines are only used by swiotlb-xen, which cannot be modular. Signed-off-by: Christoph Hellwig Reviewed-by: Stefano Stabellini --- arch/arm/xen/mm.c | 2 -- arch/x86/xen/mmu_pv.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/arch/arm/xen/mm.c b/arch/arm/xen/mm.c index

[PATCH 05/11] xen/arm: remove xen_dma_ops

2019-09-05 Thread Christoph Hellwig
arm and arm64 can just use xen_swiotlb_dma_ops directly like x86, no need for a pointer indirection. Signed-off-by: Christoph Hellwig Reviewed-by: Julien Grall Reviewed-by: Stefano Stabellini --- arch/arm/mm/dma-mapping.c| 3 ++- arch/arm/xen/mm.c| 4

[PATCH 11/11] arm64: use asm-generic/dma-mapping.h

2019-09-05 Thread Christoph Hellwig
Now that the Xen special cases are gone nothing worth mentioning is left in the arm64 file, so switch to use the asm-generic version instead. Signed-off-by: Christoph Hellwig Acked-by: Will Deacon Reviewed-by: Stefano Stabellini --- arch/arm64/include/asm/Kbuild| 1 +

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

2019-09-05 Thread Christoph Hellwig
Now that we know we always have the dma-noncoherent.h helpers available if we are on an architecture with support for non-coherent devices, we can just call them directly, and remove the calls to the dma-direct routines, including the fact that we call the dma_direct_map_page routines but ignore

[PATCH 10/11] swiotlb-xen: merge xen_unmap_single into xen_swiotlb_unmap_page

2019-09-05 Thread Christoph Hellwig
No need for a no-op wrapper. Signed-off-by: Christoph Hellwig Reviewed-by: Stefano Stabellini --- drivers/xen/swiotlb-xen.c | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/xen/swiotlb-xen.c b/drivers/xen/swiotlb-xen.c index

[PATCH 08/11] swiotlb-xen: use the same foreign page check everywhere

2019-09-05 Thread Christoph Hellwig
xen_dma_map_page uses a different and more complicated check for foreign pages than the other three cache maintainance helpers. Switch it to the simpler pfn_valid method a well, and document the scheme with a single improved comment in xen_dma_map_page. Signed-off-by: Christoph Hellwig

swiotlb-xen cleanups v4

2019-09-05 Thread Christoph Hellwig
Hi Xen maintainers and friends, please take a look at this series that cleans up the parts of swiotlb-xen that deal with non-coherent caches. Changes since v3: - don't use dma_direct_alloc on x86 Changes since v2: - further dma_cache_maint improvements - split the previous patch 1 into 3

[PATCH 01/11] xen/arm: use dma-noncoherent.h calls for xen-swiotlb cache maintainance

2019-09-05 Thread Christoph Hellwig
Copy the arm64 code that uses the dma-direct/swiotlb helpers for DMA on-coherent devices. Signed-off-by: Christoph Hellwig --- arch/arm/include/asm/device.h| 3 - arch/arm/include/asm/xen/page-coherent.h | 72 +--- arch/arm/mm/dma-mapping.c| 8

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

2019-09-05 Thread Stuart Hayes
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 is told to flush the DTE from its internal cache--but it is not told

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

2019-09-05 Thread Sakari Ailus
On Thu, Sep 05, 2019 at 07:53:37PM +0900, Tomasz Figa wrote: > On Thu, Sep 5, 2019 at 7:45 PM Sakari Ailus > wrote: > > > > Hi Dongchun, > > > > On Thu, Sep 05, 2019 at 05:41:05PM +0800, Dongchun Zhu wrote: > > > > ... > > > > > > > + ret = regulator_bulk_enable(OV02A10_NUM_SUPPLIES, > > > > >

Re: [RFC PATCH] iommu/amd: fix a race in increase_address_space()

2019-09-05 Thread Qian Cai
On Thu, 2019-09-05 at 13:43 +0200, Joerg Roedel wrote: > Hi Qian, > > On Wed, Sep 04, 2019 at 05:24:22PM -0400, Qian Cai wrote: > > if (domain->mode == PAGE_MODE_6_LEVEL) > > /* address space already 64 bit large */ > > return false; > > > > This gives a clue that

Re: [bug] __blk_mq_run_hw_queue suspicious rcu usage

2019-09-05 Thread David Rientjes via iommu
On Thu, 5 Sep 2019, Christoph Hellwig wrote: > > Hi Christoph, Jens, and Ming, > > > > While booting a 5.2 SEV-enabled guest we have encountered the following > > WARNING that is followed up by a BUG because we are in atomic context > > while trying to call set_memory_decrypted: > > Well,

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

2019-09-05 Thread Nicolas Boichat
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 Ailus > > wrote: > > > > > > Hi Dongchun, > > > > > > On Thu, Sep 05, 2019 at 05:41:05PM +0800, Dongchun Zhu wrote: > > > > > > ... > > >

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

2019-09-05 Thread Dongchun Zhu
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 Ailus > > > wrote: > > > > > > > > Hi Dongchun, > > > > > > > > On

Re: [RFC PATCH] virtio_ring: Use DMA API if guest memory is encrypted

2019-09-05 Thread Michael S. Tsirkin
On Mon, Aug 12, 2019 at 02:15:32PM +0200, Christoph Hellwig wrote: > On Sun, Aug 11, 2019 at 04:55:27AM -0400, Michael S. Tsirkin wrote: > > On Sun, Aug 11, 2019 at 07:56:07AM +0200, Christoph Hellwig wrote: > > > So we need a flag on the virtio device, exposed by the > > > hypervisor (or hardware

Re: [PATCH V5 0/5] iommu/amd: Convert the AMD iommu driver to the dma-iommu api

2019-09-05 Thread Christoph Hellwig
Dave, Joerg, Robin: is there any chance we could at least pick up patches 2 and 4 ASAP as they are clearly fixes for current deficits, even without the amd conversion? ___ iommu mailing list iommu@lists.linux-foundation.org

Re: [bug] __blk_mq_run_hw_queue suspicious rcu usage

2019-09-05 Thread Christoph Hellwig
On Wed, Sep 04, 2019 at 02:40:44PM -0700, David Rientjes wrote: > Hi Christoph, Jens, and Ming, > > While booting a 5.2 SEV-enabled guest we have encountered the following > WARNING that is followed up by a BUG because we are in atomic context > while trying to call set_memory_decrypted: Well,

Re: [V2, 2/2] media: i2c: Add DW9768 VCM driver

2019-09-05 Thread Tomasz Figa
Hi Dongchun, On Thu, Sep 5, 2019 at 4:22 PM wrote: > > From: Dongchun Zhu > > This patch adds a V4L2 sub-device driver for DW9768 lens voice coil, > and provides control to set the desired focus. > > The DW9768 is a 10 bit DAC with 100mA output current sink capability > from Dongwoon, designed

Re: [PATCH 2/2] iommu/ipmmu-vmsa: Disable cache snoop transactions on R-Car Gen3

2019-09-05 Thread Simon Horman
On Wed, Sep 04, 2019 at 02:08:02PM +0200, Geert Uytterhoeven wrote: > From: Hai Nguyen Pham > > According to the Hardware Manual Errata for Rev. 1.50 of April 10, 2019, > cache snoop transactions for page table walk requests are not supported > on R-Car Gen3. > > Hence, this patch removes

Re: [PATCH 1/2] iommu/ipmmu-vmsa: Move IMTTBCR_SL0_TWOBIT_* to restore sort order

2019-09-05 Thread Simon Horman
On Wed, Sep 04, 2019 at 02:08:01PM +0200, Geert Uytterhoeven wrote: > Move the recently added IMTTBCR_SL0_TWOBIT_* definitions up, to make > sure all IMTTBCR register bit definitions are sorted by decreasing bit > index. Add comments to make it clear that they exist on R-Car Gen3 > only. > >

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

2019-09-05 Thread Tomasz Figa
On Thu, Sep 5, 2019 at 7:45 PM Sakari Ailus wrote: > > Hi Dongchun, > > On Thu, Sep 05, 2019 at 05:41:05PM +0800, Dongchun Zhu wrote: > > ... > > > > > + ret = regulator_bulk_enable(OV02A10_NUM_SUPPLIES, ov02a10->supplies); > > > > + if (ret < 0) { > > > > + dev_err(dev, "Failed to enable