<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Calibri;font-size:10pt;color:#0000FF;margin:5pt;font-style:normal;font-weight:normal;text-decoration:none;" align="Left">
[AMD Official Use Only - AMD Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
Hi,</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(0, 0, 0);" class="elementToProof">
As discuss offline with Thomas, will check the VF critical address regions of guest in another patch as a new feature.</div>
<p style="text-align: left; text-indent: 0px; background-color: white; margin: 0px;" class="elementToProof">
<span style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: black;">Regards,</span></p>
<p style="text-align: left; text-indent: 0px; background-color: white; margin-top: 0px; margin-bottom: 0px;" class="elementToProof">
<span style="font-family: Calibri, Helvetica, sans-serif; font-size: 11pt; color: rgb(36, 36, 36);">Liu, Xiang</span></p>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Liu, Xiang(Dean) <Xiang.Liu@amd.com><br>
<b>Sent:</b> Wednesday, August 20, 2025 1:33 PM<br>
<b>To:</b> Chai, Thomas <YiPeng.Chai@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Zhang, Hawking <Hawking.Zhang@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Yang, Stanley <Stanley.Yang@amd.com><br>
<b>Subject:</b> Re: [PATCH 2/2] drm/amdgpu: Check VF critical region before RAS poison injection</font>
<div> </div>
</div>
<style type="text/css" style="display:none">
<!--
p
{margin-top:0;
margin-bottom:0}
-->
</style>
<div dir="ltr">
<p align="Left" style="font-family:Calibri; font-size:10pt; color:#0000FF; margin:5pt; font-style:normal; font-weight:normal; text-decoration:none">
[AMD Official Use Only - AMD Internal Distribution Only]<br>
</p>
<br>
<div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
Hi Thomas, </div>
<div class="x_elementToProof" style="font-family:Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(0,0,0)">
Sure, will do, thanks.</div>
<p class="x_elementToProof" style="text-align:left; text-indent:0px; background-color:white; margin:0px">
<span style="font-family:Calibri,Helvetica,sans-serif; font-size:11pt; color:black">Regards,</span></p>
<p class="x_elementToProof" style="text-align:left; text-indent:0px; background-color:white; margin-top:0px; margin-bottom:0px">
<span style="font-family:Calibri,Helvetica,sans-serif; font-size:11pt; color:rgb(36,36,36)">Liu, Xiang</span></p>
<div id="x_appendonsend"></div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Chai, Thomas <YiPeng.Chai@amd.com><br>
<b>Sent:</b> Wednesday, August 20, 2025 9:39 AM<br>
<b>To:</b> Liu, Xiang(Dean) <Xiang.Liu@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Zhang, Hawking <Hawking.Zhang@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Yang, Stanley <Stanley.Yang@amd.com><br>
<b>Subject:</b> RE: [PATCH 2/2] drm/amdgpu: Check VF critical region before RAS poison injection</font>
<div> </div>
</div>
<div class="x_BodyFragment"><font face="Times New Roman" size="3"><span style="font-size:12pt"><a name="x_BM_BEGIN"></a>
<div><font size="2"><span style="font-size:11pt">[AMD Official Use Only - AMD Internal Distribution Only]<br>
<br>
-----Original Message-----<br>
From: Liu, Xiang(Dean) <Xiang.Liu@amd.com><br>
Sent: Tuesday, August 19, 2025 1:26 PM<br>
To: amd-gfx@lists.freedesktop.org<br>
Cc: Zhang, Hawking <Hawking.Zhang@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Yang, Stanley <Stanley.Yang@amd.com>; Chai, Thomas <YiPeng.Chai@amd.com>; Liu, Xiang(Dean) <Xiang.Liu@amd.com><br>
Subject: [PATCH 2/2] drm/amdgpu: Check VF critical region before RAS poison injection<br>
<br>
Check VF critical region before RAS poison injection to ensure that the poison injection will not hit the VF critical region.<br>
<br>
Signed-off-by: Xiang Liu <xiang.liu@amd.com><br>
---<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 7 +++++++<br>
1 file changed, 7 insertions(+)<br>
<br>
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
index b00cbb927ca8..6730de574fdc 100644<br>
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c<br>
@@ -219,10 +219,17 @@ static int amdgpu_check_address_validity(struct amdgpu_device *adev,<br>
struct amdgpu_vram_block_info blk_info;<br>
uint64_t page_pfns[32] = {0};<br>
int i, ret, count;<br>
+ bool hit = false;<br>
<br>
if (amdgpu_ip_version(adev, UMC_HWIP, 0) < IP_VERSION(12, 0, 0))<br>
return 0;<br>
<br>
+ if (amdgpu_sriov_vf(adev)) {<br>
+ if (amdgpu_virt_check_vf_critical_region(adev, address, &hit))<br>
+ return -EPERM;<br>
+ return hit ? -EACCES : 0;<br>
<br>
[Thomas]Only checking if the address is within the PF critical address regions may be not sufficient,<br>
The VF critical address regions of guest may be also need to be checked.<br>
<br>
+ }<br>
+<br>
if ((address >= adev->gmc.mc_vram_size) ||<br>
(address >= RAS_UMC_INJECT_ADDR_LIMIT))<br>
return -EFAULT;<br>
--<br>
2.34.1<br>
<br>
</span></font></div>
</span></font></div>
</div>
</div>
</div>
</body>
</html>