[AMD Official Use Only - Internal Distribution Only]

Any updates on this patch?

Best Regards,
Li, Xin (Justin)

From: Li, Xin (Justin) <[email protected]>
Date: Tuesday, October 27, 2020 at 14:36
To: [email protected] <[email protected]>, Li, Xin 
(Justin) <[email protected]>, Zhou, Tiecheng <[email protected]>
Subject: [PATCH] drm/amd/amdgpu: Add checksun check for pf2vf message

[AMD Official Use Only - Internal Distribution Only]

Add checksum checking for pf2vf message

Signed-off-by: Li, Xin (Justin) <[email protected]<mailto:[email protected]>>
Signed-off-by: Zhou, Tiecheng 
<[email protected]<mailto:[email protected]>>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c 
b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
index 836d784456e5..bfc74533b5ee 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
@@ -450,12 +450,11 @@ static int amdgpu_virt_read_pf2vf_data(struct 
amdgpu_device *adev)
                         ((struct amdgim_pf2vf_info_v1 
*)pf2vf_info)->feature_flags;
                 break;
         case 2:
-               /* TODO: missing key, need to add it later */
                 checksum = ((struct amd_sriov_msg_pf2vf_info 
*)pf2vf_info)->checksum;
                 checkval = amd_sriov_msg_checksum(
                         adev->virt.fw_reserve.p_pf2vf, pf2vf_info->size,
-                       0, checksum);
-               if (checksum != checkval) {
+                       adev->virt.fw_reserve.checksum_key, checksum);
+               if (checksum != 0 && checksum != checkval) {
                         DRM_ERROR("invalid pf2vf message\n");
                         return -EINVAL;
                 }
--
2.24.3 (Apple Git-128)

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to