Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-12-08 Thread Jason Gunthorpe
On Wed, Dec 04, 2019 at 04:51:36PM -0500, Jerome Glisse wrote: > On Tue, Dec 03, 2019 at 11:19:43AM -0800, Niranjan Vishwanathapura wrote: > > On Tue, Nov 26, 2019 at 06:32:52PM +, Jason Gunthorpe wrote: > > > On Mon, Nov 25, 2019 at 11:33:27AM -0500, Jerome Glisse wrote: > > > > On Fri, Nov 22

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-12-04 Thread Jerome Glisse
On Tue, Dec 03, 2019 at 11:19:43AM -0800, Niranjan Vishwanathapura wrote: > On Tue, Nov 26, 2019 at 06:32:52PM +, Jason Gunthorpe wrote: > > On Mon, Nov 25, 2019 at 11:33:27AM -0500, Jerome Glisse wrote: > > > On Fri, Nov 22, 2019 at 11:33:12PM +, Jason Gunthorpe wrote: > > > > On Fri, Nov

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-12-03 Thread Niranjan Vishwanathapura
On Tue, Nov 26, 2019 at 06:32:52PM +, Jason Gunthorpe wrote: On Mon, Nov 25, 2019 at 11:33:27AM -0500, Jerome Glisse wrote: On Fri, Nov 22, 2019 at 11:33:12PM +, Jason Gunthorpe wrote: > On Fri, Nov 22, 2019 at 12:57:27PM -0800, Niranjana Vishwanathapura wrote: [...] > > +static int >

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-12-03 Thread Niranjan Vishwanathapura
On Tue, Nov 26, 2019 at 06:45:14PM +, Jason Gunthorpe wrote: On Mon, Nov 25, 2019 at 08:32:58AM -0800, Niranjan Vishwanathapura wrote: > And putting the cpu PFN of a ZONE_DEVICE device page into > sg_dma_address still looks very wrong to me The below call in patch 7 does convert any cpu PFN

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-26 Thread Jason Gunthorpe
On Mon, Nov 25, 2019 at 08:32:58AM -0800, Niranjan Vishwanathapura wrote: > > And putting the cpu PFN of a ZONE_DEVICE device page into > > sg_dma_address still looks very wrong to me > > The below call in patch 7 does convert any cpu PFN to device address. > So, it won't be CPU PFN. > i915_dmem_c

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-26 Thread Jason Gunthorpe
On Mon, Nov 25, 2019 at 11:33:27AM -0500, Jerome Glisse wrote: > On Fri, Nov 22, 2019 at 11:33:12PM +, Jason Gunthorpe wrote: > > On Fri, Nov 22, 2019 at 12:57:27PM -0800, Niranjana Vishwanathapura wrote: > > [...] > > > > +static int > > > +i915_range_fault(struct i915_svm *svm, struct hmm_r

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-25 Thread Niranjan Vishwanathapura
On Mon, Nov 25, 2019 at 11:33:27AM -0500, Jerome Glisse wrote: On Fri, Nov 22, 2019 at 11:33:12PM +, Jason Gunthorpe wrote: On Fri, Nov 22, 2019 at 12:57:27PM -0800, Niranjana Vishwanathapura wrote: [...] > +static int > +i915_range_fault(struct i915_svm *svm, struct hmm_range *range) >

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-25 Thread Niranjan Vishwanathapura
On Mon, Nov 25, 2019 at 01:24:18PM +, Jason Gunthorpe wrote: On Sun, Nov 24, 2019 at 01:12:47PM -0800, Niranjan Vishwanathapura wrote: > > > Using a temporary range is the pattern from nouveau, is it really > > > necessary in this driver? > > > > Yah, not required. In my local build I tried

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-25 Thread Jerome Glisse
On Mon, Nov 25, 2019 at 01:24:18PM +, Jason Gunthorpe wrote: > On Sun, Nov 24, 2019 at 01:12:47PM -0800, Niranjan Vishwanathapura wrote: > > > > > > Using a temporary range is the pattern from nouveau, is it really > > > > > necessary in this driver? > > > > > > > > Yah, not required. In my l

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-25 Thread Jerome Glisse
On Fri, Nov 22, 2019 at 11:33:12PM +, Jason Gunthorpe wrote: > On Fri, Nov 22, 2019 at 12:57:27PM -0800, Niranjana Vishwanathapura wrote: [...] > > +static int > > +i915_range_fault(struct i915_svm *svm, struct hmm_range *range) > > +{ > > + long ret; > > + > > + range->default_flags = 0;

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-25 Thread Jason Gunthorpe
On Sun, Nov 24, 2019 at 01:12:47PM -0800, Niranjan Vishwanathapura wrote: > > > > Using a temporary range is the pattern from nouveau, is it really > > > > necessary in this driver? > > > > > > Yah, not required. In my local build I tried with proper default_flags > > > and set pfn_flags_mask to

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-24 Thread Niranjan Vishwanathapura
On Sat, Nov 23, 2019 at 11:53:52PM +, Jason Gunthorpe wrote: On Fri, Nov 22, 2019 at 08:44:18PM -0800, Niranjan Vishwanathapura wrote: On Fri, Nov 22, 2019 at 11:33:12PM +, Jason Gunthorpe wrote: > On Fri, Nov 22, 2019 at 12:57:27PM -0800, Niranjana Vishwanathapura wrote: > > > +static i

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-23 Thread Jason Gunthorpe
On Fri, Nov 22, 2019 at 08:44:18PM -0800, Niranjan Vishwanathapura wrote: > On Fri, Nov 22, 2019 at 11:33:12PM +, Jason Gunthorpe wrote: > > On Fri, Nov 22, 2019 at 12:57:27PM -0800, Niranjana Vishwanathapura wrote: > > > > > +static inline bool > > > +i915_range_done(struct hmm_range *range)

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-22 Thread Niranjan Vishwanathapura
On Fri, Nov 22, 2019 at 11:33:12PM +, Jason Gunthorpe wrote: On Fri, Nov 22, 2019 at 12:57:27PM -0800, Niranjana Vishwanathapura wrote: +static inline bool +i915_range_done(struct hmm_range *range) +{ + bool ret = hmm_range_valid(range); + + hmm_range_unregister(range); +

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-22 Thread Jason Gunthorpe
On Fri, Nov 22, 2019 at 12:57:27PM -0800, Niranjana Vishwanathapura wrote: > +static inline bool > +i915_range_done(struct hmm_range *range) > +{ > + bool ret = hmm_range_valid(range); > + > + hmm_range_unregister(range); > + return ret; > +} This needs to be updated to follow the new

[Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-22 Thread Niranjana Vishwanathapura
Use HMM page table mirroring support to build device page table. Implement the bind ioctl and bind the process address range in the specified context's ppgtt. Handle invalidation notifications by unbinding the address range. Cc: Joonas Lahtinen Cc: Jon Bloomfield Cc: Daniel Vetter Cc: Sudeep Du

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-22 Thread Niranjan Vishwanathapura
On Fri, Nov 22, 2019 at 08:14:51PM +, Jason Gunthorpe wrote: On Fri, Nov 22, 2019 at 12:01:17PM -0800, Niranjan Vishwanathapura wrote: On Fri, Nov 22, 2019 at 11:54:45AM -0800, Niranjana Vishwanathapura wrote: > Use HMM page table mirroring support to build device page table. > Implement the

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-22 Thread Jason Gunthorpe
On Fri, Nov 22, 2019 at 12:01:17PM -0800, Niranjan Vishwanathapura wrote: > On Fri, Nov 22, 2019 at 11:54:45AM -0800, Niranjana Vishwanathapura wrote: > > Use HMM page table mirroring support to build device page table. > > Implement the bind ioctl and bind the process address range in the > > spec

Re: [Intel-gfx] [RFC 06/13] drm/i915/svm: Page table mirroring support

2019-11-22 Thread Niranjan Vishwanathapura
On Fri, Nov 22, 2019 at 11:54:45AM -0800, Niranjana Vishwanathapura wrote: Use HMM page table mirroring support to build device page table. Implement the bind ioctl and bind the process address range in the specified context's ppgtt. Handle invalidation notifications by unbinding the address rang