diff options
| author | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-25 16:36:58 -0400 |
|---|---|---|
| committer | Arthur Hanson Rasmusson <arthur@vgpu.io> | 2026-10-25 16:36:58 -0400 |
| commit | 8700f65ae13ccdbeb6e66496ac2371c0a0fc0274 (patch) | |
| tree | 9f4ef1b35f0fdbfa58c6ce8de439f094eda3757f /tools/guest-diag/wall2/kc_dump_fn.py | |
| parent | d6ccdaf3937b28126d5e55ba04f54ae0e3d2b8b9 (diff) | |
| download | open-iov-8700f65ae13ccdbeb6e66496ac2371c0a0fc0274.tar.gz open-iov-8700f65ae13ccdbeb6e66496ac2371c0a0fc0274.zip | |
tools/vk: vk_frame gains an optional 7th arg (tiling: 0=optimal default, 1=linear) and a buffer-allocation type-retry loop; wall2: the QEMU-gdbstub kernel-breakpoint script (module VAs insert+patch but never fire - the stub's memory context does not resolve module VAs) and the kcore symbol dumper; session findings: the vkAllocateMemory -2 = the image's internal COMPR 2MB-page 64KB sub-allocation failing NV_ERR_NO_MEMORY after the image data alloc succeeds (both tilings)
Diffstat (limited to 'tools/guest-diag/wall2/kc_dump_fn.py')
| -rw-r--r-- | tools/guest-diag/wall2/kc_dump_fn.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/guest-diag/wall2/kc_dump_fn.py b/tools/guest-diag/wall2/kc_dump_fn.py new file mode 100644 index 0000000..e481d24 --- /dev/null +++ b/tools/guest-diag/wall2/kc_dump_fn.py @@ -0,0 +1,21 @@ +import struct, sys +VA = int(sys.argv[1], 16) +N = int(sys.argv[2], 16) if len(sys.argv) > 2 else 0x800 +f = open("/proc/kcore","rb") +hdr = f.read(64) +e_phoff = struct.unpack_from("<Q", hdr, 0x20)[0] +e_phentsize = struct.unpack_from("<H", hdr, 0x36)[0] +e_phnum = struct.unpack_from("<H", hdr, 0x38)[0] +segs = [] +for i in range(e_phnum): + f.seek(e_phoff + i*e_phentsize) + ph = f.read(e_phentsize) + p_type, p_flags, p_offset, p_vaddr, p_paddr, p_filesz, p_memsz = struct.unpack_from("<IIQQQQQ", ph, 0) + if p_type == 1: + segs.append((p_vaddr, p_memsz, p_offset)) +for v, sz, off in segs: + if v <= VA < v+sz: + f.seek(off + (VA - v)) + d = f.read(min(N, v+sz-VA)) + sys.stdout.write(d.hex()) + break |
