diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2022-06-24 17:06:46 +0200 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2022-06-24 17:18:10 +0100 |
commit | c0be8f18a3bfcfd369eba21337e6c89a4bb8b0e8 (patch) | |
tree | 68737da76c2b6a3b60ce405dae34b76f58be9533 /arch/arm64/include/asm/assembler.h | |
parent | a004393f45d9a55e55d76f252914bdddffdde204 (diff) | |
download | linux-c0be8f18a3bfcfd369eba21337e6c89a4bb8b0e8.tar.gz linux-c0be8f18a3bfcfd369eba21337e6c89a4bb8b0e8.tar.bz2 linux-c0be8f18a3bfcfd369eba21337e6c89a4bb8b0e8.zip |
arm64: head: factor out TTBR1 assignment into a macro
Create a macro load_ttbr1 to avoid having to repeat the same instruction
sequence 3 times in a subsequent patch. No functional change intended.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20220624150651.1358849-17-ardb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
Diffstat (limited to 'arch/arm64/include/asm/assembler.h')
-rw-r--r-- | arch/arm64/include/asm/assembler.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/arch/arm64/include/asm/assembler.h b/arch/arm64/include/asm/assembler.h index 9468f45c07a6..b2584709c332 100644 --- a/arch/arm64/include/asm/assembler.h +++ b/arch/arm64/include/asm/assembler.h @@ -480,6 +480,18 @@ alternative_endif .endm /* + * load_ttbr1 - install @pgtbl as a TTBR1 page table + * pgtbl preserved + * tmp1/tmp2 clobbered, either may overlap with pgtbl + */ + .macro load_ttbr1, pgtbl, tmp1, tmp2 + phys_to_ttbr \tmp1, \pgtbl + offset_ttbr1 \tmp1, \tmp2 + msr ttbr1_el1, \tmp1 + isb + .endm + +/* * To prevent the possibility of old and new partial table walks being visible * in the tlb, switch the ttbr to a zero page when we invalidate the old * records. D4.7.1 'General TLB maintenance requirements' in ARM DDI 0487A.i @@ -492,10 +504,7 @@ alternative_endif isb tlbi vmalle1 dsb nsh - phys_to_ttbr \tmp, \page_table - offset_ttbr1 \tmp, \tmp2 - msr ttbr1_el1, \tmp - isb + load_ttbr1 \page_table, \tmp, \tmp2 .endm /* |