All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Jinoh Kang <jinoh.kang.kr@gmail.com>,
	Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Cc: dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Matthew Auld <matthew.auld@intel.com>,
	Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH] drm/i915/userptr: detect un-GUP-able pages early
Date: Fri, 15 Jan 2021 16:56:42 +0000	[thread overview]
Message-ID: <161072980241.18103.11713889922046524226@build.alporthouse.com> (raw)
In-Reply-To: <c742707e-eb6d-6a22-3006-52dc3bf458d8@gmail.com>

Quoting Jinoh Kang (2021-01-15 16:23:31)
> If GUP-ineligible pages are passed to a GEM userptr object, -EFAULT is
> returned only when the object is actually bound.
> 
> The xf86-video-intel userspace driver cannot differentiate this
> condition, and marks the GPU as wedged.

The idea was to call gem_set_domain on the object to validate the pages
after creation. I only did that for read-only... I did however make mesa
use set-domain for validation.

As a question how are you getting to call userptr on something that
wasn't passed by SHM ipc?

> This not only disables graphics
> acceleration but may also cripple other functions such as VT switch.

That should be a non-sequitur; certainly VT switch works without ever
using the GPU.

> Solve this by "prefaulting" user pages on GEM object creation, testing
> whether all pages are eligible for get_user_pages() in the process.
> On failure, return -EFAULT so that userspace can fallback to software
> blitting.

See https://patchwork.freedesktop.org/series/33449/ for adding PROBE |
POPULATE flags.

But we can just use set-domain.
-Chris
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

WARNING: multiple messages have this Message-ID (diff)
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Jinoh Kang <jinoh.kang.kr@gmail.com>,
	Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Cc: dri-devel@lists.freedesktop.org, David Airlie <airlied@linux.ie>,
	intel-gfx@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	Matthew Auld <matthew.auld@intel.com>
Subject: Re: [Intel-gfx] [PATCH] drm/i915/userptr: detect un-GUP-able pages early
Date: Fri, 15 Jan 2021 16:56:42 +0000	[thread overview]
Message-ID: <161072980241.18103.11713889922046524226@build.alporthouse.com> (raw)
In-Reply-To: <c742707e-eb6d-6a22-3006-52dc3bf458d8@gmail.com>

Quoting Jinoh Kang (2021-01-15 16:23:31)
> If GUP-ineligible pages are passed to a GEM userptr object, -EFAULT is
> returned only when the object is actually bound.
> 
> The xf86-video-intel userspace driver cannot differentiate this
> condition, and marks the GPU as wedged.

The idea was to call gem_set_domain on the object to validate the pages
after creation. I only did that for read-only... I did however make mesa
use set-domain for validation.

As a question how are you getting to call userptr on something that
wasn't passed by SHM ipc?

> This not only disables graphics
> acceleration but may also cripple other functions such as VT switch.

That should be a non-sequitur; certainly VT switch works without ever
using the GPU.

> Solve this by "prefaulting" user pages on GEM object creation, testing
> whether all pages are eligible for get_user_pages() in the process.
> On failure, return -EFAULT so that userspace can fallback to software
> blitting.

See https://patchwork.freedesktop.org/series/33449/ for adding PROBE |
POPULATE flags.

But we can just use set-domain.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2021-01-15 16:57 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-15 16:23 [PATCH] drm/i915/userptr: detect un-GUP-able pages early Jinoh Kang
2021-01-15 16:23 ` [Intel-gfx] " Jinoh Kang
2021-01-15 16:23 ` Jinoh Kang
2021-01-15 16:56 ` Chris Wilson [this message]
2021-01-15 16:56   ` [Intel-gfx] " Chris Wilson
2021-01-15 17:03   ` Jinoh Kang
2021-01-15 17:03     ` [Intel-gfx] " Jinoh Kang
2021-01-15 17:03     ` Jinoh Kang
2021-01-15 17:07   ` Chris Wilson
2021-01-15 17:07     ` [Intel-gfx] " Chris Wilson
2021-01-16  5:11     ` Jinoh Kang
2021-01-16  5:11       ` [Intel-gfx] " Jinoh Kang
2021-01-16  5:11       ` Jinoh Kang
2021-01-15 20:46 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2021-01-15 21:16 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-01-16  4:11 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2021-01-19 18:58 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/userptr: detect un-GUP-able pages early (rev2) Patchwork
2021-01-19 19:27 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-01-19 22:41 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=161072980241.18103.11713889922046524226@build.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=airlied@linux.ie \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jinoh.kang.kr@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marmarek@invisiblethingslab.com \
    --cc=matthew.auld@intel.com \
    --cc=rodrigo.vivi@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.