[igt-dev] [PATCH i-g-t 2/2] tests/i915-query: add new tests for perf configurations queries

Chris Wilson chris at chris-wilson.co.uk
Wed Jun 6 10:32:47 UTC 2018


Quoting Lionel Landwerlin (2018-06-06 11:19:20)
> On 05/06/18 19:47, Chris Wilson wrote:
> > Quoting Lionel Landwerlin (2018-06-05 17:23:23)
> >> +       len = ALIGN(query.oa.n_mux_regs * sizeof(uint32_t) * 2, 4096);
> >> +       data = mmap(0, len, PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
> >> +       memset(data, 0, len);
> >> +       mprotect(data, len, PROT_READ);
> >> +       query.oa.mux_regs_ptr = to_user_pointer(data);
> >> +       igt_assert_eq(-EFAULT,
> >> +                     query_perf_config_data(fd, sizeof(query), &query.query));
> > Just the random thought, have we stuffed gem_mmap__gtt() addresses
> > through these yet?
> > -Chris
> >
> I don't understand why this would be an issue.

It's a very easy way to be caught out with a lock inversion, as the
kernel faults on the user provided GGTT address and calls into
i915_gem_fault().
-Chris


More information about the igt-dev mailing list