Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libdrgn: x86_64: avoid recursive address translation for swapper_pg_dir
Most core dumps contain some virtual address mappings: usually at a minimum, the kernel's direct map is represented in ELF vmcores via a segment. So normally, drgn can rely on the vmcore to read the virtual address of swapper_pg_dir. However, some vmcores only contain physical address information, so when drgn reads memory at swapper_pg_dir, it needs to first translate that address, thus causing a recursive translation error like below: >>> prog["slab_caches"] Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/stepbren/repos/drgn/drgn/cli.py", line 141, in _displayhook text = value.format_(columns=shutil.get_terminal_size((0, 0)).columns) _drgn.FaultError: recursive address translation; page table may be missing from core dump: 0xffffffff9662aff8 Debuggers like crash, as well as libkdumpfile, contain fallback code which can translate swapper_pg_dir in order to bootstrap this address translation. In fact, the above error does not occur in drgn when using libkdumpfile. So, let's add this fallback case to drgn as well. Other architectures will need to have equivalent support added. Co-authored-by: Illia Ostapyshyn <[email protected]> Signed-off-by: Stephen Brennan <[email protected]>
- Loading branch information