[PATCH] drm/amdgpu: Move read of snoop register from guest to host

Masha Grinman masha.grinman at amd.com
Mon Apr 7 17:13:44 UTC 2025


From: Masha Grinman <Masha.Grinman at amd.com>

Guest is reading/writing to snoop register which is a security violation
We moved the code to the host driver
And also added a validation on the guest side to check if it's guestwq

Change-Id: I1d5773ffa6187a961994b3403d4cde5b1641369f
Signed-off-by: Masha Grinman <masha.grinman at amd.com>
---
 drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
index a54e7b929295..6dc3896fd61f 100644
--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
+++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c
@@ -221,6 +221,9 @@ static void mmhub_v1_8_init_snoop_override_regs(struct amdgpu_device *adev)
 	uint32_t distance = regDAGB1_WRCLI_GPU_SNOOP_OVERRIDE -
 			    regDAGB0_WRCLI_GPU_SNOOP_OVERRIDE;
 
+	if (amdgpu_sriov_vf(adev))
+                return;
+
 	inst_mask = adev->aid_mask;
 	for_each_inst(i, inst_mask) {
 		for (j = 0; j < 5; j++) { /* DAGB instances */
-- 
2.34.1



More information about the amd-gfx mailing list