aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_psp_ta.c
Commit message (Collapse)AuthorAgeFilesLines
* drm/amdgpu: Validate TA binary sizeCandice Li2024-08-211-0/+3
| | | | | | | | | | Add TA binary size validation to avoid OOB write. Signed-off-by: Candice Li <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]> (cherry picked from commit c0a04e3570d72aaf090962156ad085e37c62e442) Cc: [email protected]
* drm/amdgpu: add mutex to protect ras shared memoryYiPeng Chai2024-07-161-0/+2
| | | | | | | | | | | | Add mutex to protect ras shared memory. v2: Add TA_RAS_COMMAND__TRIGGER_ERROR command call status check. Signed-off-by: YiPeng Chai <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/admgpu: fix dereferencing null pointer contextJesse Zhang2024-05-231-1/+1
| | | | | | | | | | When user space sets an invalid ta type, the pointer context will be empty. So it need to check the pointer context before using it Signed-off-by: Jesse Zhang <[email protected]> Suggested-by: Tim Huang <[email protected]> Reviewed-by: Tim Huang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Fix shared buff copy to userStanley.Yang2024-02-071-1/+1
| | | | | | | | | | | | | | | ta if invoke node buffer |-------- ta type ----------| |-------- ta id ----------| |-------- cmd id ----------| |------ shared buf len -----| |------ shared buffer ------| ta if invoke node buffer is as above, copy shared buffer data to correct location Signed-off-by: Stanley.Yang <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Optimize TA load/unload/invoke debugfs interfacesCandice Li2022-10-271-63/+154
| | | | | | | | | | | | | 1. Add a function pointer structure ta_funcs to psp context 2. Make the interfaces generic to all TAs 3. Leverage exisitng TA context and remove unused functions 4. Fix return code bugs v2: Add comments for ta funcs macros and correct typo Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Candice Li <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Fix build warning for TA debugfs interfaceCandice Li2022-04-281-26/+14
| | | | | | | | | | Remove the redundant codes to fix build warning when CONFIG_DEBUG_FS is disabled. Reported-by: Randy Dunlap <[email protected]> Signed-off-by: Candice Li <[email protected]> Reviewed-by: Yang Wang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: debugfs: fix NULL dereference in ta_if_invoke_debugfs_write()Dan Carpenter2022-04-261-1/+1
| | | | | | | | If the kzalloc() fails then this code will crash. Return -ENOMEM instead. Fixes: e50d9ba0d2cd ("drm/amdgpu: Add debugfs TA load/unload/invoke support") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: debugfs: fix error codes in write functionsDan Carpenter2022-04-261-6/+14
| | | | | | | | | | | | | There are two error code bugs here. The copy_to/from_user() functions return the number of bytes remaining (a positive number). We should return -EFAULT if the copy fails. Second if we fail because "context.resp_status" is non-zero then return -EINVAL instead of zero. Fixes: e50d9ba0d2cd ("drm/amdgpu: Add debugfs TA load/unload/invoke support") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
* drm/amdgpu: Add debugfs TA load/unload/invoke supportCandice Li2022-04-211-0/+308
v1: Add debugfs support to load/unload/invoke TA in runtime. v2: 1. Update some variables to static. 2. Use PAGE_ALIGN to calculate shared buf size directly. 3. Remove fp check. 4. Update debugfs from read to write. Signed-off-by: John Clements <[email protected]> Signed-off-by: Candice Li <[email protected]> Reviewed-by: Tao Zhou <[email protected]> Reviewed-by: Hawking Zhang <[email protected]> Signed-off-by: Alex Deucher <[email protected]>