Skip to content

Commit ac51e00

Browse files
zongboxpaul-walmsley-sifive
authored andcommitted
riscv: mm: use __pa_symbol for kernel symbols
__pa_symbol is the marcro that should be used for kernel symbols. It is also a pre-requisite for DEBUG_VIRTUAL which will do bounds checking. Signed-off-by: Zong Li <[email protected]> Reviewed-by: Anup Patel <[email protected]> Signed-off-by: Paul Walmsley <[email protected]>
1 parent fd69884 commit ac51e00

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

arch/riscv/mm/init.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,13 @@ static void __init setup_initrd(void)
9999
pr_info("initrd not found or empty");
100100
goto disable;
101101
}
102-
if (__pa(initrd_end) > PFN_PHYS(max_low_pfn)) {
102+
if (__pa_symbol(initrd_end) > PFN_PHYS(max_low_pfn)) {
103103
pr_err("initrd extends beyond end of memory");
104104
goto disable;
105105
}
106106

107107
size = initrd_end - initrd_start;
108-
memblock_reserve(__pa(initrd_start), size);
108+
memblock_reserve(__pa_symbol(initrd_start), size);
109109
initrd_below_start_ok = 1;
110110

111111
pr_info("Initial ramdisk at: 0x%p (%lu bytes)\n",
@@ -124,8 +124,8 @@ void __init setup_bootmem(void)
124124
{
125125
struct memblock_region *reg;
126126
phys_addr_t mem_size = 0;
127-
phys_addr_t vmlinux_end = __pa(&_end);
128-
phys_addr_t vmlinux_start = __pa(&_start);
127+
phys_addr_t vmlinux_end = __pa_symbol(&_end);
128+
phys_addr_t vmlinux_start = __pa_symbol(&_start);
129129

130130
/* Find the memory region containing the kernel */
131131
for_each_memblock(memory, reg) {
@@ -445,7 +445,7 @@ static void __init setup_vm_final(void)
445445

446446
/* Setup swapper PGD for fixmap */
447447
create_pgd_mapping(swapper_pg_dir, FIXADDR_START,
448-
__pa(fixmap_pgd_next),
448+
__pa_symbol(fixmap_pgd_next),
449449
PGDIR_SIZE, PAGE_TABLE);
450450

451451
/* Map all memory banks */
@@ -474,7 +474,7 @@ static void __init setup_vm_final(void)
474474
clear_fixmap(FIX_PMD);
475475

476476
/* Move to swapper page table */
477-
csr_write(CSR_SATP, PFN_DOWN(__pa(swapper_pg_dir)) | SATP_MODE);
477+
csr_write(CSR_SATP, PFN_DOWN(__pa_symbol(swapper_pg_dir)) | SATP_MODE);
478478
local_flush_tlb_all();
479479
}
480480
#else

0 commit comments

Comments
 (0)