Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: just disallow reading untouched registers

Not sure what the original intention was here, but returning a random piece of
kernel memory to userspace because we didn't set the value at all is clearly
not a good idea.

This patch disallows reading the register and returns
a proper error code instead.

Signed-off-by: Christian König <christian.koenig@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Acked-by: Tom St Denis <tom.stdenis@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Christian König and committed by
Alex Deucher
c7217b2a bcf32a23

-6
-6
drivers/gpu/drm/amd/amdgpu/vi.c
··· 464 464 } 465 465 466 466 static const struct amdgpu_allowed_register_entry tonga_allowed_read_registers[] = { 467 - {mmGB_MACROTILE_MODE7, true}, 468 467 }; 469 468 470 469 static const struct amdgpu_allowed_register_entry cz_allowed_read_registers[] = { 471 - {mmGB_TILE_MODE7, true}, 472 - {mmGB_TILE_MODE12, true}, 473 - {mmGB_TILE_MODE17, true}, 474 - {mmGB_TILE_MODE23, true}, 475 - {mmGB_MACROTILE_MODE7, true}, 476 470 }; 477 471 478 472 static const struct amdgpu_allowed_register_entry vi_allowed_read_registers[] = {