[PATCH 1/2] iommu: amd: Restore IRTE.RemapEn bit after programming IRTE

2020-09-02 Thread Suravee Suthikulpanit
Currently, the RemapEn (valid) bit is accidentally cleared when programming IRTE w/ guestMode=0. It should be restored to the prior state. Signed-off-by: Suravee Suthikulpanit --- drivers/iommu/amd/iommu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iommu/amd/iommu.c b/drivers/

Re: [PATCH v9 14/32] drm: omapdrm: fix common struct sg_table related issues

2020-09-02 Thread Tomi Valkeinen via iommu
On 01/09/2020 22:33, Robin Murphy wrote: > On 2020-08-26 07:32, 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,

[PATCH 0/2] iommu: amd: Fix intremap IO_PAGE_FAULT for VMs

2020-09-02 Thread Suravee Suthikulpanit
Interrupt remapping IO_PAGE_FAULT has been observed under system w/ large number of VMs w/ pass-through devices. This can be reproduced with 64 VMs + 64 pass-through VFs of Mellanox MT28800 Family [ConnectX-5 Ex], where each VM runs small-packet netperf test via the pass-through device to the netse

Re: [PATCH] iommu: Allocate dev_iommu before accessing priv data

2020-09-02 Thread Robin Murphy
On 2020-09-02 06:32, Torsten Hilbrich wrote: After updating from v5.8 to v5.9-rc2 I noticed some problems when booting a system with kernel cmdline "intel_iommu=on,igfx_off". The following stacktrace was produced: <6>[0.00] Command line: BOOT_IMAGE=/isolinux/bzImage console=tty1 intel_

Re: [PATCH v11 07/11] device-mapping: Introduce DMA range map, supplanting dma_pfn_offset

2020-09-02 Thread Jim Quinlan via iommu
On Tue, Sep 1, 2020 at 4:24 AM Christoph Hellwig wrote: > > I've applied this to the dma-mapping tree. > > I had to resolve a conflict in drivers/of/address.c with a recent > mainline commit. I also applied the minor tweaks Andy pointed out > plus a few more style changes. A real change is that

Re: [PATCH 07/28] 53c700: improve non-coherent DMA handling

2020-09-02 Thread Helge Deller
Hi Willy, On 01.09.20 18:53, Matthew Wilcox wrote: > On Tue, Sep 01, 2020 at 06:41:12PM +0200, Helge Deller wrote: >>> I still have a zoo of machines running for such testing, including a >>> 715/64 and two 730. >>> I'm going to test this git tree on the 715/64: > > The 715/64 is a 7100LC machine

Re: [PATCH 2/2] iommu: amd: Use cmpxchg_double() when updating 128-bit IRTE

2020-09-02 Thread Joao Martins
On 9/2/20 5:51 AM, Suravee Suthikulpanit wrote: > When using 128-bit interrupt-remapping table entry (IRTE) (a.k.a GA mode), > current driver disables interrupt remapping when it updates the IRTE > so that the upper and lower 64-bit values can be updated safely. > > However, this creates a small w

Re: [PATCH 1/2] iommu: amd: Restore IRTE.RemapEn bit after programming IRTE

