Closed osandov closed 1 month ago
@svens-s390 are you available to take a look at this? No rush at all and no worries if not.
The problem seems to be that drgn is trying to find swapper_pg_dir in the physical mappings - changing linux_kernel_pgtable_iterator_next_s390x() to read the page tables via the virtual address fixes this for me.
That was a much easier fix than I expected. Thanks for taking a look!
Before Linux 6.10, on s390x, kernel virtual addresses in the direct mapping were equal to physical addresses. This was changed in torvalds/linux@c98d2ecae08f02bd2dccd24e7e485e9f0211db65. This broke drgn's virtual address translation support for s390x. To reproduce (using emulation, so very slow):
If you have access to an s390x machine that you're willing to test on, something like this should reproduce it:
Here is the relevant code that needs to be updated: https://github.com/osandov/drgn/blob/7bbb7e6a9627c6e6f184d659b3fc88b33ddf5dd9/libdrgn/arch_s390x.c#L239-L465