Age | Commit message (Collapse) | Author |
|
Several tests were passing a presumed_offset that matches the actual
offset of the object and so were very suprised when the kernel promptly
skipped performing the relocation (as expected).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
It's hard to overflow a 64-bit value from a 32-bit uabi...
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
gem_reloc_overflow.c: In function ‘__real_main365’:
gem_reloc_overflow.c:384:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
igt_require_f(mlock(reloc, reloc_size) == 0,
^
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Boom when running with --list on non-intel machines or as non-root.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
|
|
The execbuffer2 ABI is not strictly limited to a total of UINT32_MAX
entries, rather each object can have a maximum of UINT32_MAX relocation
entries and the current implementation imposes that the total must be
allocable in a contiguous buffer when necessary (i.e as large as the
kernel can conceivably allocate). This is not an ABI constraint per-se,
just an implementation issue.
Whilst updating the limits for 64bit kernels, review usable of
ioctl-wrappers (i.e. use __gem_execbuf now available) and include a
batch of more tests to explore the boundary conditions of the maximum
relocation size. Note that rather than guess the reloc-max, it would be
better if we queried it. Also it is of vital importance that when
constructing a test to fail in a particular fashion, it must not include
any other error (e.g. we were passing in relocation arrays with invalid
target handle and domains when looking for a potential overflow across
multiple objects).
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Rename the current gem_mmap__{cpu,gtt,wc}() functions into
__gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name
that assert that the pointer is valid. Most callers will expect a valid
pointer and shouldn't have to bother with failures.
To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g'
over the entire codebase.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Get rid of the gem_mmap() alias of gem_mmap__gtt(). I don't see any
point in having it.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
|
|
Apply the new API to all call sites within the test suite using the following
semantic patch:
// Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls
@@
identifier i =~ "\bdrm_open_any\b";
@@
- i()
+ drm_open_driver(DRIVER_INTEL)
@@
identifier i =~ "\bdrm_open_any_master\b";
@@
- i()
+ drm_open_driver_master(DRIVER_INTEL)
@@
identifier i =~ "\bdrm_open_any_render\b";
@@
- i()
+ drm_open_driver_render(DRIVER_INTEL)
@@
identifier i =~ "\b__drm_open_any\b";
@@
- i()
+ __drm_open_driver(DRIVER_INTEL)
Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Add a header that includes all the headers for the library. This allows
reorganisation of the library without affecting programs using it and
also simplifies the headers that need to be included to use the library.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
Add more test descriptions based on exiting comments.
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
|
|
With the header cleanup we can now give this header a suitable name,
since it now really only contains register access and other I/O
functions and assorted definitions.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Brought a few missing headers to light in ioctl_wrappers.h, too.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Subtest names must be stable across all platforms for easier tracking.
Hence move the gen8+ check into the subtests, using igt_require. This
will auto-skip the tests on platforms where a given test doesn't apply.
Also move the assignment of the relocation_type var outside of the
fixture block. Fixtures aren't run when enumerating subtests (so that
subtests can be enumerated on any platform, even without an intel gpu).
So gcc has indeed been right with it's "potentially uninitialized" var
warning after all ...
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
- use void* for generic pointer.
- Fix const usage.
- Shut up gcc about uninitizialized var.
- Be paranoid about the moved tests and make double-sure that the
batch would indeed work safe for the condition being tested.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Broadwell introduces 64-bit relocation addresses which add extra
corner cases. The test was refactored slightly with some tests that
were in the source offset tests were moved to the more generic reloc
test area. The source offset tests are now gen aware and called twice to
test both cpu & gtt relocation paths. In addition 2 new gen8+ test
were added to the test:
* Relocation straddling page a page
* Insufficient space for a relocation at the end of the buffer.
Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com>
Conflicts:
tests/gem_reloc_overflow.c
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
In the past new testcases with subtest often forgot to add the call to
igt_exit at the end of their main() function. That is now caught with
a bit more obnoxious asserts, but it's still a nuissance.
This little igt_main macro takes care of that (and also of calling the
subtest machinery initialization code correctly).
If no one objects I'll roll this out for all the simple cases (i.e.
those tests that don't have additional argv parsing on top of the
subtest machinery).
v2: Roll it out across the board.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Luckily everything seems to be fine.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
I'll be adding more stuff soon ;-)
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
For reloc offsets and batch start/len. Doesn't quite fit into the test
subject at hand here, but meh.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
More will come!
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
We need it for mmapping to get at PROT_READ|WRITE anyway.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
Just a wholesale rollout for now, we can refine later on.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
|
This adds a test to make sure that the execbuffer validation routine is
checking for invalid addresses, single entry overflow, and multi-entry
wrapping overflow.
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|