DROP: Re: [PATCH] drm/amd/amdgpu: Add checksun check for pf2vf message

Li, Xin (Justin) Xin2.Li at amd.com
Fri Oct 23 02:18:55 UTC 2020


[AMD Official Use Only - Internal Distribution Only]

Please drop this patch, there’s some typo in the commit message

Best Regards,
Li, Xin (Justin)

From: Li, Xin (Justin) <Xin2.Li at amd.com>
Date: Friday, October 23, 2020 at 10:17
To: amd-gfx at lists.freedesktop.org <amd-gfx at lists.freedesktop.org>
Cc: Li, Xin (Justin) <Xin2.Li at amd.com>, Zhou, Tiecheng <Tiecheng.Zhou at amd.com>, Li, Xin (Justin) <Xin2.Li at amd.com>, Li at justins-mbp.amd.com <Li at justins-mbp.amd.com>, Zhou at justins-mbp.amd.com <Zhou at justins-mbp.amd.com>, Tiecheng <Thecheng.Zhou at amd.com>
Subject: [PATCH] drm/amd/amdgpu: Add checksun check for pf2vf message
Add checksum checking for pf2vf message

Signed-off-by: Li, Xin (Justin) <Xin2.Li at amd.com>
Signed-off-by: Zhou, Tiecheng <Thecheng.Zhou at amd.com>
---
 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)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20201023/13045e84/attachment-0001.htm>


More information about the amd-gfx mailing list