2020-09-02 Thread Joao Martins
On 9/2/20 5:51 AM, Suravee Suthikulpanit wrote: > Currently, the RemapEn (valid) bit is accidentally cleared when > programming IRTE w/ guestMode=0. It should be restored to > the prior state. > Probably requires: Fixes: b9fc6b56f478 ("iommu/amd: Implements irq_set_vcpu_affinity() hook to setup

[PATCH v2 2/3] swiotlb: Declare swiotlb_late_init_with_default_size() in header

2020-09-02 Thread Andy Shevchenko
Compiler is not happy about one function prototype: CC kernel/dma/swiotlb.o kernel/dma/swiotlb.c:275:1: warning: no previous prototype for ‘swiotlb_late_init_with_default_size’ [-Wmissing-prototypes] 275 | swiotlb_late_init_with_default_size(size_t default_size) | ^~~

[PATCH v2 3/3] swiotlb: Mark max_segment with static keyword

2020-09-02 Thread Andy Shevchenko
Sparse is not happy about max_segment declaration: CHECK kernel/dma/swiotlb.c kernel/dma/swiotlb.c:96:14: warning: symbol 'max_segment' was not declared. Should it be static? Mark it static as suggested. Signed-off-by: Andy Shevchenko --- v2: no change kernel/dma/swiotlb.c | 2 +- 1 fil

[PATCH v2 1/3] swiotlb: Use %pa to print phys_addr_t variables

2020-09-02 Thread Andy Shevchenko
There is an extension to a %p to print phys_addr_t type of variables. Use it here. Signed-off-by: Andy Shevchenko --- v2: dropped bytes replacement (Fabio) kernel/dma/swiotlb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c inde

Re: [PATCH v2 3/9] iommu/ioasid: Introduce ioasid_set APIs

2020-09-02 Thread Jacob Pan
On Mon, 24 Aug 2020 20:28:48 +0200 Jean-Philippe Brucker wrote: > On Fri, Aug 21, 2020 at 09:35:12PM -0700, Jacob Pan wrote: > > ioasid_set was introduced as an arbitrary token that are shared by a > > group of IOASIDs. For example, if IOASID #1 and #2 are allocated > > via the same ioasid_set*,

Re: [PATCH v2 3/9] iommu/ioasid: Introduce ioasid_set APIs

2020-09-02 Thread Jacob Pan
On Mon, 24 Aug 2020 11:30:47 -0700 Randy Dunlap wrote: > On 8/24/20 11:28 AM, Jean-Philippe Brucker wrote: > >> +/** > >> + * struct ioasid_data - Meta data about ioasid > >> + * > >> + * @id: Unique ID > >> + * @users Number of active users > >> + * @state Track state of the IOASID > >

Re: [PATCH 22/28] sgiseeq: convert from dma_cache_sync to dma_sync_single_for_device

2020-09-02 Thread Thomas Bogendoerfer
On Tue, Sep 01, 2020 at 07:38:10PM +0200, Thomas Bogendoerfer wrote: > On Tue, Sep 01, 2020 at 07:16:27PM +0200, Christoph Hellwig wrote: > > Well, if IP22 doesn't speculate (which I'm pretty sure is the case), > > dma_sync_single_for_cpu should indeeed be a no-op. But then there > > also shouldn'

Re: [PATCH v2 3/9] iommu/ioasid: Introduce ioasid_set APIs

2020-09-02 Thread Jacob Pan
On Mon, 24 Aug 2020 11:34:29 -0700 Randy Dunlap wrote: > On 8/24/20 11:28 AM, Jean-Philippe Brucker wrote: > >> +/** > >> + * struct ioasid_set - Meta data about ioasid_set > >> + * @type: Token types and other features > > nit: doesn't follow struct order > > > >> + * @token:Unique

Re: [PATCH v11 07/11] device-mapping: Introduce DMA range map, supplanting dma_pfn_offset

2020-09-02 Thread Nathan Chancellor
-mapping.h | 36 ++ > kernel/dma/coherent.c | 10 +-- > kernel/dma/mapping.c | 66 + > 23 files changed, 265 insertions(+), 115 deletions(-) Apologies if this has already been reported or is known but this comm

Re: [PATCH v11 07/11] device-mapping: Introduce DMA range map, supplanting dma_pfn_offset

2020-09-02 Thread Jim Quinlan via iommu
; > kernel/dma/coherent.c | 10 +-- > > kernel/dma/mapping.c | 66 + > > 23 files changed, 265 insertions(+), 115 deletions(-) > > Apologies if this has already been reported or is known but this com

Re: [PATCH v11 07/11] device-mapping: Introduce DMA range map, supplanting dma_pfn_offset

2020-09-02 Thread Nathan Chancellor
| 9 ++- > > > drivers/usb/core/usb.c| 7 +- > > > include/linux/device.h| 4 +- > > > include/linux/dma-direct.h| 8 +-- > > > include/linux/dma-mapping.h |

Re: [PATCH v11 07/11] device-mapping: Introduce DMA range map, supplanting dma_pfn_offset

2020-09-02 Thread Florian Fainelli
On 9/2/2020 3:38 PM, Nathan Chancellor wrote: [snip] Hello Nathan, Can you tell me how much memory your RPI has and if all of it is This is the 4GB version. accessible by the PCIe device? Could you also please include the DTS of the PCIe node? IIRC, the RPI firmware does some mangling o

Re: [PATCH v11 07/11] device-mapping: Introduce DMA range map, supplanting dma_pfn_offset

2020-09-02 Thread Nathan Chancellor
rnel/git/torvalds/linux.git/tree/arch/arm/boot/dts/bcm2711.dtsi#n264 > > and the resulting dma-ranges parsing is just not working for reasons to be > determined. > -- > Florian Let me know if you need anything else out of me. Cheers, Nathan device.dtb Description: Binary dat

Re: [PATCH v2 1/3] swiotlb: Use %pa to print phys_addr_t variables

2020-09-02 Thread Fabio Estevam
On Wed, Sep 2, 2020 at 2:31 PM Andy Shevchenko wrote: > > There is an extension to a %p to print phys_addr_t type of variables. > Use it here. > > Signed-off-by: Andy Shevchenko > --- > v2: dropped bytes replacement (Fabio) Reviewed-by: Fabio Estevam

Re: [PATCH] iommu: Allocate dev_iommu before accessing priv data

2020-09-02 Thread Lu Baolu
Hi Robin, On 9/2/20 7:31 PM, Robin Murphy wrote: On 2020-09-02 06:32, Torsten Hilbrich wrote: After updating from v5.8 to v5.9-rc2 I noticed some problems when booting a system with kernel cmdline "intel_iommu=on,igfx_off". The following stacktrace was produced: <6>[    0.00] Command line

[PATCH 1/1] iommu/vt-d: Fix NULL pointer dereference in dev_iommu_priv_set()

2020-09-02 Thread Lu Baolu
The dev_iommu_priv_set() must be called after probe_device(). This fixes a NULL pointer deference bug when booting a system with kernel cmdline "intel_iommu=on,igfx_off", where the dev_iommu_priv_set() is abused. The following stacktrace was produced: [0.00] Command line: BOOT_IMAGE=/isol