arm64: mm: avoid redundant __pa(__va(x))
authorMark Rutland <mark.rutland@arm.com>
Mon, 25 Jan 2016 11:45:05 +0000 (11:45 +0000)
committerAlex Shi <alex.shi@linaro.org>
Wed, 11 May 2016 14:19:13 +0000 (22:19 +0800)
commit6f74a379d1593fe728141747c6c594758cc5d328
tree0ab68c7ba43db5e87b1f3fcfd1834e4aa3f2be7e
parent77ea11473be30e0b90b32deb650b6403ad291a12
arm64: mm: avoid redundant __pa(__va(x))

When we "upgrade" to a section mapping, we free any table we made
redundant by giving it back to memblock. To get the PA, we acquire the
physical address and convert this to a VA, then subsequently convert
this back to a PA.

This works currently, but will not work if the tables are not accessed
via linear map VAs (e.g. is we use fixmap slots).

This patch uses {pmd,pud}_page_paddr to acquire the PA. This avoids the
__pa(__va()) round trip, saving some work and avoiding reliance on the
linear mapping.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Tested-by: Jeremy Linton <jeremy.linton@arm.com>
Cc: Laura Abbott <labbott@fedoraproject.org>
Cc: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 316b39db06718d59d82736df9fc65cf05b467cc7)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
arch/arm64/mm/mmu.c