diff options
author | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2022-08-09 11:38:45 +0100 |
---|---|---|
committer | Russell King (Oracle) <rmk+kernel@armlinux.org.uk> | 2024-01-08 12:32:56 +0000 |
commit | 8e9cb373d575562e31f98310961d4f71db56a98b (patch) | |
tree | 6e875e467a75d2fa4487d3f44521c797e066579d | |
parent | 0dd3ee31125508cd67f7e7172247f05b7fd1753a (diff) |
arm64: make __cpu_replace_ttbr1() take the page table physical address
Arrange for __cpu_replace_ttbr1() to take the physical address of the
page tables rather than the virtual page table pointer. This will allow
us to provide unique swapper page tables depending on the NUMA node.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
-rw-r--r-- | arch/arm64/include/asm/mmu_context.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h index 9ce4200508b1..9dc5c1844768 100644 --- a/arch/arm64/include/asm/mmu_context.h +++ b/arch/arm64/include/asm/mmu_context.h @@ -152,7 +152,8 @@ static inline void cpu_install_ttbr0(phys_addr_t ttbr0, unsigned long t0sz) * Atomically replaces the active TTBR1_EL1 PGD with a new VA-compatible PGD, * avoiding the possibility of conflicting TLB entries being allocated. */ -static inline void __cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap, bool cnp) +static inline void __cpu_replace_ttbr1(phys_addr_t pgd_phys, pgd_t *idmap, + bool cnp) { typedef void (ttbr_replace_func)(phys_addr_t); extern ttbr_replace_func idmap_cpu_replace_ttbr1; @@ -160,7 +161,7 @@ static inline void __cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap, bool cnp) unsigned long daif; /* phys_to_ttbr() zeros lower 2 bits of ttbr with 52-bit PA */ - phys_addr_t ttbr1 = phys_to_ttbr(virt_to_phys(pgdp)); + phys_addr_t ttbr1 = phys_to_ttbr(pgd_phys); if (cnp) ttbr1 |= TTBR_CNP_BIT; @@ -182,7 +183,8 @@ static inline void __cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap, bool cnp) static inline void cpu_enable_swapper_cnp(void) { - __cpu_replace_ttbr1(lm_alias(swapper_pg_dir), idmap_pg_dir, true); + __cpu_replace_ttbr1(virt_to_phys(lm_alias(swapper_pg_dir)), + idmap_pg_dir, true); } static inline void cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap) @@ -192,7 +194,7 @@ static inline void cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap) * before we've decided whether to use CNP. */ WARN_ON(system_capabilities_finalized()); - __cpu_replace_ttbr1(pgdp, idmap, false); + __cpu_replace_ttbr1(virt_to_phys(pgdp), idmap, false); } /* |