Skip to content

Commit fc1abd4

Browse files
Anshuman Khandualctmarinas
authored andcommitted
arm64/mm: Drop cpu_set_[default|idmap]_tcr_t0sz()
These TCR_El1 helpers don't have any other callers. Drop these redundant indirections completely thus making this code more compact and readable. No functional change. Cc: Will Deacon <will@kernel.org> Cc: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com> Acked-by: Will Deacon <will@kernel.org> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
1 parent bf6b3fe commit fc1abd4

1 file changed

Lines changed: 2 additions & 10 deletions

File tree

arch/arm64/include/asm/mmu_context.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ static inline void cpu_switch_mm(pgd_t *pgd, struct mm_struct *mm)
6161
cpu_do_switch_mm(virt_to_phys(pgd),mm);
6262
}
6363

64-
/*
65-
* TCR.T0SZ value to use when the ID map is active.
66-
*/
67-
#define idmap_t0sz TCR_T0SZ(IDMAP_VA_BITS)
68-
6964
/*
7065
* Ensure TCR.T0SZ is set to the provided value.
7166
*/
@@ -82,9 +77,6 @@ static inline void __cpu_set_tcr_t0sz(unsigned long t0sz)
8277
isb();
8378
}
8479

85-
#define cpu_set_default_tcr_t0sz() __cpu_set_tcr_t0sz(TCR_T0SZ(vabits_actual))
86-
#define cpu_set_idmap_tcr_t0sz() __cpu_set_tcr_t0sz(idmap_t0sz)
87-
8880
/*
8981
* Remove the idmap from TTBR0_EL1 and install the pgd of the active mm.
9082
*
@@ -103,7 +95,7 @@ static inline void cpu_uninstall_idmap(void)
10395

10496
cpu_set_reserved_ttbr0();
10597
local_flush_tlb_all();
106-
cpu_set_default_tcr_t0sz();
98+
__cpu_set_tcr_t0sz(TCR_T0SZ(vabits_actual));
10799

108100
if (mm != &init_mm && !system_uses_ttbr0_pan())
109101
cpu_switch_mm(mm->pgd, mm);
@@ -113,7 +105,7 @@ static inline void cpu_install_idmap(void)
113105
{
114106
cpu_set_reserved_ttbr0();
115107
local_flush_tlb_all();
116-
cpu_set_idmap_tcr_t0sz();
108+
__cpu_set_tcr_t0sz(TCR_T0SZ(IDMAP_VA_BITS));
117109

118110
cpu_switch_mm(lm_alias(idmap_pg_dir), &init_mm);
119111
}

0 commit comments

Comments
 (0)