[PATCH v3 12/19] arm64: text replication: update cnp support

Hao Jia jiahao.os at bytedance.com
Wed Jan 17 00:53:50 PST 2024


From: "Russell King (Oracle)" <rmk+kernel at armlinux.org.uk>

Add changes for CNP (Common Not Private) support of kernel text
replication. Although text replication has only been tested on
dual-socket Ampere A1 systems, provided the different NUMA nodes
are not part of the same inner shareable domain, CNP should not
be a problem.

Signed-off-by: Russell King (Oracle) <rmk+kernel at armlinux.org.uk>
---
 arch/arm64/include/asm/mmu_context.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h
index 466797dcb5fc..4f78f4db5df4 100644
--- a/arch/arm64/include/asm/mmu_context.h
+++ b/arch/arm64/include/asm/mmu_context.h
@@ -187,7 +187,7 @@ static inline void __nocfi __cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap, bool c
 
 static inline void cpu_enable_swapper_cnp(void)
 {
-	__cpu_replace_ttbr1(lm_alias(swapper_pg_dir), idmap_pg_dir, true);
+	__cpu_replace_ttbr1_phys(swapper_pg_dir_node_phys(), idmap_pg_dir, true);
 }
 
 static inline void cpu_replace_ttbr1(pgd_t *pgdp, pgd_t *idmap)
-- 
2.20.1




More information about the linux-arm-kernel mailing list