amd-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: "Li, Xin (Justin)" <Xin2.Li@amd.com>
To: "amd-gfx@lists.freedesktop.org" <amd-gfx@lists.freedesktop.org>,
	"Zhou, Tiecheng" <Tiecheng.Zhou@amd.com>,
	"Li, Xin (Justin)" <Xin2.Li@amd.com>
Subject: Re: [PATCH] drm/amd/amdgpu: Add checksun check for pf2vf message
Date: Thu, 29 Oct 2020 05:52:00 +0000	[thread overview]
Message-ID: <BYAPR12MB4759FE9E3517EFDAC3FD2669BB140@BYAPR12MB4759.namprd12.prod.outlook.com> (raw)
In-Reply-To: <BYAPR12MB4759F149D775C3389A59001EBB160@BYAPR12MB4759.namprd12.prod.outlook.com>


[-- 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

  reply	other threads:[~2020-10-29  5:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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) [this message]
2020-11-03  5:54 Li, Xin (Justin)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BYAPR12MB4759FE9E3517EFDAC3FD2669BB140@BYAPR12MB4759.namprd12.prod.outlook.com \
    --to=xin2.li@amd.com \
    --cc=Tiecheng.Zhou@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).