<html xmlns:v="urn:schemas-microsoft-com:vml" 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=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><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;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
p.xmsonormal, li.xmsonormal, div.xmsonormal
{mso-style-name:x_msonormal;
margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.xmsipheader4d111418, li.xmsipheader4d111418, div.xmsipheader4d111418
{mso-style-name:x_msipheader4d111418;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
p.msipheader4d111418, li.msipheader4d111418, div.msipheader4d111418
{mso-style-name:msipheader4d111418;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
.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><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="msipheader4d111418" style="margin:0in"><span style="font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]</span><o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Hi David,<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">The snippet of code we posted here is truncated.<o:p></o:p></p>
<p class="MsoNormal">Here’s the complete current struct:<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">struct drm_amdgpu_info_vbios {<o:p></o:p></p>
<p class="MsoNormal"> __u8 name[64];<o:p></o:p></p>
<p class="MsoNormal"> __u32 dbdf;<o:p></o:p></p>
<p class="MsoNormal"> __u8 vbios_pn[64];<o:p></o:p></p>
<p class="MsoNormal"> __u32 version;<o:p></o:p></p>
<p class="MsoNormal"> __u8 date[32];<o:p></o:p></p>
<p class="MsoNormal"> __u8 serial[16];<o:p></o:p></p>
<p class="MsoNormal"> __u32 dev_id;<o:p></o:p></p>
<p class="MsoNormal"> __u32 rev_id;<o:p></o:p></p>
<p class="MsoNormal"> __u32 sub_dev_id;<o:p></o:p></p>
<p class="MsoNormal"> __u32 sub_ved_id;<o:p></o:p></p>
<p class="MsoNormal">};<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">We included vbios name already.<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best regards,<o:p></o:p></p>
<p class="MsoNormal">Jiawei<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> Nieto, David M <David.Nieto@amd.com> <br>
<b>Sent:</b> Tuesday, May 11, 2021 10:52 AM<br>
<b>To:</b> Gu, JiaWei (Will) <JiaWei.Gu@amd.com>; Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Cc:</b> Alex Deucher <alexdeucher@gmail.com>; Deng, Emily <Emily.Deng@amd.com>; Kees Cook <keescook@chromium.org>; amd-gfx list <amd-gfx@lists.freedesktop.org><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: Align serial size in drm_amdgpu_info_vbios<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:5.0pt"><span style="font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">I agree that the serial number should be on number form, but I think we are still missing one field, which is the vbios name, which is located after the P/N, ASIC, PCI
and memory type strings (skiping 0xD 0xA<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal" style="background:white"><span style="font-size:12.0pt;color:black">David<o:p></o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> Gu, JiaWei (Will) <<a href="mailto:JiaWei.Gu@amd.com">JiaWei.Gu@amd.com</a>><br>
<b>Sent:</b> Monday, May 10, 2021 7:23 PM<br>
<b>To:</b> Nieto, David M <<a href="mailto:David.Nieto@amd.com">David.Nieto@amd.com</a>>; Christian König <<a href="mailto:ckoenig.leichtzumerken@gmail.com">ckoenig.leichtzumerken@gmail.com</a>><br>
<b>Cc:</b> Alex Deucher <<a href="mailto:alexdeucher@gmail.com">alexdeucher@gmail.com</a>>; Deng, Emily <<a href="mailto:Emily.Deng@amd.com">Emily.Deng@amd.com</a>>; Kees Cook <<a href="mailto:keescook@chromium.org">keescook@chromium.org</a>>; amd-gfx list
<<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>><br>
<b>Subject:</b> RE: [PATCH] drm/amdgpu: Align serial size in drm_amdgpu_info_vbios</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="xmsipheader4d111418" style="margin:0in"><span style="font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]</span><o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">Got it. Let’s keep them both.<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">Another idea about drm_amdgpu_info_vbios is<o:p></o:p></p>
<p class="xmsonormal">Does it make more sense to fill the “serial info” with uint64_t adev->unique_id, instead of the current char[] in adev->serial?<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">Sorry about that I was not aware of adev->unique_id exists when I defined drm_amdgpu_info_vbios.<o:p></o:p></p>
<p class="xmsonormal">I think it’s clearer to use original numeric variable than a string to expose serial.<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">How about that?<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">>> struct drm_amdgpu_info_vbios {<br>
>> __u8 vbios_pn[64];<br>
>> __u32 version;<br>
>> __u8 date[32];<br>
>> - __u8 serial[16];<br>
>> + __u64 serial;<br>
>> __u32 dev_id;<br>
>> __u32 rev_id;<br>
>> __u32 sub_dev_id;<br>
>> --<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">Best regards,<o:p></o:p></p>
<p class="xmsonormal">Jiawei<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="xmsonormal"><b>From:</b> Nieto, David M <<a href="mailto:David.Nieto@amd.com">David.Nieto@amd.com</a>>
<br>
<b>Sent:</b> Tuesday, May 11, 2021 4:20 AM<br>
<b>To:</b> Christian König <<a href="mailto:ckoenig.leichtzumerken@gmail.com">ckoenig.leichtzumerken@gmail.com</a>>; Gu, JiaWei (Will) <<a href="mailto:JiaWei.Gu@amd.com">JiaWei.Gu@amd.com</a>><br>
<b>Cc:</b> Alex Deucher <<a href="mailto:alexdeucher@gmail.com">alexdeucher@gmail.com</a>>; Deng, Emily <<a href="mailto:Emily.Deng@amd.com">Emily.Deng@amd.com</a>>; Kees Cook <<a href="mailto:keescook@chromium.org">keescook@chromium.org</a>>; amd-gfx list
<<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: Align serial size in drm_amdgpu_info_vbios<o:p></o:p></p>
</div>
</div>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">One of the primary usecases is to add this information to the renderer string, I am not sure if there are other cases of UMD drivers accessing sysfs nodes, but I think if we think permissions, if a client is authenticated and opens the
render device then it can use the IOCTL, it is unclear to me we can make a such an assumption for sysfs nodes…<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">I think there is value in having both tbh.<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<p class="xmsonormal">Regards,<o:p></o:p></p>
<p class="xmsonormal">David<o:p></o:p></p>
<p class="xmsonormal"> <o:p></o:p></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="xmsonormal"><b><span style="font-size:12.0pt;color:black">From: </span>
</b><span style="font-size:12.0pt;color:black">Christian König <<a href="mailto:ckoenig.leichtzumerken@gmail.com">ckoenig.leichtzumerken@gmail.com</a>><br>
<b>Date: </b>Monday, May 10, 2021 at 6:48 AM<br>
<b>To: </b>"Nieto, David M" <<a href="mailto:David.Nieto@amd.com">David.Nieto@amd.com</a>>, "Gu, JiaWei (Will)" <<a href="mailto:JiaWei.Gu@amd.com">JiaWei.Gu@amd.com</a>><br>
<b>Cc: </b>Alex Deucher <<a href="mailto:alexdeucher@gmail.com">alexdeucher@gmail.com</a>>, "Deng, Emily" <<a href="mailto:Emily.Deng@amd.com">Emily.Deng@amd.com</a>>, Kees Cook <<a href="mailto:keescook@chromium.org">keescook@chromium.org</a>>, amd-gfx list
<<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>><br>
<b>Subject: </b>Re: [PATCH] drm/amdgpu: Align serial size in drm_amdgpu_info_vbios</span><o:p></o:p></p>
</div>
<div>
<p class="xmsonormal"> <o:p></o:p></p>
</div>
<p class="xmsonormal" style="margin-bottom:12.0pt">Well we could add both as sysfs file(s).<br>
<br>
Question here is rather what is the primary use case of this and if the application has the necessary access permissions to the sysfs files?<br>
<br>
Regards,<br>
Christian.<o:p></o:p></p>
<div>
<p class="xmsonormal">Am 10.05.21 um 15:42 schrieb Nieto, David M:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="xmsonormal" style="background:white"><span style="color:black">Then the application would need to issue the ioctl and then open a sysfs file to get all the information it needs. It makes little sense from a programming perspective to add an incomplete
interface in my opinion </span><o:p></o:p></p>
</div>
</div>
<div>
<p class="xmsonormal"> <o:p></o:p></p>
</div>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="1" width="100%" align="center">
</div>
<div id="x_divRplyFwdMsg">
<p class="xmsonormal"><b><span style="color:black">From:</span></b><span style="color:black"> Gu, JiaWei (Will)
<a href="mailto:JiaWei.Gu@amd.com"><JiaWei.Gu@amd.com></a><br>
<b>Sent:</b> Monday, May 10, 2021 12:13:07 AM<br>
<b>To:</b> Nieto, David M <a href="mailto:David.Nieto@amd.com"><David.Nieto@amd.com></a><br>
<b>Cc:</b> Alex Deucher <a href="mailto:alexdeucher@gmail.com"><alexdeucher@gmail.com></a>; amd-gfx list
<a href="mailto:amd-gfx@lists.freedesktop.org"><amd-gfx@lists.freedesktop.org></a>; Kees Cook
<a href="mailto:keescook@chromium.org"><keescook@chromium.org></a>; Deng, Emily <a href="mailto:Emily.Deng@amd.com">
<Emily.Deng@amd.com></a><br>
<b>Subject:</b> RE: [PATCH] drm/amdgpu: Align serial size in drm_amdgpu_info_vbios</span>
<o:p></o:p></p>
<div>
<p class="xmsonormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="xmsonormal">[AMD Official Use Only - Internal Distribution Only]<br>
<br>
Hi David,<br>
<br>
What I meant is to ONLY delete the serial[16] from drm_amdgpu_info_vbios, not the whole struct.<br>
<br>
struct drm_amdgpu_info_vbios {<br>
__u8 name[64];<br>
__u32 dbdf;<br>
__u8 vbios_pn[64];<br>
__u32 version;<br>
__u8 date[32];<br>
__u8 serial[16]; // jiawei: shall we delete this<br>
__u32 dev_id;<br>
__u32 rev_id;<br>
__u32 sub_dev_id;<br>
__u32 sub_ved_id;<br>
};<br>
<br>
serial[16] in drm_amdgpu_info_vbios copied from adev->serial, but there's already a sysfs named serial_number, which exposes it already.<br>
<br>
static ssize_t amdgpu_device_get_serial_number(struct device *dev,<br>
struct device_attribute *attr, char *buf)<br>
{<br>
struct drm_device *ddev = dev_get_drvdata(dev);<br>
struct amdgpu_device *adev = ddev->dev_private;<br>
<br>
return snprintf(buf, PAGE_SIZE, "%s\n", adev->serial);<br>
}<br>
<br>
Thanks,<br>
Jiawei<br>
<br>
<br>
-----Original Message-----<br>
From: Nieto, David M <a href="mailto:David.Nieto@amd.com"><David.Nieto@amd.com></a>
<br>
Sent: Monday, May 10, 2021 2:53 PM<br>
To: Gu, JiaWei (Will) <a href="mailto:JiaWei.Gu@amd.com"><JiaWei.Gu@amd.com></a><br>
Cc: Alex Deucher <a href="mailto:alexdeucher@gmail.com"><alexdeucher@gmail.com></a>; amd-gfx list
<a href="mailto:amd-gfx@lists.freedesktop.org"><amd-gfx@lists.freedesktop.org></a>; Kees Cook
<a href="mailto:keescook@chromium.org"><keescook@chromium.org></a>; Deng, Emily <a href="mailto:Emily.Deng@amd.com">
<Emily.Deng@amd.com></a><br>
Subject: Re: [PATCH] drm/amdgpu: Align serial size in drm_amdgpu_info_vbios<br>
<br>
No, this structure contains all the details of the vbios: date, serial number, name, etc.<br>
<br>
The sysfs node only contains the vbios name string<br>
<br>
> On May 9, 2021, at 23:33, Gu, JiaWei (Will) <a href="mailto:JiaWei.Gu@amd.com">
<JiaWei.Gu@amd.com></a> wrote:<br>
> <br>
> [AMD Official Use Only - Internal Distribution Only]<br>
> <br>
> With a second thought,<br>
> __u8 serial[16] in drm_amdgpu_info_vbios is a bit redundant, sysfs serial_number already exposes it.<br>
> <br>
> Is it fine to abandon it from drm_amdgpu_info_vbios struct? @Alex <br>
> Deucher @Nieto, David M<br>
> <br>
> Best regards,<br>
> Jiawei<br>
> <br>
> -----Original Message-----<br>
> From: Alex Deucher <a href="mailto:alexdeucher@gmail.com"><alexdeucher@gmail.com></a><br>
> Sent: Sunday, May 9, 2021 11:59 PM<br>
> To: Gu, JiaWei (Will) <a href="mailto:JiaWei.Gu@amd.com"><JiaWei.Gu@amd.com></a><br>
> Cc: amd-gfx list <a href="mailto:amd-gfx@lists.freedesktop.org"><amd-gfx@lists.freedesktop.org></a>; Kees Cook
<br>
> <a href="mailto:keescook@chromium.org"><keescook@chromium.org></a><br>
> Subject: Re: [PATCH] drm/amdgpu: Align serial size in <br>
> drm_amdgpu_info_vbios<br>
> <br>
>> On Sat, May 8, 2021 at 2:48 AM Jiawei Gu <a href="mailto:Jiawei.Gu@amd.com"><Jiawei.Gu@amd.com></a> wrote:<br>
>> <br>
>> 20 should be serial char size now instead of 16.<br>
>> <br>
>> Signed-off-by: Jiawei Gu <a href="mailto:Jiawei.Gu@amd.com"><Jiawei.Gu@amd.com></a><br>
> <br>
> Please make sure this keeps proper 64 bit alignment in the structure.<br>
> <br>
> Alex<br>
> <br>
> <br>
>> ---<br>
>> include/uapi/drm/amdgpu_drm.h | 2 +-<br>
>> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
>> <br>
>> diff --git a/include/uapi/drm/amdgpu_drm.h <br>
>> b/include/uapi/drm/amdgpu_drm.h index 2b487a8d2727..1c20721f90da<br>
>> 100644<br>
>> --- a/include/uapi/drm/amdgpu_drm.h<br>
>> +++ b/include/uapi/drm/amdgpu_drm.h<br>
>> @@ -957,7 +957,7 @@ struct drm_amdgpu_info_vbios {<br>
>> __u8 vbios_pn[64];<br>
>> __u32 version;<br>
>> __u8 date[32];<br>
>> - __u8 serial[16];<br>
>> + __u8 serial[20];<br>
>> __u32 dev_id;<br>
>> __u32 rev_id;<br>
>> __u32 sub_dev_id;<br>
>> --<br>
>> 2.17.1<br>
>> <br>
>> _______________________________________________<br>
>> amd-gfx mailing list<br>
>> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
>> <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flis">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flis</a><br>
>> t <br>
>> s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CJ<br>
>> i<br>
>> awei.Gu%40amd.com%7Ccea31833184c41e8574508d9130360cc%7C3dd8961fe4884e<br>
>> 6 <br>
>> 08e11a82d994e183d%7C0%7C0%7C637561727523880356%7CUnknown%7CTWFpbGZsb3<br>
>> d <br>
>> 8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7<br>
>> C <br>
>> 1000&sdata=kAJiC6WoJUTeExwk6ftrLfMoY2OTAwg9X7mGgJT3kLk%3D&res<br>
>> e<br>
>> rved=0<o:p></o:p></p>
</div>
</div>
<p class="xmsonormal" style="margin-bottom:12.0pt"> <o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>amd-gfx mailing list<o:p></o:p></pre>
<pre><a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><o:p></o:p></pre>
<pre><a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CDavid.Nieto%40amd.com%7C3c0071a8a2a74127027408d913ba53e4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637562513264718308%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=g11aunC78b48N19Q%2FFXJBK%2B2Z0PZBWdqp%2FzhsPiqQ8Q%3D&reserved=0">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><o:p></o:p></pre>
</blockquote>
<p class="xmsonormal" style="margin-bottom:12.0pt"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
</body>
</html>