tests/kms_fence_pin_leak: Exercise full ppgtt fence pin_count leak in the kernel
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 12 May 2014 11:18:42 +0000 (14:18 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 14 May 2014 16:16:49 +0000 (19:16 +0300)
commit78f79e4e95b571b0ee6f407aaea6dc7c0f864985
treeb40191c7758245ba4196a61da1c76654e82d9283
parent831eb2119793e55d9c0e1be363a2f480f3183ff6
tests/kms_fence_pin_leak: Exercise full ppgtt fence pin_count leak in the kernel

The kernel full ppgtt support has a bug where it can drop a pinned
fence to the floor, hence we leak the pin_count as the subsequent
fence unpin becomes a nop. We can trigger it easily by unbinding a
buffer from a ppgtt address space while the buffer is simultaneosly
being used for scanout.

Make the kernel leak the fence pin_count and trick it into picking
a new fence register for the next scanout buffer. Looping like
this for a while we leak the pin_count for all fence registers after
which the kernel can no longer find a new fence register when it needs
one. As a result we get back a SIGBUS from the GTT mmap access.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
tests/Makefile.sources
tests/kms_fence_pin_leak.c [new file with mode: 0644]