amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amd/amdgpu: Add checksun check for pf2vf message
@ 2020-10-27  6:36 Li, Xin (Justin)
  2020-10-29  5:52 ` Li, Xin (Justin)
  0 siblings, 1 reply; 3+ messages in thread
From: Li, Xin (Justin) @ 2020-10-27  6:36 UTC (permalink / raw)
  To: amd-gfx, Li, Xin (Justin), Zhou, Tiecheng


[-- Attachment #1.1: Type: text/plain, Size: 1476 bytes --]

[AMD Official Use Only - Internal Distribution Only]

Add checksum checking for pf2vf message

Signed-off-by: Li, Xin (Justin) <Xin2.Li@amd.com<mailto:Xin2.Li@amd.com>>
Signed-off-by: Zhou, Tiecheng <Tiecheng.Zhou@amd.com<mailto:Tiecheng.Zhou@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)


[-- Attachment #1.2: Type: text/html, Size: 5126 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amd/amdgpu: Add checksun check for pf2vf message
  2020-10-27  6:36 [PATCH] drm/amd/amdgpu: Add checksun check for pf2vf message Li, Xin (Justin)
@ 2020-10-29  5:52 ` Li, Xin (Justin)
  0 siblings, 0 replies; 3+ messages in thread
From: Li, Xin (Justin) @ 2020-10-29  5:52 UTC (permalink / raw)
  To: amd-gfx, Zhou, Tiecheng, Li, Xin (Justin)


[-- Attachment #1.1: Type: text/plain, Size: 1897 bytes --]

[AMD Official Use Only - Internal Distribution Only]

Any updates on this patch?

Best Regards,
Li, Xin (Justin)

From: Li, Xin (Justin) <Xin2.Li@amd.com>
Date: Tuesday, October 27, 2020 at 14:36
To: amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org>, Li, Xin (Justin) <Xin2.Li@amd.com>, Zhou, Tiecheng <Tiecheng.Zhou@amd.com>
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) <Xin2.Li@amd.com<mailto:Xin2.Li@amd.com>>
Signed-off-by: Zhou, Tiecheng <Tiecheng.Zhou@amd.com<mailto:Tiecheng.Zhou@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)


[-- Attachment #1.2: Type: text/html, Size: 6152 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] drm/amd/amdgpu: Add checksun check for pf2vf message
@ 2020-11-03  5:54 Li, Xin (Justin)
  0 siblings, 0 replies; 3+ messages in thread
From: Li, Xin (Justin) @ 2020-11-03  5:54 UTC (permalink / raw)
  To: amd-gfx
  Cc: Li, Xin (Justin), Zhou, Tiecheng, Wang, Yin, Wang,  Daniel(Xiaowei)


[-- Attachment #1.1: Type: text/plain, Size: 1476 bytes --]

[AMD Official Use Only - Internal Distribution Only]

Add checksum checking for pf2vf message

Signed-off-by: Li, Xin (Justin) <Xin2.Li@amd.com<mailto:Xin2.Li@amd.com>>
Signed-off-by: Zhou, Tiecheng <Thecheng.Zhou@amd.com<mailto:Thecheng.Zhou@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)


[-- Attachment #1.2: Type: text/html, Size: 5157 bytes --]

[-- Attachment #2: Type: text/plain, Size: 154 bytes --]

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-03  5:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27  6:36 [PATCH] drm/amd/amdgpu: Add checksun check for pf2vf message Li, Xin (Justin)
2020-10-29  5:52 ` Li, Xin (Justin)
2020-11-03  5:54 Li, Xin (Justin)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).