drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c- Extension
.c- Size
- 97190 bytes
- Lines
- 3522
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/string_choices.hlinux/wordpart.habi/guc_actions_sriov_abi.habi/guc_klvs_abi.hregs/xe_gtt_defs.hregs/xe_guc_regs.hxe_bo.hxe_device.hxe_ggtt.hxe_gt.hxe_gt_sriov_pf_config.hxe_gt_sriov_pf_helpers.hxe_gt_sriov_pf_policy.hxe_gt_sriov_printk.hxe_guc.hxe_guc_buf.hxe_guc_ct.hxe_guc_db_mgr.hxe_guc_id_mgr.hxe_guc_klv_helpers.hxe_guc_klv_thresholds_set.hxe_guc_submit.hxe_lmtt.hxe_migrate.hxe_sriov.hxe_ttm_vram_mgr.hxe_vram_types.hxe_wopcm.htests/xe_gt_sriov_pf_config_kunit.c
Detected Declarations
function guc_action_update_vf_cfgfunction pf_send_vf_cfg_resetfunction pf_send_vf_buf_klvsfunction pf_push_vf_buf_klvsfunction pf_push_vf_cfg_klvsfunction pf_push_vf_cfg_u32function pf_push_vf_cfg_u64function pf_push_vf_cfg_ggttfunction pf_push_vf_cfg_ctxsfunction pf_push_vf_cfg_dbsfunction pf_push_vf_grp_cfg_u32function pf_push_vf_cfg_exec_quantumfunction pf_push_vf_cfg_preempt_timeoutfunction pf_push_vf_cfg_sched_priorityfunction pf_push_vf_cfg_lmemfunction pf_push_vf_cfg_thresholdfunction encode_ggttfunction encode_config_ggttfunction custom_sched_priorityfunction encode_config_schedfunction encode_configfunction pf_push_full_vf_configfunction pf_push_vf_cfgfunction pf_refresh_vf_cfgfunction pf_get_ggtt_alignmentfunction pf_get_min_spare_ggttfunction pf_get_spare_ggttfunction pf_set_spare_ggttfunction pf_distribute_config_ggttfunction pf_release_vf_config_ggttfunction pf_provision_vf_ggttfunction pf_get_vf_config_ggttfunction xe_gt_sriov_pf_config_get_ggttfunction pf_config_set_u64_donefunction xe_gt_sriov_pf_config_set_ggttfunction pf_config_bulk_set_u64_donefunction xe_gt_sriov_pf_config_bulk_set_ggttfunction pf_get_max_ggttfunction pf_estimate_fair_ggttfunction pf_profile_fair_ggttfunction xe_gt_sriov_pf_config_set_fair_ggttfunction xe_gt_sriov_pf_config_ggtt_savefunction xe_gt_sriov_pf_config_ggtt_restorefunction pf_get_min_spare_ctxsfunction pf_get_spare_ctxsfunction pf_set_spare_ctxsfunction pf_reserve_ctxsfunction pf_release_ctxs
Annotated Snippet
if (tile->primary_gt == gt) {
err = pf_push_vf_cfg_lmem(gt, vfid, size);
} else {
u64 lmem = pf_get_vf_config_lmem(tile->primary_gt, vfid);
if (!lmem)
continue;
err = pf_push_vf_cfg_lmem(gt, vfid, lmem);
}
if (unlikely(err))
return err;
}
return 0;
}
static void pf_force_lmtt_invalidate(struct xe_device *xe)
{
struct xe_lmtt *lmtt;
struct xe_tile *tile;
unsigned int tid;
xe_assert(xe, xe_device_has_lmtt(xe));
xe_assert(xe, IS_SRIOV_PF(xe));
for_each_tile(tile, xe, tid) {
lmtt = &tile->sriov.pf.lmtt;
xe_lmtt_invalidate_hw(lmtt);
}
}
static void pf_reset_vf_lmtt(struct xe_device *xe, unsigned int vfid)
{
struct xe_lmtt *lmtt;
struct xe_tile *tile;
unsigned int tid;
xe_assert(xe, xe_device_has_lmtt(xe));
xe_assert(xe, IS_SRIOV_PF(xe));
for_each_tile(tile, xe, tid) {
lmtt = &tile->sriov.pf.lmtt;
xe_lmtt_drop_pages(lmtt, vfid);
}
}
static int pf_update_vf_lmtt(struct xe_device *xe, unsigned int vfid)
{
struct xe_gt_sriov_config *config;
struct xe_tile *tile;
struct xe_lmtt *lmtt;
struct xe_bo *bo;
struct xe_gt *gt;
u64 total, offset;
unsigned int gtid;
unsigned int tid;
int err;
xe_assert(xe, xe_device_has_lmtt(xe));
xe_assert(xe, IS_SRIOV_PF(xe));
total = 0;
for_each_tile(tile, xe, tid)
total += pf_get_vf_config_lmem(tile->primary_gt, vfid);
for_each_tile(tile, xe, tid) {
lmtt = &tile->sriov.pf.lmtt;
xe_lmtt_drop_pages(lmtt, vfid);
if (!total)
continue;
err = xe_lmtt_prepare_pages(lmtt, vfid, total);
if (err)
goto fail;
offset = 0;
for_each_gt_with_type(gt, xe, gtid, BIT(XE_GT_TYPE_MAIN)) {
config = pf_pick_vf_config(gt, vfid);
bo = config->lmem_obj;
if (!bo)
continue;
err = xe_lmtt_populate_pages(lmtt, vfid, bo, offset);
if (err)
goto fail;
offset += xe_bo_size(bo);
}
}
pf_force_lmtt_invalidate(xe);
Annotation
- Immediate include surface: `linux/string_choices.h`, `linux/wordpart.h`, `abi/guc_actions_sriov_abi.h`, `abi/guc_klvs_abi.h`, `regs/xe_gtt_defs.h`, `regs/xe_guc_regs.h`, `xe_bo.h`, `xe_device.h`.
- Detected declarations: `function guc_action_update_vf_cfg`, `function pf_send_vf_cfg_reset`, `function pf_send_vf_buf_klvs`, `function pf_push_vf_buf_klvs`, `function pf_push_vf_cfg_klvs`, `function pf_push_vf_cfg_u32`, `function pf_push_vf_cfg_u64`, `function pf_push_vf_cfg_ggtt`, `function pf_push_vf_cfg_ctxs`, `function pf_push_vf_cfg_dbs`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.