summaryrefslogtreecommitdiffstats
path: root/kernel/main.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-16 13:33:02 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-16 13:33:02 -0400
commit06b9333cf64f613be5dfb3ea1ee40e087a182061 (patch)
treed327a143112ef3b6e2cd4194dc972771adc209c5 /kernel/main.c
parentb09743033bb8c42fdeea672eaf260d1eebe84092 (diff)
parent15fdb36784b62e36a76a15e8072274fd8f2b55cf (diff)
downloadopen-iov-06b9333cf64f613be5dfb3ea1ee40e087a182061.tar.gz
open-iov-06b9333cf64f613be5dfb3ea1ee40e087a182061.zip
Merge branch 'dual'
Diffstat (limited to 'kernel/main.c')
-rw-r--r--kernel/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/main.c b/kernel/main.c
index d0308c4..257638a 100644
--- a/kernel/main.c
+++ b/kernel/main.c
@@ -1740,6 +1740,16 @@ static void nv_vgpu_device_cleanup_work(struct work_struct *work)
gsp_emu_cleanup(vgpu);
/*
+ * Dual-guest (goal 1.0): release everything the sema service still holds
+ * for this mdev (channel entries, session/scrubber records, a release
+ * hold that names it - quiescing any in-flight forwarding work) and drop
+ * its per-mdev guest-RAM record, BEFORE the vgpu struct can be freed: a
+ * stale pointer in the service's tables must never match a later device.
+ */
+ gsp_sema_service_vgpu_cleanup(vgpu);
+ gsp_phys_guest_ram_vgpu_clear(vgpu);
+
+ /*
* Last-reference backend teardown: gsp_emu_cleanup() above has stopped
* this mdev's emulation thread, so no forward can be in flight when the
* claim is released. The backend session stays up until the last mdev