[PATCH v2] i915/selftest/igt_mmap: let mmap tests run in kthread

Chris Wilson chris.p.wilson at linux.intel.com
Fri Mar 7 11:31:25 UTC 2025


Quoting Mikolaj Wasiak (2025-03-07 08:44:29)
> Hi Krzysztof,
> 
> On 2025-03-05 at 17:31:49 +0100, Krzysztof Niemiec wrote:
> > Don't we run into the same issue as in V1, meaning we use an unknown
> > current->active_mm (since we run in a kthread, and cannot control it) to
> > use as the current->mm? Maybe a better approach would be to create a new
> > mm for the duration of the test, similarly to how the patch Janusz
> > mentioned does it? (51104c19d857)
> 
> As per discussion with Chris, using active_mm is the correct way of
> enabling current->mm in kthread. On the other hand it may also expose
> issues with underlying tests because they didn't previously run on such
> hardware. I think potential fixes to those tests should be addressed in
> separate patch.

We've looked at the tests, and they should all be finding unused space
in the mm and cleaning up after themselves...

If we put on our paranoia hats, the biggest problem with borrowing
userspace's mm is that it gives them temporary insight into whatever
we place into that mm. We don't expose any data, unless by error...
Not sure how much effort we want to put on making the selftests paranoia
proof, but that (and the surety of cleaning up afterwards) would be a
good argument for creating a temporary mm for our use.
-Chris


More information about the Intel-gfx mailing list