summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}
}