diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-26 11:01:54 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-26 11:01:54 -0400 |
| commit | a6c6b57db6e5d2c241a7f3ecdad2d2b12ae04947 (patch) | |
| tree | f8a826a90c5704e6cf68eef57203f116654fef5b /kernel/main.c | |
| parent | b1fd4ccbb45a3f0b2d33b3414102ee1fda66e3b2 (diff) | |
| download | open-iov-a6c6b57db6e5d2c241a7f3ecdad2d2b12ae04947.tar.gz open-iov-a6c6b57db6e5d2c241a7f3ecdad2d2b12ae04947.zip | |
vgsp: dump_vidmem map mode - one line per 1 MB block with non-zero content (nz count + first offset) to locate the live client's uploaded regions in the 256 MB aperture without 65536 range dumps
Diffstat (limited to 'kernel/main.c')
| -rw-r--r-- | kernel/main.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/kernel/main.c b/kernel/main.c index 7af236d..7016647 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -3482,6 +3482,47 @@ static int nv_vgpu_dump_vidmem_set(const char *val, const struct kernel_param *k mutex_unlock(&nv_vgpu_driver.lock); return 0; } + if (!strncmp(buf, "map", 3)) { + /* + * Coarse non-zero map: one line per 1 MB block that holds + * any non-zero dword (SESSION 131: locate the live client's + * uploaded content - the image BO, the code heap, the rings - + * inside the 256 MB aperture without 65536 range dumps). + */ + mutex_lock(&nv_vgpu_driver.lock); + list_for_each_entry(vgpu, &nv_vgpu_driver.devices, list) { + u8 *base = vgpu->bars[1].vaddr; + size_t size = vgpu->bars[1].size; + size_t blk, nblk = (size + (1 << 20) - 1) >> 20; + size_t o; + + if (!base || !size) + continue; + for (blk = 0; blk < nblk; blk++) { + size_t start = blk << 20; + size_t end = start + (1 << 20); + u32 nz = 0, first = 0; + + if (end > size) + end = size; + for (o = start; o + 4 <= end; o += 4) { + u32 v; + + memcpy(&v, base + o, 4); + if (v) { + if (!nz) + first = (u32)(o & 0xFFFFF); + nz++; + } + } + if (nz) + pr_info("vgsp: vidmem map blk 0x%zx nz=%u first=0x%x\n", + start, nz, first); + } + } + mutex_unlock(&nv_vgpu_driver.lock); + return 0; + } comma = strchr(buf, ','); if (comma) |
