Re: [PATCH] dma-debug: dynamic allocation of hash table

2020-01-31 Thread Robin Murphy
On 2020-01-31 5:46 pm, Eric Dumazet wrote: On Fri, Jan 31, 2020 at 9:43 AM Robin Murphy wrote: On 31/01/2020 2:42 pm, Eric Dumazet wrote: On Fri, Jan 31, 2020 at 4:30 AM Robin Murphy wrote: ...and when that represents ~5% of the total system RAM it is a *lot* less reasonable than even

Re: [PATCH 3/3] iommu/uapi: Add helper function for size lookup

2020-01-31 Thread Jacob Pan
Hi Alex, Sorry I missed this part in the previous reply. Comments below. On Wed, 29 Jan 2020 15:19:51 -0700 Alex Williamson wrote: > Also, is the 12-bytes of padding in struct iommu_gpasid_bind_data > excessive with this new versioning scheme? Per rule #2 I'm not sure > if we're allowed to

Re: [PATCH V9 04/10] iommu/vt-d: Add bind guest PASID support

2020-01-31 Thread Jacob Pan
Hi Baolu, Thanks for the review, my comments inline. On Thu, 30 Jan 2020 15:22:09 +0800 Lu Baolu wrote: > Hi Jacob, > > On 2020/1/29 14:01, Jacob Pan wrote: > > When supporting guest SVA with emulated IOMMU, the guest PASID > > table is shadowed in VMM. Updates to guest vIOMMU PASID table > >

Re: [PATCH 3/3] iommu/uapi: Add helper function for size lookup

2020-01-31 Thread Jacob Pan
On Wed, 29 Jan 2020 15:19:51 -0700 Alex Williamson wrote: > On Wed, 29 Jan 2020 14:40:46 -0700 > Alex Williamson wrote: > > > On Tue, 28 Jan 2020 22:02:04 -0800 > > Jacob Pan wrote: > > > > > IOMMU UAPI can be extended in the future by adding new > > > fields at the end of each user data

Re: [PATCH 3/3] iommu/uapi: Add helper function for size lookup

2020-01-31 Thread Jacob Pan
On Wed, 29 Jan 2020 14:40:46 -0700 Alex Williamson wrote: > On Tue, 28 Jan 2020 22:02:04 -0800 > Jacob Pan wrote: > > > IOMMU UAPI can be extended in the future by adding new > > fields at the end of each user data structure. Since we use > > a unified UAPI version for compatibility checking,

Re: [PATCH] dma-debug: dynamic allocation of hash table

2020-01-31 Thread Eric Dumazet via iommu
On Fri, Jan 31, 2020 at 9:43 AM Robin Murphy wrote: > > On 31/01/2020 2:42 pm, Eric Dumazet wrote: > > On Fri, Jan 31, 2020 at 4:30 AM Robin Murphy wrote: > >> > >> ...and when that represents ~5% of the total system RAM it is a *lot* > >> less reasonable than even 12KB. As I said, it's great to

Re: [PATCH] dma-debug: dynamic allocation of hash table

2020-01-31 Thread Robin Murphy
On 31/01/2020 2:42 pm, Eric Dumazet wrote: On Fri, Jan 31, 2020 at 4:30 AM Robin Murphy wrote: ...and when that represents ~5% of the total system RAM it is a *lot* less reasonable than even 12KB. As I said, it's great to make a debug option more efficient such that what it observes is more

Re: [PATCH] dma-debug: dynamic allocation of hash table

