]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: restrict debugfs register access under SR-IOV
authorYintian Tao <yttao@amd.com>
Tue, 7 Apr 2020 10:08:39 +0000 (18:08 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 13 Apr 2020 16:01:04 +0000 (12:01 -0400)
commitf7e7a3122fe9909ef3308268289fb39cb800c938
tree5d624151bd3b42bea2996505804d25fe6123ff1b
parent6039392c804fcda0c12819799e52dac780c52f88
drm/amdgpu: restrict debugfs register access under SR-IOV

Under bare metal, there is no more else to take
care of the GPU register access through MMIO.
Under Virtualization, to access GPU register is
implemented through KIQ during run-time due to
world-switch.

Therefore, under SR-IOV user can only access
debugfs to r/w GPU registers when meets all
three conditions below.
- amdgpu_gpu_recovery=0
- TDR happened
- in_gpu_reset=0

v2: merge amdgpu_virt_can_access_debugfs() into
    amdgpu_virt_enable_access_debugfs()

v3: drop ret variable in amdgpu_virt_enable_access_debugfs()
    and directly return result

Signed-off-by: Yintian Tao <yttao@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h