Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2021-01-04 Thread Andrey Grodzovsky
Hey Daniel, back from vacation and going over our last long thread i think you didn't reply to my last question bellow (Or at least I can't find it). Andrey On 12/17/20 4:13 PM, Andrey Grodzovsky wrote: Ok, so I assumed that with vmap_local you were trying to solve the problem of quick reinser

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-18 Thread Daniel Vetter
On Thu, Dec 17, 2020 at 04:06:38PM -0500, Andrey Grodzovsky wrote: > > On 12/17/20 3:48 PM, Daniel Vetter wrote: > > On Thu, Dec 17, 2020 at 9:38 PM Andrey Grodzovsky > > wrote: > > > > > > On 12/17/20 3:10 PM, Christian König wrote: > > > > [SNIP] > > > > > > > By eliminating such users, and re

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-17 Thread Andrey Grodzovsky
On 12/17/20 3:42 PM, Daniel Vetter wrote: On Thu, Dec 17, 2020 at 8:19 PM Andrey Grodzovsky wrote: On 12/17/20 7:01 AM, Daniel Vetter wrote: On Wed, Dec 16, 2020 at 07:20:02PM -0500, Andrey Grodzovsky wrote: On 12/16/20 6:15 PM, Daniel Vetter wrote: On Wed, Dec 16, 2020 at 7:26 PM Andrey G

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-17 Thread Andrey Grodzovsky
On 12/17/20 3:48 PM, Daniel Vetter wrote: On Thu, Dec 17, 2020 at 9:38 PM Andrey Grodzovsky wrote: On 12/17/20 3:10 PM, Christian König wrote: [SNIP] By eliminating such users, and replacing them with local maps which are strictly bound in how long they can exist (and hence we can serializ

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-17 Thread Daniel Vetter
On Thu, Dec 17, 2020 at 9:38 PM Andrey Grodzovsky wrote: > > > On 12/17/20 3:10 PM, Christian König wrote: > > [SNIP] > By eliminating such users, and replacing them with local maps which > > are strictly bound in how long they can exist (and hence we can > > serialize against them fi

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-17 Thread Daniel Vetter
On Thu, Dec 17, 2020 at 8:19 PM Andrey Grodzovsky wrote: > > > On 12/17/20 7:01 AM, Daniel Vetter wrote: > > On Wed, Dec 16, 2020 at 07:20:02PM -0500, Andrey Grodzovsky wrote: > >> On 12/16/20 6:15 PM, Daniel Vetter wrote: > >>> On Wed, Dec 16, 2020 at 7:26 PM Andrey Grodzovsky > >>> wrote: > >>>

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-17 Thread Andrey Grodzovsky
On 12/17/20 3:10 PM, Christian König wrote: [SNIP] By eliminating such users, and replacing them with local maps which are strictly bound in how long they can exist (and hence we can serialize against them finishing in our hotunplug code). Not sure I see how serializing against BO map/unmap h

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-17 Thread Christian König
[SNIP] By eliminating such users, and replacing them with local maps which are strictly bound in how long they can exist (and hence we can serialize against them finishing in our hotunplug code). Not sure I see how serializing against BO map/unmap helps - our problem as you described is that o

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-17 Thread Andrey Grodzovsky
On 12/17/20 7:01 AM, Daniel Vetter wrote: On Wed, Dec 16, 2020 at 07:20:02PM -0500, Andrey Grodzovsky wrote: On 12/16/20 6:15 PM, Daniel Vetter wrote: On Wed, Dec 16, 2020 at 7:26 PM Andrey Grodzovsky wrote: On 12/16/20 12:12 PM, Daniel Vetter wrote: On Wed, Dec 16, 2020 at 5:18 PM Christia

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-17 Thread Daniel Vetter
On Wed, Dec 16, 2020 at 07:20:02PM -0500, Andrey Grodzovsky wrote: > > On 12/16/20 6:15 PM, Daniel Vetter wrote: > > On Wed, Dec 16, 2020 at 7:26 PM Andrey Grodzovsky > > wrote: > > > > > > On 12/16/20 12:12 PM, Daniel Vetter wrote: > > > > On Wed, Dec 16, 2020 at 5:18 PM Christian König > > > >

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-16 Thread Andrey Grodzovsky
On 12/16/20 6:15 PM, Daniel Vetter wrote: On Wed, Dec 16, 2020 at 7:26 PM Andrey Grodzovsky wrote: On 12/16/20 12:12 PM, Daniel Vetter wrote: On Wed, Dec 16, 2020 at 5:18 PM Christian König wrote: Am 16.12.20 um 17:13 schrieb Andrey Grodzovsky: On 12/16/20 9:21 AM, Daniel Vetter wrote: O

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-16 Thread Daniel Vetter
On Wed, Dec 16, 2020 at 7:26 PM Andrey Grodzovsky wrote: > > > On 12/16/20 12:12 PM, Daniel Vetter wrote: > > On Wed, Dec 16, 2020 at 5:18 PM Christian König > > wrote: > >> Am 16.12.20 um 17:13 schrieb Andrey Grodzovsky: > >>> On 12/16/20 9:21 AM, Daniel Vetter wrote: > On Wed, Dec 16, 2020

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-16 Thread Andrey Grodzovsky
On 12/16/20 12:12 PM, Daniel Vetter wrote: On Wed, Dec 16, 2020 at 5:18 PM Christian König wrote: Am 16.12.20 um 17:13 schrieb Andrey Grodzovsky: On 12/16/20 9:21 AM, Daniel Vetter wrote: On Wed, Dec 16, 2020 at 9:04 AM Christian König wrote: Am 15.12.20 um 21:18 schrieb Andrey Grodzovsky:

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-16 Thread Daniel Vetter
On Wed, Dec 16, 2020 at 6:12 PM Daniel Vetter wrote: > > On Wed, Dec 16, 2020 at 5:18 PM Christian König > wrote: > > > > Am 16.12.20 um 17:13 schrieb Andrey Grodzovsky: > > > > > > On 12/16/20 9:21 AM, Daniel Vetter wrote: > > >> On Wed, Dec 16, 2020 at 9:04 AM Christian König > > >> wrote: > >

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-16 Thread Daniel Vetter
On Wed, Dec 16, 2020 at 5:18 PM Christian König wrote: > > Am 16.12.20 um 17:13 schrieb Andrey Grodzovsky: > > > > On 12/16/20 9:21 AM, Daniel Vetter wrote: > >> On Wed, Dec 16, 2020 at 9:04 AM Christian König > >> wrote: > >>> Am 15.12.20 um 21:18 schrieb Andrey Grodzovsky: > [SNIP] > >

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-16 Thread Christian König
Am 16.12.20 um 17:13 schrieb Andrey Grodzovsky: On 12/16/20 9:21 AM, Daniel Vetter wrote: On Wed, Dec 16, 2020 at 9:04 AM Christian König wrote: Am 15.12.20 um 21:18 schrieb Andrey Grodzovsky: [SNIP] While we can't control user application accesses to the mapped buffers explicitly and hence

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-16 Thread Andrey Grodzovsky
On 12/16/20 9:21 AM, Daniel Vetter wrote: On Wed, Dec 16, 2020 at 9:04 AM Christian König wrote: Am 15.12.20 um 21:18 schrieb Andrey Grodzovsky: [SNIP] While we can't control user application accesses to the mapped buffers explicitly and hence we use page fault rerouting I am thinking that i

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-16 Thread Daniel Vetter
On Wed, Dec 16, 2020 at 9:04 AM Christian König wrote: > > Am 15.12.20 um 21:18 schrieb Andrey Grodzovsky: > > [SNIP] > >>> > >>> While we can't control user application accesses to the mapped > >>> buffers explicitly and hence we use page fault rerouting > >>> I am thinking that in this case we

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-16 Thread Christian König
Am 15.12.20 um 21:18 schrieb Andrey Grodzovsky: [SNIP] While we can't control user application accesses to the mapped buffers explicitly and hence we use page fault rerouting I am thinking that in this  case we may be able to sprinkle drm_dev_enter/exit in any such sensitive place were we mig

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-12-15 Thread Andrey Grodzovsky
On 11/24/20 11:44 AM, Christian König wrote: Am 24.11.20 um 17:22 schrieb Andrey Grodzovsky: On 11/24/20 2:41 AM, Christian König wrote: Am 23.11.20 um 22:08 schrieb Andrey Grodzovsky: On 11/23/20 3:41 PM, Christian König wrote: Am 23.11.20 um 21:38 schrieb Andrey Grodzovsky: On 11/23/20

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-30 Thread Daniel Vetter
On Fri, Nov 27, 2020 at 11:04:55AM -0500, Andrey Grodzovsky wrote: > > On 11/27/20 9:59 AM, Daniel Vetter wrote: > > On Wed, Nov 25, 2020 at 02:34:44PM -0500, Andrey Grodzovsky wrote: > > > On 11/25/20 11:36 AM, Daniel Vetter wrote: > > > > On Wed, Nov 25, 2020 at 01:57:40PM +0100, Christian König

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-27 Thread Andrey Grodzovsky
On 11/27/20 9:59 AM, Daniel Vetter wrote: On Wed, Nov 25, 2020 at 02:34:44PM -0500, Andrey Grodzovsky wrote: On 11/25/20 11:36 AM, Daniel Vetter wrote: On Wed, Nov 25, 2020 at 01:57:40PM +0100, Christian König wrote: Am 25.11.20 um 11:40 schrieb Daniel Vetter: On Tue, Nov 24, 2020 at 05:44:0

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-27 Thread Daniel Vetter
On Wed, Nov 25, 2020 at 02:34:44PM -0500, Andrey Grodzovsky wrote: > > On 11/25/20 11:36 AM, Daniel Vetter wrote: > > On Wed, Nov 25, 2020 at 01:57:40PM +0100, Christian König wrote: > > > Am 25.11.20 um 11:40 schrieb Daniel Vetter: > > > > On Tue, Nov 24, 2020 at 05:44:07PM +0100, Christian König

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-27 Thread Grodzovsky, Andrey
...@anholt.net ; ppaala...@gmail.com ; amd-...@lists.freedesktop.org ; gre...@linuxfoundation.org ; Deucher, Alexander ; l.st...@pengutronix.de ; Wentland, Harry ; yuq...@gmail.com Subject: Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use On 11/25/20 11:36 AM, Daniel Vetter wrote

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-25 Thread Andrey Grodzovsky
On 11/25/20 11:36 AM, Daniel Vetter wrote: On Wed, Nov 25, 2020 at 01:57:40PM +0100, Christian König wrote: Am 25.11.20 um 11:40 schrieb Daniel Vetter: On Tue, Nov 24, 2020 at 05:44:07PM +0100, Christian König wrote: Am 24.11.20 um 17:22 schrieb Andrey Grodzovsky: On 11/24/20 2:41 AM, Christ

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-25 Thread Daniel Vetter
On Wed, Nov 25, 2020 at 5:56 PM Michel Dänzer wrote: > > On 2020-11-25 1:57 p.m., Christian König wrote: > > > > Well thinking more about this, it seems to be a another really good > > argument why mapping pages from DMA-bufs into application address space > > directly is a very bad idea :) > > Ap

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-25 Thread Michel Dänzer
On 2020-11-25 1:57 p.m., Christian König wrote: Well thinking more about this, it seems to be a another really good argument why mapping pages from DMA-bufs into application address space directly is a very bad idea :) Apologies for going off on a tangent here... Since allowing userspace mm

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-25 Thread Daniel Vetter
On Wed, Nov 25, 2020 at 01:57:40PM +0100, Christian König wrote: > Am 25.11.20 um 11:40 schrieb Daniel Vetter: > > On Tue, Nov 24, 2020 at 05:44:07PM +0100, Christian König wrote: > > > Am 24.11.20 um 17:22 schrieb Andrey Grodzovsky: > > > > On 11/24/20 2:41 AM, Christian König wrote: > > > > > Am

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-25 Thread Christian König
Am 25.11.20 um 11:40 schrieb Daniel Vetter: On Tue, Nov 24, 2020 at 05:44:07PM +0100, Christian König wrote: Am 24.11.20 um 17:22 schrieb Andrey Grodzovsky: On 11/24/20 2:41 AM, Christian König wrote: Am 23.11.20 um 22:08 schrieb Andrey Grodzovsky: On 11/23/20 3:41 PM, Christian König wrote:

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-25 Thread Daniel Vetter
On Tue, Nov 24, 2020 at 05:44:07PM +0100, Christian König wrote: > Am 24.11.20 um 17:22 schrieb Andrey Grodzovsky: > > > > On 11/24/20 2:41 AM, Christian König wrote: > > > Am 23.11.20 um 22:08 schrieb Andrey Grodzovsky: > > > > > > > > On 11/23/20 3:41 PM, Christian König wrote: > > > > > Am 23.

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-24 Thread Christian König
Am 24.11.20 um 17:22 schrieb Andrey Grodzovsky: On 11/24/20 2:41 AM, Christian König wrote: Am 23.11.20 um 22:08 schrieb Andrey Grodzovsky: On 11/23/20 3:41 PM, Christian König wrote: Am 23.11.20 um 21:38 schrieb Andrey Grodzovsky: On 11/23/20 3:20 PM, Christian König wrote: Am 23.11.20 u

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-24 Thread Andrey Grodzovsky
On 11/24/20 2:41 AM, Christian König wrote: Am 23.11.20 um 22:08 schrieb Andrey Grodzovsky: On 11/23/20 3:41 PM, Christian König wrote: Am 23.11.20 um 21:38 schrieb Andrey Grodzovsky: On 11/23/20 3:20 PM, Christian König wrote: Am 23.11.20 um 21:05 schrieb Andrey Grodzovsky: On 11/25/20

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-23 Thread Christian König
Am 23.11.20 um 22:08 schrieb Andrey Grodzovsky: On 11/23/20 3:41 PM, Christian König wrote: Am 23.11.20 um 21:38 schrieb Andrey Grodzovsky: On 11/23/20 3:20 PM, Christian König wrote: Am 23.11.20 um 21:05 schrieb Andrey Grodzovsky: On 11/25/20 5:42 AM, Christian König wrote: Am 21.11.20 u

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-23 Thread Andrey Grodzovsky
On 11/23/20 3:41 PM, Christian König wrote: Am 23.11.20 um 21:38 schrieb Andrey Grodzovsky: On 11/23/20 3:20 PM, Christian König wrote: Am 23.11.20 um 21:05 schrieb Andrey Grodzovsky: On 11/25/20 5:42 AM, Christian König wrote: Am 21.11.20 um 06:21 schrieb Andrey Grodzovsky: It's needed t

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-23 Thread Christian König
Am 23.11.20 um 21:38 schrieb Andrey Grodzovsky: On 11/23/20 3:20 PM, Christian König wrote: Am 23.11.20 um 21:05 schrieb Andrey Grodzovsky: On 11/25/20 5:42 AM, Christian König wrote: Am 21.11.20 um 06:21 schrieb Andrey Grodzovsky: It's needed to drop iommu backed pages on device unplug bef

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-23 Thread Andrey Grodzovsky
On 11/23/20 3:20 PM, Christian König wrote: Am 23.11.20 um 21:05 schrieb Andrey Grodzovsky: On 11/25/20 5:42 AM, Christian König wrote: Am 21.11.20 um 06:21 schrieb Andrey Grodzovsky: It's needed to drop iommu backed pages on device unplug before device's IOMMU group is released. It would

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-23 Thread Christian König
Am 23.11.20 um 21:05 schrieb Andrey Grodzovsky: On 11/25/20 5:42 AM, Christian König wrote: Am 21.11.20 um 06:21 schrieb Andrey Grodzovsky: It's needed to drop iommu backed pages on device unplug before device's IOMMU group is released. It would be cleaner if we could do the whole handling i

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-23 Thread Andrey Grodzovsky
On 11/25/20 5:42 AM, Christian König wrote: Am 21.11.20 um 06:21 schrieb Andrey Grodzovsky: It's needed to drop iommu backed pages on device unplug before device's IOMMU group is released. It would be cleaner if we could do the whole handling in TTM. I also need to double check what you are

Re: [PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-22 Thread Christian König
Am 21.11.20 um 06:21 schrieb Andrey Grodzovsky: It's needed to drop iommu backed pages on device unplug before device's IOMMU group is released. It would be cleaner if we could do the whole handling in TTM. I also need to double check what you are doing with this function. Christian. Sign

[PATCH v3 05/12] drm/ttm: Expose ttm_tt_unpopulate for driver use

2020-11-20 Thread Andrey Grodzovsky
It's needed to drop iommu backed pages on device unplug before device's IOMMU group is released. Signed-off-by: Andrey Grodzovsky --- drivers/gpu/drm/ttm/ttm_tt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 1ccf1ef..29248a