summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_phys_booter.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-02 06:55:42 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-02 06:55:42 -0400
commitb75e316bd42cc34397e5f66b93f4c85181ad18c8 (patch)
tree3dccb1e65ed00d6a7b8081af04dcea875f68a9e8 /kernel/gsp_phys_booter.c
parent6e7bad0791d9ff64531e1d670bfafa59a4c7fb63 (diff)
downloadopen-iov-b75e316bd42cc34397e5f66b93f4c85181ad18c8.tar.gz
open-iov-b75e316bd42cc34397e5f66b93f4c85181ad18c8.zip
gsp-phys: P6b waves 1.5 and 2 - deferred release and hardware-authored guest copies
- new default-off gsp_phys_work_defer_release: a forwarded guest push's releases are recorded and its GPFIFO entry is held (no consume, no GP_GET write, no counter publish/stall) until the work item publishes completion; the service thread then delivers the releases, with a fallback on failure/timeout (500 ms cap enforced every pump pass)/ pause/quiesce/channel-delete - new default-off gsp_phys_work_hw_primary: the software copy is skipped for forwarded ops, so the physical engine authors the data; a once-only software copy runs before the releases on any hardware failure or when the request cannot be queued - release-apply helpers extracted; exactly-once latches; channel-delete and teardown handling; counters and a work_guard state line - live: deferred-release run engaged=75 applied=75 timeouts=0 with the full smoke green; hardware-primary run req=100 ok=100 verify_ok=100 fallback=0 copy_skipped=119 copy_fail=0, smoke ALL OK 64/64 (guest read data the engine authored), with 19 fail-closed inline software fallbacks under single-inflight contention; a range-unregistered run proved the fallback (121 skipped copies, all recovered, smoke green) - defaults off; the software path and all existing guards unchanged
Diffstat (limited to 'kernel/gsp_phys_booter.c')
-rw-r--r--kernel/gsp_phys_booter.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c
index 90a0a27..69a749a 100644
--- a/kernel/gsp_phys_booter.c
+++ b/kernel/gsp_phys_booter.c
@@ -7596,6 +7596,35 @@ static int gsp_phys_state_show(struct seq_file *m, void *v)
GSP_PHYS_RMCALL_GUEST_PT_LINES_PER_PAGE);
}
{
+ /*
+ * P6b wave-1.5/wave-2 deferred guest releases and copy
+ * authorship: the sema service's held-release lifecycle plus
+ * the deferral/hardware-primary parameter state. pending is the
+ * current hold gauge (releases waiting on the forwarded copy);
+ * copy_skipped is the withheld software copies, copy_soft/
+ * copy_fail the service-thread fallback copies; the rest are
+ * monotonic counters.
+ */
+ u64 g_copy_skipped = 0, g_copy_soft = 0, g_copy_fail = 0;
+ u64 g_deferred = 0, g_applied = 0;
+ u64 g_fallback = 0, g_pending = 0, g_overflow = 0;
+ u64 g_engaged = 0, g_timeouts = 0, g_canceled = 0;
+
+ gsp_sema_service_fwd_hold_stats(&g_copy_skipped, &g_copy_soft,
+ &g_copy_fail, &g_deferred,
+ &g_applied, &g_fallback,
+ &g_pending, &g_overflow,
+ &g_engaged, &g_timeouts,
+ &g_canceled);
+ seq_printf(m,
+ "work_guard: copy_skipped=%llu deferred=%llu applied=%llu fallback=%llu pending=%llu overflow=%llu engaged=%llu timeouts=%llu canceled=%llu defer_param=%u copy_soft=%llu copy_fail=%llu hw_primary_param=%u\n",
+ g_copy_skipped, g_deferred, g_applied, g_fallback,
+ g_pending, g_overflow, g_engaged, g_timeouts,
+ g_canceled, gsp_phys_work_defer_release_enabled(),
+ g_copy_soft, g_copy_fail,
+ gsp_phys_work_hw_primary_enabled());
+ }
+ {
char guest_ram[512];
gsp_phys_guest_ram_state(guest_ram, sizeof(guest_ram));