arm64: mm: add __{pud,pgd}_populate
authorMark Rutland <mark.rutland@arm.com>
Mon, 25 Jan 2016 11:45:06 +0000 (11:45 +0000)
committerAlex Shi <alex.shi@linaro.org>
Fri, 11 Nov 2016 08:40:25 +0000 (16:40 +0800)
commitcae587548c55fc9cdc54d8e85950ae733cd10b37
treedcbf7dec2e0db450599f2ad63db312b82d8e9164
parentde93e05ca12346af8ebe2af155d21bb24cd98c94
arm64: mm: add __{pud,pgd}_populate

We currently have __pmd_populate for creating a pmd table entry given
the physical address of a pte, but don't have equivalents for the pud or
pgd levels of table.

To enable us to manipulate tables which are mapped outside of the linear
mapping (where we have a PA, but not a linear map VA), it is useful to
have these functions.

This patch adds __{pud,pgd}_populate. As these should not be called when
the kernel uses folded {pmd,pud}s, in these cases they expand to
BUILD_BUG(). So long as the appropriate checks are made on the {pud,pgd}
entry prior to attempting population, these should be optimized out at
compile time.

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 1e531cce68c92b46c7d29f36a72f9a3e5886678f)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
arch/arm64/include/asm/pgalloc.h