drm/amd/amdgpu:save psp ring wptr to avoid attack
authorVictor Zhao <Victor.Zhao@amd.com>
Thu, 18 Mar 2021 05:44:35 +0000 (13:44 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 May 2021 16:33:52 +0000 (12:33 -0400)
commitf1688bd69ec4b07eda1657ff953daebce7cfabf6
tree6dd133a531185048f3884a4f799dad54244016ce
parentdd1d82c04e111b5a864638ede8965db2fe6d8653
drm/amd/amdgpu:save psp ring wptr to avoid attack

[Why]
When some tools performing psp mailbox attack, the readback value
of register can be a random value which may break psp.

[How]
Use a psp wptr cache machanism to aovid the change made by attack.

v2: unify change and add detailed reason

Signed-off-by: Victor Zhao <Victor.Zhao@amd.com>
Signed-off-by: Jingwen Chen <Jingwen.Chen2@amd.com>
Reviewed-by: Monk Liu <monk.liu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.h
drivers/gpu/drm/amd/amdgpu/psp_v11_0.c
drivers/gpu/drm/amd/amdgpu/psp_v3_1.c