diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-11-16 23:25:22 -0500 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-11-16 23:25:22 -0500 |
| commit | 9386fe4b948e0aba2f3455671a77e18452ddc924 (patch) | |
| tree | ec6ab1ab202145a91ea485a38672b74bf0ae829c /kernel | |
| parent | 6107a002a5fb532f0b673c107c4cbe5d0d8925b4 (diff) | |
| download | open-iov-9386fe4b948e0aba2f3455671a77e18452ddc924.tar.gz open-iov-9386fe4b948e0aba2f3455671a77e18452ddc924.zip | |
vgsp: phys_gr_dump_push - hexdump the captured raw GR push per launch
Add a diagnostic-only module param (default 0) that dumps the launch
request's raw guest push (req->raw, raw_words dwords, raw[0] = push_va)
to dmesg in 16-dword PUSH[i] rows, gated to pushes >= 512 dwords. This
lets the real client method stream be scanned offline for draw encodings
(CALL_MME_MACRO slots 0x3800/0x3910/0x3914/0x3960/0x39c8/0x39d0, BEGIN
0x1618/0xd78, run/shape census) without a guest /dev/mem read. No
behaviour change when clear.
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/gsp_phys_booter.c | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/kernel/gsp_phys_booter.c b/kernel/gsp_phys_booter.c index 36ccbe1..2be4a60 100644 --- a/kernel/gsp_phys_booter.c +++ b/kernel/gsp_phys_booter.c @@ -86,6 +86,20 @@ MODULE_PARM_DESC(gsp_phys_nocat, "Log every GSP-RM NOCAT journal record (status-queue function 0x1020) individually during the stage-3e RM-init poll (default 0; the unique-record summary is always accumulated and dumped when the poll ends)"); /* + * phys_gr_dump_push: development-only raw-push capture. Hexdump the captured + * guest GR push (req->raw, the raw method stream the launch request carries) + * to dmesg once per launch so the real client draw encoding can be scanned + * offline: CALL_MME_MACRO slot runs (0x3910/0x3914), BEGIN 0x1618, the + * 0x0d78 family and the run/shape census. Raw[0] is the push base, so word + * index i is push_va + i*4. Bounded to GSP_PHYS_GR_RAW_WORDS dwords (the + * capture bound itself). Default 0 (no logging, no behaviour change). + */ +static bool gsp_phys_gr_dump_push_param; +module_param_named(phys_gr_dump_push, gsp_phys_gr_dump_push_param, bool, 0644); +MODULE_PARM_DESC(phys_gr_dump_push, + "Hexdump the captured raw GR push (up to GSP_PHYS_GR_RAW_WORDS dwords) to dmesg once per launch (default 0; diagnostic only)"); + +/* * GRFIX FIX3 (relocation coverage, default 0): the QMD/bank rewrite scan * counts 8-byte words that pass the rewrite's own device-VA shape test * (>= 0x10000000, < 2^47, 256-byte aligned) but match NO tracked data page @@ -31640,6 +31654,36 @@ int gsp_phys_backend_guest_gr_submit(const struct gsp_phys_gr_submit *req, return -EINVAL; } /* + * phys_gr_dump_push: the raw client method stream, once per launch. + * raw[0] is the push base (req->push_va), so PUSH[i] covers words + * push_va + i*4 .. push_va + (i+15)*4. The scan this feeds looks for + * the DRAW CALL encodings (0xa00a0e44 ONE_INCR 0x3910, 0x3914 data + * writes, BEGIN 0x1618) and counts runs/shapes in the real push. + * Gated to pushes >= 512 dwords so every real client draw window is + * dumped while the tiny release/state pokes are skipped. + */ + if (READ_ONCE(gsp_phys_gr_dump_push_param) && req->raw && + req->raw_words >= 512u) { + u32 dn = req->raw_words; + u32 di; + + if (dn > GSP_PHYS_GR_RAW_WORDS) + dn = GSP_PHYS_GR_RAW_WORDS; + pr_info("vgsp-gr: PUSH-DUMP h=0x%x push=0x%llx len=%u raw_words=%u dump_words=%u (raw[0]=push base; word i at push_va+4*i)\n", + req->h_object, req->push_va, req->push_len, + req->raw_words, dn); + for (di = 0; di < dn; di += 16u) { + char db[160]; + u32 dj, dofs = 0; + + for (dj = di; dj < di + 16u && dj < dn; dj++) + dofs += scnprintf(db + dofs, sizeof(db) - dofs, + "%08x ", + get_unaligned_le32(req->raw + dj)); + pr_info("vgsp-gr: PUSH[%05u]: %s\n", di, db); + } + } + /* * r564: refuse a degenerate data set BEFORE the engine ever sees it. * r565 evidence: the fill dropped 4 argument bases (GRFILL-DROP), * RDW showed nrecs=2 where healthy launches run 968-969, the launch |
