diff options
author | Steve Capper <steve.capper@arm.com> | 2019-08-07 11:55:23 -0400 |
---|---|---|
committer | Will Deacon <will@kernel.org> | 2019-08-09 06:17:27 -0400 |
commit | 2c624fe68715e76eba1a7089f91e122310dc663c (patch) | |
tree | 8e7baf645975ea9c609c47d6e4e5a1f28cac4001 | |
parent | b6d00d47e81a49f6cf462518c10408f37a3e6785 (diff) |
arm64: mm: Remove vabits_user
Previous patches have enabled 52-bit kernel + user VAs and there is no
longer any scenario where user VA != kernel VA size.
This patch removes the, now redundant, vabits_user variable and replaces
usage with vabits_actual where appropriate.
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Steve Capper <steve.capper@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
-rw-r--r-- | arch/arm64/include/asm/memory.h | 3 | ||||
-rw-r--r-- | arch/arm64/include/asm/pointer_auth.h | 2 | ||||
-rw-r--r-- | arch/arm64/include/asm/processor.h | 2 | ||||
-rw-r--r-- | arch/arm64/kernel/head.S | 7 | ||||
-rw-r--r-- | arch/arm64/mm/fault.c | 3 | ||||
-rw-r--r-- | arch/arm64/mm/mmu.c | 2 | ||||
-rw-r--r-- | arch/arm64/mm/proc.S | 2 |
7 files changed, 5 insertions, 16 deletions
diff --git a/arch/arm64/include/asm/memory.h b/arch/arm64/include/asm/memory.h index d911d0573460..ecc945ba8607 100644 --- a/arch/arm64/include/asm/memory.h +++ b/arch/arm64/include/asm/memory.h | |||
@@ -194,9 +194,6 @@ static inline unsigned long kaslr_offset(void) | |||
194 | return kimage_vaddr - KIMAGE_VADDR; | 194 | return kimage_vaddr - KIMAGE_VADDR; |
195 | } | 195 | } |
196 | 196 | ||
197 | /* the actual size of a user virtual address */ | ||
198 | extern u64 vabits_user; | ||
199 | |||
200 | /* | 197 | /* |
201 | * Allow all memory at the discovery stage. We will clip it later. | 198 | * Allow all memory at the discovery stage. We will clip it later. |
202 | */ | 199 | */ |
diff --git a/arch/arm64/include/asm/pointer_auth.h b/arch/arm64/include/asm/pointer_auth.h index d328540cb85e..7a24bad1a58b 100644 --- a/arch/arm64/include/asm/pointer_auth.h +++ b/arch/arm64/include/asm/pointer_auth.h | |||
@@ -69,7 +69,7 @@ extern int ptrauth_prctl_reset_keys(struct task_struct *tsk, unsigned long arg); | |||
69 | * The EL0 pointer bits used by a pointer authentication code. | 69 | * The EL0 pointer bits used by a pointer authentication code. |
70 | * This is dependent on TBI0 being enabled, or bits 63:56 would also apply. | 70 | * This is dependent on TBI0 being enabled, or bits 63:56 would also apply. |
71 | */ | 71 | */ |
72 | #define ptrauth_user_pac_mask() GENMASK(54, vabits_user) | 72 | #define ptrauth_user_pac_mask() GENMASK(54, vabits_actual) |
73 | 73 | ||
74 | /* Only valid for EL0 TTBR0 instruction pointers */ | 74 | /* Only valid for EL0 TTBR0 instruction pointers */ |
75 | static inline unsigned long ptrauth_strip_insn_pac(unsigned long ptr) | 75 | static inline unsigned long ptrauth_strip_insn_pac(unsigned long ptr) |
diff --git a/arch/arm64/include/asm/processor.h b/arch/arm64/include/asm/processor.h index 0e1f2770192a..e4c93945e477 100644 --- a/arch/arm64/include/asm/processor.h +++ b/arch/arm64/include/asm/processor.h | |||
@@ -43,7 +43,7 @@ | |||
43 | */ | 43 | */ |
44 | 44 | ||
45 | #define DEFAULT_MAP_WINDOW_64 (UL(1) << VA_BITS_MIN) | 45 | #define DEFAULT_MAP_WINDOW_64 (UL(1) << VA_BITS_MIN) |
46 | #define TASK_SIZE_64 (UL(1) << vabits_user) | 46 | #define TASK_SIZE_64 (UL(1) << vabits_actual) |
47 | 47 | ||
48 | #ifdef CONFIG_COMPAT | 48 | #ifdef CONFIG_COMPAT |
49 | #if defined(CONFIG_ARM64_64K_PAGES) && defined(CONFIG_KUSER_HELPERS) | 49 | #if defined(CONFIG_ARM64_64K_PAGES) && defined(CONFIG_KUSER_HELPERS) |
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S index c8446f8c81f5..949b001a73bb 100644 --- a/arch/arm64/kernel/head.S +++ b/arch/arm64/kernel/head.S | |||
@@ -316,11 +316,6 @@ __create_page_tables: | |||
316 | #endif | 316 | #endif |
317 | mov x5, #VA_BITS_MIN | 317 | mov x5, #VA_BITS_MIN |
318 | 1: | 318 | 1: |
319 | adr_l x6, vabits_user | ||
320 | str x5, [x6] | ||
321 | dmb sy | ||
322 | dc ivac, x6 // Invalidate potentially stale cache line | ||
323 | |||
324 | adr_l x6, vabits_actual | 319 | adr_l x6, vabits_actual |
325 | str x5, [x6] | 320 | str x5, [x6] |
326 | dmb sy | 321 | dmb sy |
@@ -795,7 +790,7 @@ ENDPROC(__enable_mmu) | |||
795 | 790 | ||
796 | ENTRY(__cpu_secondary_check52bitva) | 791 | ENTRY(__cpu_secondary_check52bitva) |
797 | #ifdef CONFIG_ARM64_VA_BITS_52 | 792 | #ifdef CONFIG_ARM64_VA_BITS_52 |
798 | ldr_l x0, vabits_user | 793 | ldr_l x0, vabits_actual |
799 | cmp x0, #52 | 794 | cmp x0, #52 |
800 | b.ne 2f | 795 | b.ne 2f |
801 | 796 | ||
diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index 6b195871769a..75eff57bd9ef 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c | |||
@@ -140,8 +140,7 @@ static void show_pte(unsigned long addr) | |||
140 | 140 | ||
141 | pr_alert("%s pgtable: %luk pages, %llu-bit VAs, pgdp=%016lx\n", | 141 | pr_alert("%s pgtable: %luk pages, %llu-bit VAs, pgdp=%016lx\n", |
142 | mm == &init_mm ? "swapper" : "user", PAGE_SIZE / SZ_1K, | 142 | mm == &init_mm ? "swapper" : "user", PAGE_SIZE / SZ_1K, |
143 | mm == &init_mm ? vabits_actual : (int)vabits_user, | 143 | vabits_actual, (unsigned long)virt_to_phys(mm->pgd)); |
144 | (unsigned long)virt_to_phys(mm->pgd)); | ||
145 | pgdp = pgd_offset(mm, addr); | 144 | pgdp = pgd_offset(mm, addr); |
146 | pgd = READ_ONCE(*pgdp); | 145 | pgd = READ_ONCE(*pgdp); |
147 | pr_alert("[%016lx] pgd=%016llx", addr, pgd_val(pgd)); | 146 | pr_alert("[%016lx] pgd=%016llx", addr, pgd_val(pgd)); |
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 07b30e6d17f8..0c8f7e55f859 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c | |||
@@ -40,8 +40,6 @@ | |||
40 | 40 | ||
41 | u64 idmap_t0sz = TCR_T0SZ(VA_BITS); | 41 | u64 idmap_t0sz = TCR_T0SZ(VA_BITS); |
42 | u64 idmap_ptrs_per_pgd = PTRS_PER_PGD; | 42 | u64 idmap_ptrs_per_pgd = PTRS_PER_PGD; |
43 | u64 vabits_user __ro_after_init; | ||
44 | EXPORT_SYMBOL(vabits_user); | ||
45 | 43 | ||
46 | u64 __section(".mmuoff.data.write") vabits_actual; | 44 | u64 __section(".mmuoff.data.write") vabits_actual; |
47 | EXPORT_SYMBOL(vabits_actual); | 45 | EXPORT_SYMBOL(vabits_actual); |
diff --git a/arch/arm64/mm/proc.S b/arch/arm64/mm/proc.S index 8b021c5c0884..391f9cabfe60 100644 --- a/arch/arm64/mm/proc.S +++ b/arch/arm64/mm/proc.S | |||
@@ -439,7 +439,7 @@ ENTRY(__cpu_setup) | |||
439 | tcr_clear_errata_bits x10, x9, x5 | 439 | tcr_clear_errata_bits x10, x9, x5 |
440 | 440 | ||
441 | #ifdef CONFIG_ARM64_VA_BITS_52 | 441 | #ifdef CONFIG_ARM64_VA_BITS_52 |
442 | ldr_l x9, vabits_user | 442 | ldr_l x9, vabits_actual |
443 | sub x9, xzr, x9 | 443 | sub x9, xzr, x9 |
444 | add x9, x9, #64 | 444 | add x9, x9, #64 |
445 | tcr_set_t1sz x10, x9 | 445 | tcr_set_t1sz x10, x9 |