<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:DengXian;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"\@DengXian";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72" style="word-wrap:break-word">
<p style="font-family:Arial;font-size:10pt;color:#0078D7;margin:15pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div class="WordSection1">
<p class="MsoNormal">Please drop this patch, there’s some typo in the commit message<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Best Regards,<o:p></o:p></p>
<p class="MsoNormal">Li, Xin (Justin)<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">Li, Xin (Justin) <Xin2.Li@amd.com><br>
<b>Date: </b>Friday, October 23, 2020 at 10:17<br>
<b>To: </b>amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc: </b>Li, Xin (Justin) <Xin2.Li@amd.com>, Zhou, Tiecheng <Tiecheng.Zhou@amd.com>, Li, Xin (Justin) <Xin2.Li@amd.com>, Li@justins-mbp.amd.com <Li@justins-mbp.amd.com>, Zhou@justins-mbp.amd.com <Zhou@justins-mbp.amd.com>, Tiecheng <Thecheng.Zhou@amd.com><br>
<b>Subject: </b>[PATCH] drm/amd/amdgpu: Add checksun check for pf2vf message<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">Add checksum checking for pf2vf message<br>
<br>
Signed-off-by: Li, Xin (Justin) <Xin2.Li@amd.com><br>
Signed-off-by: Zhou, Tiecheng <Thecheng.Zhou@amd.com><br>
---<br>
 drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c | 5 ++---<br>
 1 file changed, 2 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c<br>
index 836d784456e5..bfc74533b5ee 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c<br>
@@ -450,12 +450,11 @@ static int amdgpu_virt_read_pf2vf_data(struct amdgpu_device *adev)<br>
                         ((struct amdgim_pf2vf_info_v1 *)pf2vf_info)->feature_flags;<br>
                 break;<br>
         case 2:<br>
-               /* TODO: missing key, need to add it later */<br>
                 checksum = ((struct amd_sriov_msg_pf2vf_info *)pf2vf_info)->checksum;<br>
                 checkval = amd_sriov_msg_checksum(<br>
                         adev->virt.fw_reserve.p_pf2vf, pf2vf_info->size,<br>
-                       0, checksum);<br>
-               if (checksum != checkval) {<br>
+                       adev->virt.fw_reserve.checksum_key, checksum);<br>
+               if (checksum != 0 && checksum != checkval) {<br>
                         DRM_ERROR("invalid pf2vf message\n");<br>
                         return -EINVAL;<br>
                 }<br>
-- <br>
2.24.3 (Apple Git-128)<o:p></o:p></p>
</div>
</div>
</div>
</body>
</html>