@@ -159,7 +159,7 @@ static inline void cpu_replace_ttbr1_phys(phys_addr_t pgd_phys, pgd_t *idmap)
phys_addr_t ttbr1 = phys_to_ttbr(pgd_phys);
if (system_supports_cnp() &&
- !WARN_ON(pgd_phys != virt_to_phys(lm_alias(swapper_pg_dir)))) {
+ !WARN_ON(pgd_phys != swapper_pg_dir_node_phys())) {
/*
* cpu_replace_ttbr1() is used when there's a boot CPU
* up (i.e. cpufeature framework is not up yet) and
@@ -3341,7 +3341,7 @@ subsys_initcall_sync(init_32bit_el0_mask);
static void __maybe_unused cpu_enable_cnp(struct arm64_cpu_capabilities const *cap)
{
- cpu_replace_ttbr1(lm_alias(swapper_pg_dir), idmap_pg_dir);
+ cpu_replace_ttbr1_phys(swapper_pg_dir_node_phys(), idmap_pg_dir);
}
/*
@@ -55,7 +55,8 @@ void notrace __cpu_suspend_exit(void)
/* Restore CnP bit in TTBR1_EL1 */
if (system_supports_cnp())
- cpu_replace_ttbr1(lm_alias(swapper_pg_dir), idmap_pg_dir);
+ cpu_replace_ttbr1_phys(swapper_pg_dir_node_phys(),
+ idmap_pg_dir);
/*
* PSTATE was not saved over suspend/resume, re-enable any detected
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@armlinux.org.uk> --- arch/arm64/include/asm/mmu_context.h | 2 +- arch/arm64/kernel/cpufeature.c | 2 +- arch/arm64/kernel/suspend.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-)