Skip to content

Commit 72fef49

Browse files
Yifan Zhaalexdeucher
authored andcommitted
drm/amdgpu: Remove writing GRBM_GFX_CNTL in RLCG interface under SRIOV
[Why] Accessing GRBM_GFX_CNTL in full access time has risk when VF is doing MMIO attacking. Therefore, VF writing GRBM_GFX_CNTL are blocked by L1 Policy. For RLCG interface, RLCG use SCRATCH_REG2 which is copied from GRBM_GFX_CNTL. [How] Remove writing GRBM_GFX_CNTL in amdgpu_virt_rlcg_reg_rw. v2: Remove directly writing GRBM_GFX_INDEX in amdgpu_virt_rlcg_reg_rw as RLCG interface no need to use it. Signed-off-by: Yifan Zha <Yifan.Zha@amd.com> Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 11cc465 commit 72fef49

1 file changed

Lines changed: 0 additions & 2 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -983,11 +983,9 @@ static u32 amdgpu_virt_rlcg_reg_rw(struct amdgpu_device *adev, u32 offset, u32 v
983983
if (offset == reg_access_ctrl->grbm_cntl) {
984984
/* if the target reg offset is grbm_cntl, write to scratch_reg2 */
985985
writel(v, scratch_reg2);
986-
writel(v, ((void __iomem *)adev->rmmio) + (offset * 4));
987986
} else if (offset == reg_access_ctrl->grbm_idx) {
988987
/* if the target reg offset is grbm_idx, write to scratch_reg3 */
989988
writel(v, scratch_reg3);
990-
writel(v, ((void __iomem *)adev->rmmio) + (offset * 4));
991989
} else {
992990
/*
993991
* SCRATCH_REG0 = read/write value

0 commit comments

Comments
 (0)