Skip to content

Commit 9a940bb

Browse files
tomaszlimwajdecz
authored andcommitted
drm/xe: Assert that VF will never use fixed placement of BOs
Most BOs do not care at which offset they will be accessed within GGTT or PPGTT. The few which do care, should be only created on PF, and mapped within GGTT. On VFs, mapping at fixed offset is prohibited, as each VF is granted access to a range of GGTT address space. Since fixed addresses of GGTT mapping can only be used on PF, add an assert which makes sure no attempt of fixed placement will happen for a driver probed on a VF. Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com> Signed-off-by: Tomasz Lis <tomasz.lis@intel.com> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com> Link: https://lore.kernel.org/r/20251021224817.1593817-4-tomasz.lis@intel.com
1 parent c886343 commit 9a940bb

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,6 +2275,12 @@ static int __xe_bo_fixed_placement(struct xe_device *xe,
22752275
struct ttm_place *place = bo->placements;
22762276
u32 vram_flag, vram_stolen_flags;
22772277

2278+
/*
2279+
* to allow fixed placement in GGTT of a VF, post-migration fixups would have to
2280+
* include selecting a new fixed offset and shifting the page ranges for it
2281+
*/
2282+
xe_assert(xe, !IS_SRIOV_VF(xe) || !(bo->flags & XE_BO_FLAG_GGTT));
2283+
22782284
if (flags & (XE_BO_FLAG_USER | XE_BO_FLAG_SYSTEM))
22792285
return -EINVAL;
22802286

0 commit comments

Comments
 (0)