diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-01 22:22:21 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-01 22:22:21 -0400 |
| commit | bf63a7dfef0b31c233d21d8f49f81dc40702e9c7 (patch) | |
| tree | 09c4e1178b2335549ddd7692774001c96d6dd28b /kernel/include/nvidia-vgpu-vfio.h | |
| parent | bc4a3de674c1a93030186fc627e05e9a3c81b519 (diff) | |
| download | open-iov-bf63a7dfef0b31c233d21d8f49f81dc40702e9c7.tar.gz open-iov-bf63a7dfef0b31c233d21d8f49f81dc40702e9c7.zip | |
gsp-phys: mdev-owned backend lifecycle (P1)
Add the gsp_phys_mdev_owned ownership selector (default 0: unchanged
load-time module-owned claim/boot). With 1, module load claims nothing;
the first mdev create starts a refcounted backend session whose
claim+boot runs asynchronously from a work item, so mdev create and
init_work never block. The last mdev remove releases after the emulation
thread is stopped. Failures are fail-open: the backend stays OFF and the
mdev keeps serving the emulation path.
nv_vgpu_exit now gates the session STOPPING under the session lock,
drains the emulation threads via mdev_unregister_driver(), and only then
releases the claim; the module-owned path keeps its previous release
position. A start while STOPPING is refused and a concurrent second
stopper cannot release twice. No forwarding is added.
Diffstat (limited to 'kernel/include/nvidia-vgpu-vfio.h')
| -rw-r--r-- | kernel/include/nvidia-vgpu-vfio.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/include/nvidia-vgpu-vfio.h b/kernel/include/nvidia-vgpu-vfio.h index 961bba2..aed3dc5 100644 --- a/kernel/include/nvidia-vgpu-vfio.h +++ b/kernel/include/nvidia-vgpu-vfio.h @@ -135,6 +135,12 @@ struct nv_vgpu_device { /* VFIO device registration state */ bool vfio_dev_registered; + + /* True when this mdev holds a reference on the physical backend + * session (gsp_phys_backend_start() succeeded in init_work); the + * matching gsp_phys_backend_stop() runs in cleanup_work after the + * emulation thread is stopped. */ + bool phys_backend_ref; }; typedef struct nv_vgpu_device nv_vgpu_device; |
