From f10c346a65bbd2185c2ae3575f026796265a5d23 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Wed, 30 Sep 2026 11:27:29 -0400 Subject: sema-svc: operand resolver gains the targeted rm_mem fallback; per-side translation-miss tracing (the DtoH copy operand is the failing side) --- kernel/gsp_sema_service.c | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'kernel/gsp_sema_service.c') diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index 8b5f4af..b025dde 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -354,6 +354,7 @@ struct sema_svc { u64 ring_ops; /* op runs from ring-decoded pushes */ u64 lda_log; /* LAUNCH_DMA inventory budget */ u64 sem256_log; /* 256-byte op trace budget */ + u64 op_tr_log; /* operand targeted-resolve budget */ u64 copy_watch_log; /* sema_copy_watch log budget */ u64 copy_pat_log; /* sema_copy_pat log budget */ u64 copy_dst_log; /* sema_copy_dst log budget */ @@ -1996,6 +1997,26 @@ static int svc_op_translate(struct nv_vgpu_device *vgpu, u64 va, u64 *addr, CE_APERTURE_SYS; return 0; } + /* + * Targeted resolve: the RAM scan for the rm_mem record that owns this + * VA. svc_lookup_trusted has always had this fallback (the GRCE HtoD + * resolves the client's device pointer through it), but this operand + * path did not: a boot whose content-scanned map or published page + * directories happen not to cover the operand failed the copy with + * -ENOENT (observed: the DtoH copy of the cdt2 payload, rc=-2, while + * the HtoD for the same source VA resolved). That is the boot-to-boot + * 64/64 vs 0/64 variance. + */ + if (!svc_targeted_resolve(vgpu, va & ~0xfffULL, &pa)) { + *addr = pa + (va & 0xfff); + *aperture = CE_APERTURE_SYS; + if (svc.op_tr_log < 64) { + svc.op_tr_log++; + pr_info("sema-op-tr: va=0x%llx -> pa=0x%llx\n", + va, *addr); + } + return 0; + } return -ENOENT; } @@ -2077,8 +2098,14 @@ static int svc_copy(struct nv_vgpu_device *vgpu, u64 dst, u64 src, size_t total, u64 pa; u32 aper; - if (svc_op_translate(vgpu, dst, &pa, &aper)) + if (svc_op_translate(vgpu, dst, &pa, &aper)) { + if (svc.op_tr_log < 64) { + svc.op_tr_log++; + pr_info("sema-tr-miss: DST va=0x%llx h=0x%x\n", + dst, svc.cur_ch); + } return -ENOENT; + } dst = pa; dst_aperture = aper; } @@ -2086,8 +2113,14 @@ static int svc_copy(struct nv_vgpu_device *vgpu, u64 dst, u64 src, size_t total, u64 pa; u32 aper; - if (svc_op_translate(vgpu, src, &pa, &aper)) + if (svc_op_translate(vgpu, src, &pa, &aper)) { + if (svc.op_tr_log < 64) { + svc.op_tr_log++; + pr_info("sema-tr-miss: SRC va=0x%llx h=0x%x\n", + src, svc.cur_ch); + } return -ENOENT; + } src = pa; src_aperture = aper; } -- cgit v1.2.3