2020-01-31 Thread Eric Dumazet via iommu
On Fri, Jan 31, 2020 at 4:30 AM Robin Murphy wrote: > > ...and when that represents ~5% of the total system RAM it is a *lot* > less reasonable than even 12KB. As I said, it's great to make a debug > option more efficient such that what it observes is more representative > of the non-debug

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-31 Thread Peter Ujfalusi via iommu
Hi Christoph, On 30/01/2020 18.40, Christoph Hellwig wrote: > On Thu, Jan 30, 2020 at 03:04:37PM +0200, Peter Ujfalusi via iommu wrote: >> On 30/01/2020 9.53, Christoph Hellwig wrote: >>> [skipping the DT bits, as I'm everything but an expert on that..] >>> >>> On Mon, Jan 27, 2020 at 04:00:30PM

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-31 Thread Peter Ujfalusi via iommu
Hi Christoph, On 30/01/2020 18.40, Christoph Hellwig wrote: > On Thu, Jan 30, 2020 at 03:04:37PM +0200, Peter Ujfalusi via iommu wrote: >> On 30/01/2020 9.53, Christoph Hellwig wrote: >>> [skipping the DT bits, as I'm everything but an expert on that..] >>> >>> On Mon, Jan 27, 2020 at 04:00:30PM

Re: [PoC] arm: dma-mapping: direct: Apply dma_pfn_offset only when it is valid

2020-01-31 Thread Peter Ujfalusi via iommu
Hi Christoph, On 30/01/2020 18.40, Christoph Hellwig wrote: > On Thu, Jan 30, 2020 at 03:04:37PM +0200, Peter Ujfalusi via iommu wrote: >> On 30/01/2020 9.53, Christoph Hellwig wrote: >>> [skipping the DT bits, as I'm everything but an expert on that..] >>> >>> On Mon, Jan 27, 2020 at 04:00:30PM

Re: [PATCH] dma-debug: add a per-cpu cache to avoid lock contention

2020-01-31 Thread Robin Murphy
On 2020-01-30 8:14 pm, Eric Dumazet via iommu wrote: Networking drivers very often have to replace one page with another for their RX ring buffers. A multi-queue NIC will severly hit a contention point in dma-debug while grabbing free_entries_lock spinlock. Adding a one entry per-cpu cache

RE: [RFC v3 4/8] vfio/type1: Add VFIO_NESTING_GET_IOMMU_UAPI_VERSION

2020-01-31 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, January 30, 2020 7:57 AM > To: Liu, Yi L > Subject: Re: [RFC v3 4/8] vfio/type1: Add > VFIO_NESTING_GET_IOMMU_UAPI_VERSION > > On Wed, 29 Jan 2020 04:11:48 -0800 > "Liu, Yi L" wrote: > > > From: Liu Yi L >

RE: [RFC v3 3/8] vfio: Reclaim PASIDs when application is down

2020-01-31 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, January 30, 2020 7:57 AM > To: Liu, Yi L > Subject: Re: [RFC v3 3/8] vfio: Reclaim PASIDs when application is down > > On Wed, 29 Jan 2020 04:11:47 -0800 > "Liu, Yi L" wrote: > > > From: Liu Yi L > > > >

RE: [RFC v3 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free)

2020-01-31 Thread Liu, Yi L
Hi Alex, > From: Alex Williamson [mailto:alex.william...@redhat.com] > Sent: Thursday, January 30, 2020 7:56 AM > To: Liu, Yi L > Subject: Re: [RFC v3 1/8] vfio: Add VFIO_IOMMU_PASID_REQUEST(alloc/free) > > On Wed, 29 Jan 2020 04:11:45 -0800 > "Liu, Yi L" wrote: > > > From: Liu Yi L > > > >

Re: [PATCH] dma-debug: dynamic allocation of hash table

2020-01-31 Thread Robin Murphy
On 2020-01-31 12:17 am, Eric Dumazet wrote: On Thu, Jan 30, 2020 at 3:46 PM Robin Murphy wrote: Hi Eric, On 2020-01-30 7:10 pm, Eric Dumazet via iommu wrote: Increasing the size of dma_entry_hash size by 327680 bytes has reached some bootloaders limitations. [ That might warrant some

Re: [PATCH] dma-debug: dynamic allocation of hash table

2020-01-31 Thread Robin Murphy
On 2020-01-31 9:06 am, Geert Uytterhoeven wrote: Hi Robin, On Fri, Jan 31, 2020 at 12:46 AM Robin Murphy wrote: On 2020-01-30 7:10 pm, Eric Dumazet via iommu wrote: Increasing the size of dma_entry_hash size by 327680 bytes has reached some bootloaders limitations. [ That might warrant

Re: [PATCH] dma-debug: dynamic allocation of hash table

2020-01-31 Thread Geert Uytterhoeven
Hi Robin, On Fri, Jan 31, 2020 at 12:46 AM Robin Murphy wrote: > On 2020-01-30 7:10 pm, Eric Dumazet via iommu wrote: > > Increasing the size of dma_entry_hash size by 327680 bytes > > has reached some bootloaders limitations. > > [ That might warrant some further explanation - I don't quite