radv: Canonicalize addresses in radv_find_shader

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28759>
This commit is contained in:
Konstantin Seurer 2024-04-15 12:44:13 +02:00 committed by Marge Bot
parent 48b79a18c5
commit 23c167f826
1 changed files with 1 additions and 0 deletions

View File

@ -2840,6 +2840,7 @@ radv_find_shader(struct radv_device *device, uint64_t pc)
#pragma GCC diagnostic pop
#endif
uint64_t start = radv_buffer_get_va(block->arena->bo) + block->offset;
start &= ((1ull << 48) - 1);
if (!block->freelist.prev && pc >= start && pc < start + block->size) {
mtx_unlock(&device->shader_arena_mutex);
return (struct radv_shader *)block->freelist.next;