summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_sema_service.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/gsp_sema_service.c')
-rw-r--r--kernel/gsp_sema_service.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c
index d9f5895..b7290d4 100644
--- a/kernel/gsp_sema_service.c
+++ b/kernel/gsp_sema_service.c
@@ -3136,6 +3136,7 @@ static void svc_pool_boot_store(u64 va, u64 pa, int ap); /* m168 */
static bool svc_dst_guard_hold(u64 va); /* m169b */
static bool svc_dst_guard_pending(u64 va); /* r231 */
static u32 svc_read_order_log; /* r231 budget */
+static u32 svc_atrace_log; /* r234 A-TRACE budget */
static int svc_pool_pa_lookup(u64 va, u64 *pa, int *ap)
{
@@ -5368,6 +5369,31 @@ static int svc_copy(struct nv_vgpu_device *vgpu, u64 dst, u64 src, size_t total,
total);
pr_info("sema-bigcopy: src16=%16phN dst16_before=%16phN\n",
sb, db);
+ /*
+ * r234 A-TRACE: one labeled line per 64 KB copy so the probe A
+ * upload/readback is greppable end-to-end. pt=P1 = H2D source
+ * read (the uploaded bytes as ints), pt=P4 = D2H source read
+ * (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) {
+ u32 i0, i1, i2, i3, j0 = 0, j1 = 0, j2 = 0, j3 = 0;
+
+ svc_atrace_log++;
+ memcpy(&i0, sb, 4);
+ memcpy(&i1, sb + 4, 4);
+ memcpy(&i2, sb + 8, 4);
+ memcpy(&i3, sb + 12, 4);
+ memcpy(&j0, db, 4);
+ 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",
+ dst_orig, dst, dst_prov, src_orig, src,
+ src_prov, i0, i1, i2, i3, j0, j1, j2, j3);
+ }
}
/*
@@ -5738,6 +5764,24 @@ static int svc_copy(struct nv_vgpu_device *vgpu, u64 dst, u64 src, size_t total,
}
pr_info("sema-bigcopy: dst16_after=%16phN (dst_va=0x%llx pa=0x%llx)\n",
da, dst_orig, dst);
+ /*
+ * r234 A-TRACE pt=P2/P4R: the destination content right after
+ * 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) {
+ u32 i0, i1, i2, i3;
+
+ svc_atrace_log++;
+ memcpy(&i0, da, 4);
+ 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",
+ dst_orig, dst, i0, i1, i2, i3);
+ }
}
if (gsp_sema_dbg && !src_shadow && !dst_shadow &&