<html>
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
</head>
<body>
Yeah, but umr is making strong use of sysfs as well.<br>
<br>
The only justification of this interface would be if we want to use
it in Mesa.<br>
<br>
And I agree with Marek that looks redundant with the device
structure to me as well.<br>
<br>
Christian.<br>
<br>
<div class="moz-cite-prefix">Am 11.05.21 um 16:04 schrieb Deucher,
Alexander:<br>
</div>
<blockquote type="cite"
cite="mid:MN2PR12MB4488E0D428871797E08DEE2BF7539@MN2PR12MB4488.namprd12.prod.outlook.com">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
<p
style="font-family:Arial;font-size:10pt;color:#317100;margin:15pt;"
align="Left">
[AMD Public Use]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
It's being used by umr and some other smi tools to provide
vbios information for debugging.</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
Alex</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif;
font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font style="font-size:11pt"
face="Calibri, sans-serif" color="#000000"><b>From:</b>
amd-gfx <a class="moz-txt-link-rfc2396E" href="mailto:amd-gfx-bounces@lists.freedesktop.org"><amd-gfx-bounces@lists.freedesktop.org></a> on
behalf of Marek Olšák <a class="moz-txt-link-rfc2396E" href="mailto:maraeo@gmail.com"><maraeo@gmail.com></a><br>
<b>Sent:</b> Tuesday, May 11, 2021 4:18 AM<br>
<b>To:</b> Christian König
<a class="moz-txt-link-rfc2396E" href="mailto:ckoenig.leichtzumerken@gmail.com"><ckoenig.leichtzumerken@gmail.com></a><br>
<b>Cc:</b> Kees Cook <a class="moz-txt-link-rfc2396E" href="mailto:keescook@chromium.org"><keescook@chromium.org></a>; Gu,
JiaWei (Will) <a class="moz-txt-link-rfc2396E" href="mailto:JiaWei.Gu@amd.com"><JiaWei.Gu@amd.com></a>; amd-gfx list
<a class="moz-txt-link-rfc2396E" href="mailto:amd-gfx@lists.freedesktop.org"><amd-gfx@lists.freedesktop.org></a>; Deng, Emily
<a class="moz-txt-link-rfc2396E" href="mailto:Emily.Deng@amd.com"><Emily.Deng@amd.com></a>; Alex Deucher
<a class="moz-txt-link-rfc2396E" href="mailto:alexdeucher@gmail.com"><alexdeucher@gmail.com></a>; Nieto, David M
<a class="moz-txt-link-rfc2396E" href="mailto:David.Nieto@amd.com"><David.Nieto@amd.com></a><br>
<b>Subject:</b> Re: [PATCH] drm/amdgpu: Align serial size in
drm_amdgpu_info_vbios</font>
<div> </div>
</div>
<div>
<div dir="ltr">
<div>Mesa doesn't use sysfs.</div>
<div><br>
</div>
<div>Note that this is a uapi, meaning that once it's in the
kernel, it can't be changed like that.<br>
</div>
<div><br>
</div>
<div>What's the use case for this new interface? Isn't it
partially redundant with the current device info
structure, which seems to have the equivalent of dev_id
and rev_id?<br>
</div>
<div><br>
</div>
<div>Marek<br>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">On Tue, May 11, 2021 at
3:51 AM Christian König <<a
href="mailto:ckoenig.leichtzumerken@gmail.com"
target="_blank" moz-do-not-send="true">ckoenig.leichtzumerken@gmail.com</a>>
wrote:<br>
</div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px
0.8ex; border-left:1px solid rgb(204,204,204);
padding-left:1ex">
<div>Marek and other userspace folks need to decide that.<br>
<br>
Basic question here is if Mesa is already accessing
sysfs nodes for OpenGL or RADV. If that is the case then
we should probably expose the information there as well.<br>
<br>
If that isn't the case (which I think it is) then we
should implement it as IOCTL.<br>
<br>
Regards,<br>
Christian.<br>
<br>
<div>Am 10.05.21 um 22:19 schrieb Nieto, David M:<br>
</div>
<blockquote type="cite">
<div>
<p class="x_MsoNormal">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…</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">I think there is value in
having both tbh.</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Regards,</p>
<p class="x_MsoNormal">David</p>
<p class="x_MsoNormal"> </p>
<div style="border-color:rgb(181,196,223)
currentcolor currentcolor; border-style:solid none
none; border-width:1pt medium medium; padding:3pt
0in 0in">
<p class="x_MsoNormal"><b><span
style="font-size:12pt; color:black">From: </span>
</b><span style="font-size:12pt; color:black">Christian
König <a
href="mailto:ckoenig.leichtzumerken@gmail.com"
target="_blank" moz-do-not-send="true">
<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"
target="_blank" moz-do-not-send="true">
<David.Nieto@amd.com></a>, "Gu, JiaWei
(Will)" <a href="mailto:JiaWei.Gu@amd.com"
target="_blank" moz-do-not-send="true">
<JiaWei.Gu@amd.com></a><br>
<b>Cc: </b>Alex Deucher <a
href="mailto:alexdeucher@gmail.com"
target="_blank" moz-do-not-send="true"><alexdeucher@gmail.com></a>,
"Deng, Emily"
<a href="mailto:Emily.Deng@amd.com"
target="_blank" moz-do-not-send="true"><Emily.Deng@amd.com></a>,
Kees Cook
<a href="mailto:keescook@chromium.org"
target="_blank" moz-do-not-send="true"><keescook@chromium.org></a>,
amd-gfx list
<a href="mailto:amd-gfx@lists.freedesktop.org"
target="_blank" moz-do-not-send="true"><amd-gfx@lists.freedesktop.org></a><br>
<b>Subject: </b>Re: [PATCH] drm/amdgpu: Align
serial size in drm_amdgpu_info_vbios</span></p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<p class="x_MsoNormal" style="margin-bottom:12pt">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.</p>
<div>
<p class="x_MsoNormal">Am 10.05.21 um 15:42
schrieb Nieto, David M:</p>
</div>
<blockquote style="margin-top:5pt;
margin-bottom:5pt">
<div>
<div>
<div>
<p class="x_MsoNormal"
style="background:white none repeat scroll
0% 0%"><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></p>
</div>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
</div>
<div class="x_MsoNormal" style="text-align:center"
align="center">
<hr width="100%" size="0" align="center">
</div>
<div
id="x_gmail-m_782079725653541167gmail-m_3184748164637597930gmail-m_-3452308432024396062divRplyFwdMsg">
<p class="x_MsoNormal"><b><span
style="color:black">From:</span></b><span
style="color:black"> Gu, JiaWei (Will)
<a href="mailto:JiaWei.Gu@amd.com"
target="_blank" moz-do-not-send="true"><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"
target="_blank" moz-do-not-send="true"><David.Nieto@amd.com></a><br>
<b>Cc:</b> Alex Deucher <a
href="mailto:alexdeucher@gmail.com"
target="_blank" moz-do-not-send="true"><alexdeucher@gmail.com></a>;
amd-gfx list
<a
href="mailto:amd-gfx@lists.freedesktop.org"
target="_blank" moz-do-not-send="true"><amd-gfx@lists.freedesktop.org></a>;
Kees Cook
<a href="mailto:keescook@chromium.org"
target="_blank" moz-do-not-send="true"><keescook@chromium.org></a>;
Deng, Emily
<a href="mailto:Emily.Deng@amd.com"
target="_blank" moz-do-not-send="true"><Emily.Deng@amd.com></a><br>
<b>Subject:</b> RE: [PATCH] drm/amdgpu:
Align serial size in drm_amdgpu_info_vbios</span>
</p>
<div>
<p class="x_MsoNormal"> </p>
</div>
</div>
<div>
<div>
<p class="x_MsoNormal">[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"
target="_blank" moz-do-not-send="true"><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"
target="_blank" moz-do-not-send="true"><JiaWei.Gu@amd.com></a><br>
Cc: Alex Deucher <a
href="mailto:alexdeucher@gmail.com"
target="_blank" moz-do-not-send="true"><alexdeucher@gmail.com></a>;
amd-gfx list
<a
href="mailto:amd-gfx@lists.freedesktop.org"
target="_blank" moz-do-not-send="true"><amd-gfx@lists.freedesktop.org></a>;
Kees Cook
<a href="mailto:keescook@chromium.org"
target="_blank" moz-do-not-send="true"><keescook@chromium.org></a>;
Deng, Emily
<a href="mailto:Emily.Deng@amd.com"
target="_blank" moz-do-not-send="true"><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"
target="_blank" moz-do-not-send="true">
<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"
target="_blank" moz-do-not-send="true"><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"
target="_blank" moz-do-not-send="true"><JiaWei.Gu@amd.com></a><br>
> Cc: amd-gfx list <a
href="mailto:amd-gfx@lists.freedesktop.org"
target="_blank" moz-do-not-send="true">
<amd-gfx@lists.freedesktop.org></a>;
Kees Cook <br>
> <a href="mailto:keescook@chromium.org"
target="_blank" moz-do-not-send="true"><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"
target="_blank" moz-do-not-send="true">
<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"
target="_blank" moz-do-not-send="true"><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"
target="_blank" moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a><br>
>> <a
href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flis"
target="_blank" moz-do-not-send="true">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flis</a><br>
>> t <br>
>> <a
href="https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2Fs.freedesktop.org%2F&data=04%7C01%7Calexander.deucher%40amd.com%7C3503a51f2fa04376040b08d914558033%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637563179729003008%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=5c730zpnFFOm3EgabDFoiYlsl2tsaxImaTlVfap%2BfHQ%3D&reserved=0"
originalsrc="http://s.freedesktop.org/"
shash="btj7NLDddPgpMAMLB3quP6ykf2ispDn5lwhdGkwRIrZZVTyHyNq1ssBpJhnsN4laG44hB4T0TgfxG02TLc3I6IjzSHPptuHwBRq9Sp6n9Q/XMg8Ct49Cm1151nK1BGGldJQWTEAuULIrh/XGNTux7Thy4JSZ7ROPWWOrUswWfPk="
target="_blank" moz-do-not-send="true">
s.freedesktop.org</a>%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CJ<br>
>> i<br>
>> awei.Gu%<a
href="https://nam11.safelinks.protection.outlook.com/?url=http%3A%2F%2F40amd.com%2F&data=04%7C01%7Calexander.deucher%40amd.com%7C3503a51f2fa04376040b08d914558033%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637563179729003008%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=FzFHfe095%2FDzOYR%2BZ3tAzlF2wDRYsD5kOt%2Bf37nNVP4%3D&reserved=0"
originalsrc="http://40amd.com/"
shash="cf/ygK275ZVbFfF5lVmCbvCl/B6PwIUkYnUG9wgvvtwcT2mXzRcsorOK9cwk01GKm9po/lqDU+gc9/3q+tUApaBm9jr04e4tQJONRS9Cx/Fdk4qcFUfsqBF1b9BLLYuiTck/Wc+Ck9ZATqKU0mMol8jES2vgx8WcF8g28sj3Zc0="
target="_blank" moz-do-not-send="true">40amd.com</a>%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</p>
</div>
</div>
<p class="x_MsoNormal"><br>
<br>
</p>
<pre>_______________________________________________</pre>
<pre>amd-gfx mailing list</pre>
<pre><a href="mailto:amd-gfx@lists.freedesktop.org" target="_blank" moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a></pre>
<pre><a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C3503a51f2fa04376040b08d914558033%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637563179729012969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=GA4tfIXNrbU98WUMQl%2Bkd28DyNgqjlZcIAryQtVIn%2Bw%3D&reserved=0" originalsrc="https://lists.freedesktop.org/mailman/listinfo/amd-gfx" shash="t9pEoIbGR/QdCWU78obt+C/sor4AByekPVkQZPvb6duz54OJw/r6a/+75rBqHRpRw7idemSamNqzLoxesO+7RfIFrwyePU1Pbpr+go0REFs637qa4YUetwBREc5Ilu6Qsy5QX9jw41+/xFzr9+NOAGQBImNZ7pzucKWWycA5vVs=" target="_blank" moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a></pre>
</blockquote>
<p class="x_MsoNormal"><br>
<br>
</p>
</div>
</blockquote>
<br>
</div>
_______________________________________________<br>
amd-gfx mailing list<br>
<a href="mailto:amd-gfx@lists.freedesktop.org"
target="_blank" moz-do-not-send="true">amd-gfx@lists.freedesktop.org</a><br>
<a
href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Calexander.deucher%40amd.com%7C3503a51f2fa04376040b08d914558033%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637563179729012969%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=GA4tfIXNrbU98WUMQl%2Bkd28DyNgqjlZcIAryQtVIn%2Bw%3D&reserved=0"
originalsrc="https://lists.freedesktop.org/mailman/listinfo/amd-gfx"
shash="t9pEoIbGR/QdCWU78obt+C/sor4AByekPVkQZPvb6duz54OJw/r6a/+75rBqHRpRw7idemSamNqzLoxesO+7RfIFrwyePU1Pbpr+go0REFs637qa4YUetwBREc5Ilu6Qsy5QX9jw41+/xFzr9+NOAGQBImNZ7pzucKWWycA5vVs="
rel="noreferrer" target="_blank" moz-do-not-send="true">https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</blockquote>
</div>
</div>
</div>
</blockquote>
<br>
</body>
</html>