]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/xe/vf: React to MIGRATED interrupt
authorTomasz Lis <tomasz.lis@intel.com>
Mon, 4 Nov 2024 21:34:45 +0000 (22:34 +0100)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Wed, 6 Nov 2024 13:53:35 +0000 (14:53 +0100)
commit6e6d7b41f9870cd464bed7632228b5f977e2c0b1
treefbdc4f7c4a9783a95b2a613ace0b12569c1c5f64
parent20ade9c3f1958035306500e1ee0c7ee777ee8d42
drm/xe/vf: React to MIGRATED interrupt

To properly support VF Save/Restore procedure, fixups need to be
applied after PF driver finishes its part of VF Restore. The fixups
are required to adjust the ongoing execution for a hardware switch
that happened, because some GFX resources are not fully virtualized,
and assigned to a VF as range from a global pool. The VF on which
a VM is restored will often have different ranges provisioned than
the VF on which save process happened. Those resource fixups are
applied by the VF driver within a restored VM.

A VF driver gets informed that it was migrated by receiving an
interrupt from each GuC. The interrupt assigned for that purpose
is "GUC SW interrupt 0". Seeing that fields set from within the
irq handler should be the trigger for fixups.

The VF can safely do post-migration fixups on resources associated
to each GuC only after that GuC issued the MIGRATED interrupt.

This change introduces a worker to be used for post-migration fixups,
and a mechanism to schedule said worker when all GuCs sent the irq.

v2: renamed and moved functions, updated logged messages, removed
  unused includes, used anon struct (Michal)
v3: ordering, kerneldoc, asserts, debug messages,
  on_all_tiles -> on_all_gts (Michal)
v4: fixed missing header include
v5: Explained what fixups are, explained which IRQ is used, style
  fixes (Michal)

Bspec: 50868
Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241104213449.1455694-2-tomasz.lis@intel.com
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
drivers/gpu/drm/xe/Makefile
drivers/gpu/drm/xe/xe_device_types.h
drivers/gpu/drm/xe/xe_gt_sriov_vf.c
drivers/gpu/drm/xe/xe_gt_sriov_vf.h
drivers/gpu/drm/xe/xe_guc.c
drivers/gpu/drm/xe/xe_memirq.c
drivers/gpu/drm/xe/xe_sriov.c
drivers/gpu/drm/xe/xe_sriov_types.h
drivers/gpu/drm/xe/xe_sriov_vf.c [new file with mode: 0644]
drivers/gpu/drm/xe/xe_sriov_vf.h [new file with mode: 0644]