Skip to content

Commit 376f5a3

Browse files
ardbiesheuvelwilldeacon
authored andcommitted
arm64: mm: get rid of kimage_vaddr global variable
We store the address of _text in kimage_vaddr, but since commit 09e3c22 ("arm64: Use a variable to store non-global mappings decision"), we no longer reference this variable from modules so we no longer need to export it. In fact, we don't need it at all so let's just get rid of it. Acked-by: Mark Rutland <[email protected]> Signed-off-by: Ard Biesheuvel <[email protected]> Reviewed-by: Anshuman Khandual <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent a22fc8e commit 376f5a3

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

arch/arm64/include/asm/memory.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@
182182
#include <linux/types.h>
183183
#include <asm/boot.h>
184184
#include <asm/bug.h>
185+
#include <asm/sections.h>
185186

186187
#if VA_BITS > 48
187188
extern u64 vabits_actual;
@@ -193,15 +194,12 @@ extern s64 memstart_addr;
193194
/* PHYS_OFFSET - the physical address of the start of memory. */
194195
#define PHYS_OFFSET ({ VM_BUG_ON(memstart_addr & 1); memstart_addr; })
195196

196-
/* the virtual base of the kernel image */
197-
extern u64 kimage_vaddr;
198-
199197
/* the offset between the kernel virtual and physical mappings */
200198
extern u64 kimage_voffset;
201199

202200
static inline unsigned long kaslr_offset(void)
203201
{
204-
return kimage_vaddr - KIMAGE_VADDR;
202+
return (u64)&_text - KIMAGE_VADDR;
205203
}
206204

207205
#ifdef CONFIG_RANDOMIZE_BASE

arch/arm64/kernel/head.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -482,7 +482,7 @@ SYM_FUNC_START_LOCAL(__primary_switched)
482482

483483
str_l x21, __fdt_pointer, x5 // Save FDT pointer
484484

485-
ldr_l x4, kimage_vaddr // Save the offset between
485+
adrp x4, _text // Save the offset between
486486
sub x4, x4, x0 // the kernel virtual and
487487
str_l x4, kimage_voffset, x5 // physical mappings
488488

arch/arm64/mm/mmu.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,6 @@ u64 vabits_actual __ro_after_init = VA_BITS_MIN;
5252
EXPORT_SYMBOL(vabits_actual);
5353
#endif
5454

55-
u64 kimage_vaddr __ro_after_init = (u64)&_text;
56-
EXPORT_SYMBOL(kimage_vaddr);
57-
5855
u64 kimage_voffset __ro_after_init;
5956
EXPORT_SYMBOL(kimage_voffset);
6057

0 commit comments

Comments
 (0)