[PATCH i-g-t 09/12] lib/igt_dummyload: change addr calc for reloc
Kamil Konieczny
kamil.konieczny at linux.intel.com
Wed Sep 21 18:11:41 UTC 2022
Change calculations for reloc randomization, now it will be
located in 1/2...3/4 address range.
Signed-off-by: Kamil Konieczny <kamil.konieczny at linux.intel.com>
---
lib/igt_dummyload.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 17ae21f5..25550dfa 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -130,15 +130,18 @@ emit_recursive_batch(igt_spin_t *spin,
* that wrap.
*/
- addr = gem_aperture_size(fd) / 2;
+ addr = gem_aperture_size(fd);
if (addr >> 32)
objflags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;
if (!ahnd) {
- addr /= 2;
+ uint64_t size;
if (addr >> 31)
addr = 1u << 31;
- addr += random() % addr / 2;
+
+ size = addr / 2;
+ addr /= 4;
+ addr += random() % size;
addr &= -4096;
} else {
objflags |= EXEC_OBJECT_PINNED;
--
2.34.1
More information about the Intel-gfx-trybot
mailing list