mesa-drm/amdgpu
Samuel Pitoiset 8cc2d09c29 amdgpu: reserve half of the addr space to implement a workaround for PRT
On GFX6-GFX12, except GFX9, SMEM loads on NULL PRT pages would just
fault and hang the GPU. The better workaround that we found is to split
the address space in two equal parts "LOW"/"HIGH", here's more details:

To workaround that, the driver splits the total VA space in half, so
that a single bit controls whether it's the "HIGH" or the "LOW"
address space. Every sparse residency buffer allocations that might
be used with SMEM get two allocations:

- the "HIGH" address space is mapped normally and its VA is returned
  to the application.
- the "LOW" address space is explicitly mapped to a zero-initialized
  buffer when it's allocated or when it's unmapped.

Other buffer allocations are always allocated in the "LOW" address.

The driver also creates a zero-allocated BO that will be used to map
partially resident buffers at creation and when explicitly unmapped.
The size is arbitrary but it seems that allocating 8MiB is perfectly
reasonable and fast enough in most cases. This BO is marked as
read-only for the GPU because the backend compilers don't use SMEM
stores.

For example this makes the "LOW" half of the HIGH VA range like
[0xffff800100000000,0xffffbfffffbfe000], and the "HIGH" half is left
for PRT.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
2026-04-27 09:59:32 +02:00
..
.editorconfig Add meson build system 2018-01-12 09:40:48 -08:00
amdgpu-symbols.txt amdgpu: reserve half of the addr space to implement a workaround for PRT 2026-04-27 09:59:32 +02:00
amdgpu.h amdgpu: reserve half of the addr space to implement a workaround for PRT 2026-04-27 09:59:32 +02:00
amdgpu_asic_id.c amdgpu: NetBSD lacks secure_getenv 2025-12-11 15:41:39 +01:00
amdgpu_bo.c amdgpu: Add parameter validation to amdgpu_bo functions to fix SIGSEGV 2025-10-22 08:59:55 +08:00
amdgpu_cs.c amdgpu: Make amdgpu_cs_signal_semaphore() thread-safe 2024-05-23 18:57:18 +00:00
amdgpu_device.c amdgpu: reserve half of the addr space to implement a workaround for PRT 2026-04-27 09:59:32 +02:00
amdgpu_gpu_info.c drm/amdgpu: add new AMDGPU_INFO subquery for userqueue metadata 2025-04-10 13:20:00 +00:00
amdgpu_internal.h amdgpu: reserve half of the addr space to implement a workaround for PRT 2026-04-27 09:59:32 +02:00
amdgpu_userq.c amdgpu: Add queue priority and secure flags support for user queues 2025-04-14 15:37:51 +08:00
amdgpu_vamgr.c amdgpu: reserve half of the addr space to implement a workaround for PRT 2026-04-27 09:59:32 +02:00
amdgpu_vm.c amdgpu: annotate public functions 2018-09-19 22:46:45 -07:00
Android.bp Convert to Android.bp 2024-07-29 14:47:30 -04:00
Android.sources.bp Convert to Android.bp 2024-07-29 14:47:30 -04:00
handle_table.c amdgpu: fix off by one in handle_table_insert 2018-08-16 08:50:04 +02:00
handle_table.h amdgpu: add handle table implementation v2 2018-08-07 13:27:16 +02:00
libdrm_amdgpu.pc.in amdgpu: add libdrm as private requirement/dependency 2016-02-04 13:22:50 +00:00
meson.build meson: Do not check for meson version >=0.54 2025-05-20 11:05:27 +02:00