I was writing a quick test when I noticed that arm's implementation of
__virt_to_phys(), which ends up calling virt_to_pte_phys(), doesn't handle
block mappings and returns a bogus value. When fixing it I got confused
about mmu_get_pte() and get_pte(), so I (hopefully) improved things by
renaming mmu_get_pte() to follow_pte().
Changes since v1:
- Dropped patch #1 ("lib/vmalloc: Treat virt_to_pte_phys() as returning a
physical address") because it was incorrect.
- Dropped the check for pte_valid() for the return value of mmu_get_pte() in
patch #1 because mmu_get_pte() returns NULL for an invalid descriptor.
Lightly tested on a rockpro64 (4k and 64k pages, arm64 and arm, qemu only)
because the changes from the previous version are trivial.
Alexandru Elisei (2):
arm/arm64: mmu: Teach virt_to_pte_phys() about block descriptors
arm/arm64: mmu: Rename mmu_get_pte() -> follow_pte()
lib/arm/asm/mmu-api.h | 2 +-
lib/arm/mmu.c | 88 +++++++++++++++++++++++++------------------
2 files changed, 53 insertions(+), 37 deletions(-)
--
2.37.0
_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm