xen/arm: mmu: avoid transient mapping of page tables when a directmap is available
PATCH 1/1 xen/arm: mmu: avoid transient mapping of page tables when a directmap is available
--- xen/arch/arm/mmu/pt.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
xen/arch/arm/mmu/pt.c +11 -2
@@ -42,7 +42,11 @@ static lpae_t *xen_map_table(mfn_t mfn)if ( system_state == SYS_STATE_early_boot )return pmap_map (mfn); +#if defined(CONFIG_ARM_64 ) +return __va ((mfn_to_maddr (mfn))); +#else return map_domain_page (mfn); +#endif }static void xen_unmap_table (const lpae_t *table)
@@ -52,9 +56,14 @@ static void xen_unmap_table(const lpae_t *table)* but the PMAP. */ if ( system_state == SYS_STATE_early_boot ) + {pmap_unmap (table); -else -unmap_domain_page (table); +return ; + } + +#if !defined(CONFIG_ARM_64 ) +unmap_domain_page (table); +#endif } void dump_pt_walk(paddr_t ttbr, paddr_t addr,
Signature · 1 line
2.54.0
Quoted 3 lines · On 07.07.2026 00:29, mixx86 wrote:
--- xen/arch/arm/mmu/pt.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
First two formal things: There's no S-o-b of yours, and a change like this hardly can come with an empty description.
xen/arch/arm/mmu/pt.c static lpae_t *xen_map_table(mfn_t mfn) · line 50
Quoted 12 lines
xen/arch/arm/mmu/pt.c +4
-0@@ -42,7 +42,11 @@ static lpae_t *xen_map_table(mfn_t mfn)if ( system_state == SYS_STATE_early_boot )return pmap_map (mfn); +#if defined(CONFIG_ARM_64 ) +return __va ((mfn_to_maddr (mfn))); +#else return map_domain_page (mfn); +#endif }
The abstraction exists for a reason. If anything CONFIG_ARCH_MAP_DOMAIN_PAGE would be the correct dependency here (or else the pattern, if copied elsewhere, would break the MPU=y case), yet that already is what controls whether map_domain_page() is a mapping operation in the first place.
Plus - why would only this call site benefit? Any improvement should be done in map_domain_page() itself.
Jan