diff options
author | Will Deacon <will.deacon@arm.com> | 2018-01-29 12:59:59 +0100 |
---|---|---|
committer | Catalin Marinas <catalin.marinas@arm.com> | 2018-02-06 23:53:25 +0100 |
commit | 79ddab3b05ca903f552fd5bf920efa055210322b (patch) | |
tree | d90a4fd72906039f62177ba4f1707afbc01b97ae /arch/arm64/include | |
parent | arm64: entry: Reword comment about post_ttbr_update_workaround (diff) | |
download | linux-79ddab3b05ca903f552fd5bf920efa055210322b.tar.xz linux-79ddab3b05ca903f552fd5bf920efa055210322b.zip |
arm64: assembler: Align phys_to_pte with pte_to_phys
pte_to_phys lives in assembler.h and takes its destination register as
the first argument. Move phys_to_pte out of head.S to sit with its
counterpart and rejig it to follow the same calling convention.
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/include')
-rw-r--r-- | arch/arm64/include/asm/assembler.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 47555f632ffd..544878a9f29e 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -523,6 +523,19 @@ alternative_endif #endif .endm + .macro phys_to_pte, pte, phys +#ifdef CONFIG_ARM64_PA_BITS_52 + /* + * We assume \phys is 64K aligned and this is guaranteed by only + * supporting this configuration with 64K pages. + */ + orr \pte, \phys, \phys, lsr #36 + and \pte, \pte, #PTE_ADDR_MASK +#else + mov \pte, \phys +#endif + .endm + .macro pte_to_phys, phys, pte #ifdef CONFIG_ARM64_PA_BITS_52 ubfiz \phys, \pte, #(48 - 16 - 12), #16 |