Re: [PATCH RFC 2/4] drm/i915: IOMMU based SVM implementation v13

David Woodhouse
2016-08-15T12:13:29Z

[-- Attachment #1.1: Type: text/plain, Size: 1102 bytes --]

On Mon, 2016-08-15 at 13:05 +0100, Chris Wilson wrote:
> On Mon, Aug 15, 2016 at 02:48:05PM +0300, Mika Kuoppala wrote:
> >
> > + struct task_struct *task;
>
> We don't need the task, we need the mm.
>
> Holding the task is not sufficient.

From the pure DMA point of view, you don't need the MM at all. I handle
all that from the IOMMU side so it's none of your business, darling.

However, if you want to relate a given context to the specific thread
which started it, perhaps to deliver signals or whatever else, then
perhaps you do want the task not the MM.

>
> > --- a/drivers/gpu/drm/i915/i915_gem.c
> > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > @@ -4304,6 +4304,13 @@ i915_gem_init_hw(struct drm_device *dev)
> > }
> > }
> >
> > + if (INTEL_GEN(dev) >= 8) {
> > + if (intel_init_svm(dev))
>
> init_hw ?
>
> This looks more like one off early driver init.

It's a per-device thing. You might support SVM on one device but not
another, depending on how the IOMMU is configured. Note the 'dev'
argument in the call to intel_init_svm().

--
dwmw2

[-- Attachment #1.2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 5760 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]