summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_sema_service.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-18 16:01:43 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-10-18 16:01:58 -0400
commit077879fa5ca410d387bdc913fae12effcc47799b (patch)
tree649067a81e3a05f582635447c1ccb76b0848d27f /kernel/gsp_sema_service.c
parent436e66f51242071ef57205a40b1aee20cba3539a (diff)
downloadopen-iov-077879fa5ca410d387bdc913fae12effcc47799b.tar.gz
open-iov-077879fa5ca410d387bdc913fae12effcc47799b.zip
vgsp: fail4 r235 - A-TRACE dir tag + 64KB copies exempt from bigcopy budget
r235: only 4 of the probe's ~9 64KB copies reached the ring (the sema_bigcopy_log budget had absorbed the rest - the A H2D is missing entirely), and the events lack direction/buffer identity. Now: - every total==65536 copy bypasses the bigcopy budget (its own 128-line A-TRACE budget still bounds volume) so the probe's H2D and all D2H readbacks always appear; - A-TRACE carries dir=H2D/D2H (device=VID low-pa, host=SYS high-pa) plus pt=P1/P2 (upload read/landed) or P4/P4R (readback source/result). r235 decode so far: the A upload lands ([0 1 2 3] in device pa 0x7800000 at t=.94) and the SAME device page is later rewritten to [16382 16383 8193 8194] - h_A's own values at shifted offsets - with the pattern repeated across consecutive device pages (0x7800000/0x7810000/ 0x7820000), i.e. a repeated-page/offset-wrapped write inside the emulated copy or engine path, not client-side. The trace fix makes the next capture name the exact path (missing H2D included). (cherry picked from commit 9b35145136c949405c7fb4d22b3405c174ecb055)
Diffstat (limited to 'kernel/gsp_sema_service.c')
-rw-r--r--kernel/gsp_sema_service.c43
1 files changed, 34 insertions, 9 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c
index 487bb4d..1a8e45a 100644
--- a/kernel/gsp_sema_service.c
+++ b/kernel/gsp_sema_service.c
@@ -5199,6 +5199,8 @@ static int svc_copy(struct nv_vgpu_device *vgpu, u64 dst, u64 src, size_t total,
bool bigcopy_this = false;
bool audit = total >= SVC_COPY_AUDIT_MIN;
static u64 bigcopy_log;
+ bool trace64 = (total == 65536u);
+ const char *dir = "?";
if (done_out)
*done_out = 0; /* 0 until the first byte lands */
@@ -5341,8 +5343,33 @@ static int svc_copy(struct nv_vgpu_device *vgpu, u64 dst, u64 src, size_t total,
*/
if ((total >= SVC_COPY_AUDIT_MIN ||
(dst_virt && dst_orig >= SVC_VAS_FLOOR)) &&
- bigcopy_log < gsp_sema_bigcopy_log_max) {
+ (bigcopy_log < gsp_sema_bigcopy_log_max || total == 65536u)) {
u8 sb[16] = {0}, db[16] = {0};
+ /*
+ * r235: 64 KB copies are exempt from the bigcopy budget - the
+ * probe's A upload/readbacks must ALWAYS appear (the budget
+ * belongs to the multi-MB traffic and had absorbed every 64 KB
+ * probe copy in the r235 capture).
+ */
+ bool trace64 = (total == 65536u);
+ const char *dir =
+ (dst_aperture == CE_APERTURE_VID &&
+ src_aperture == CE_APERTURE_SYS) ? "H2D" :
+ (src_aperture == CE_APERTURE_VID &&
+ dst_aperture == CE_APERTURE_SYS) ? "D2H" :
+ src_shadow ? "shadow->" : "phys";
+
+ /*
+ * r235: 64 KB copies are exempt from the bigcopy budget - the
+ * probe's A upload/readbacks must ALWAYS appear (the budget
+ * belongs to the multi-MB traffic and had absorbed every 64 KB
+ * probe copy in the r235 capture).
+ */
+ dir = (dst_aperture == CE_APERTURE_VID &&
+ src_aperture == CE_APERTURE_SYS) ? "H2D" :
+ (src_aperture == CE_APERTURE_VID &&
+ dst_aperture == CE_APERTURE_SYS) ? "D2H" :
+ src_shadow ? "shadow->" : "phys";
bigcopy_log++;
bigcopy_this = true;
@@ -5379,7 +5406,7 @@ static int svc_copy(struct nv_vgpu_device *vgpu, u64 dst, u64 src, size_t total,
* (the engine-authored page as ints). The expected content is
* ints 0,1,2,3,... for the probe A buffer.
*/
- if (total == 65536u && svc_atrace_log < 128u) {
+ if (trace64 && svc_atrace_log < 128u) {
u32 i0, i1, i2, i3, j0 = 0, j1 = 0, j2 = 0, j3 = 0;
svc_atrace_log++;
@@ -5391,9 +5418,8 @@ static int svc_copy(struct nv_vgpu_device *vgpu, u64 dst, u64 src, size_t total,
memcpy(&j1, db + 4, 4);
memcpy(&j2, db + 8, 4);
memcpy(&j3, db + 12, 4);
- pr_info("vgsp: A-TRACE pt=%s dst_va=0x%llx dst_pa=0x%llx dst_prov=%u | src_va=0x%llx src_pa=0x%llx src_prov=%u | src_int4=%d %d %d %d dst_int4_before=%d %d %d %d\n",
- dst_shadow || dst_aperture == CE_APERTURE_VID ?
- "P1" : "P4",
+ pr_info("vgsp: A-TRACE pt=%s dir=%s dst_va=0x%llx dst_pa=0x%llx dst_prov=%u | src_va=0x%llx src_pa=0x%llx src_prov=%u | src_int4=%d %d %d %d dst_int4_before=%d %d %d %d\n",
+ !strcmp(dir, "H2D") ? "P1" : "P4", dir,
dst_orig, dst, dst_prov, src_orig, src,
src_prov, i0, i1, i2, i3, j0, j1, j2, j3);
}
@@ -5772,7 +5798,7 @@ static int svc_copy(struct nv_vgpu_device *vgpu, u64 dst, u64 src, size_t total,
* the copy - for H2D this is the landed upload (P2), for D2H
* the host-side readback result (P4R).
*/
- if (total == 65536u && svc_atrace_log < 128u) {
+ if (trace64 && svc_atrace_log < 128u) {
u32 i0, i1, i2, i3;
svc_atrace_log++;
@@ -5780,9 +5806,8 @@ static int svc_copy(struct nv_vgpu_device *vgpu, u64 dst, u64 src, size_t total,
memcpy(&i1, da + 4, 4);
memcpy(&i2, da + 8, 4);
memcpy(&i3, da + 12, 4);
- pr_info("vgsp: A-TRACE pt=%s dst_va=0x%llx dst_pa=0x%llx dst_int4_after=%d %d %d %d\n",
- dst_shadow || dst_aperture == CE_APERTURE_VID ?
- "P2" : "P4R",
+ pr_info("vgsp: A-TRACE pt=%s dir=%s dst_va=0x%llx dst_pa=0x%llx dst_int4_after=%d %d %d %d\n",
+ !strcmp(dir, "H2D") ? "P2" : "P4R", dir,
dst_orig, dst, i0, i1, i2, i3);
}
}