Skip to content

Commit fb31f0a

Browse files
Kenneth Leepalmer-dabbelt
authored andcommitted
riscv: fix the global name pfn_base confliction error
RISCV uses a global variable pfn_base for page/pfn translation. But this is a common name and will be used elsewhere. In those cases, the page-pfn macros which refer to this name will be referred to the local/input variable instead. (such as in vfio_pin_pages_remote). This make everything wrong. This patch changes the name from pfn_base to riscv_pfn_base to fix this problem. Signed-off-by: Kenneth Lee <[email protected]> Signed-off-by: Palmer Dabbelt <[email protected]>
1 parent fe45ffa commit fb31f0a

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

arch/riscv/include/asm/page.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ typedef struct page *pgtable_t;
7979
#endif
8080

8181
#ifdef CONFIG_MMU
82-
extern unsigned long pfn_base;
83-
#define ARCH_PFN_OFFSET (pfn_base)
82+
extern unsigned long riscv_pfn_base;
83+
#define ARCH_PFN_OFFSET (riscv_pfn_base)
8484
#else
8585
#define ARCH_PFN_OFFSET (PAGE_OFFSET >> PAGE_SHIFT)
8686
#endif /* CONFIG_MMU */

arch/riscv/mm/init.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,8 @@ static struct pt_alloc_ops _pt_ops __initdata;
214214
#define pt_ops _pt_ops
215215
#endif
216216

217-
unsigned long pfn_base __ro_after_init;
218-
EXPORT_SYMBOL(pfn_base);
217+
unsigned long riscv_pfn_base __ro_after_init;
218+
EXPORT_SYMBOL(riscv_pfn_base);
219219

220220
pgd_t swapper_pg_dir[PTRS_PER_PGD] __page_aligned_bss;
221221
pgd_t trampoline_pg_dir[PTRS_PER_PGD] __page_aligned_bss;
@@ -587,7 +587,7 @@ asmlinkage void __init setup_vm(uintptr_t dtb_pa)
587587
kernel_map.va_pa_offset = PAGE_OFFSET - kernel_map.phys_addr;
588588
kernel_map.va_kernel_pa_offset = kernel_map.virt_addr - kernel_map.phys_addr;
589589

590-
pfn_base = PFN_DOWN(kernel_map.phys_addr);
590+
riscv_pfn_base = PFN_DOWN(kernel_map.phys_addr);
591591

592592
/* Sanity check alignment and size */
593593
BUG_ON((PAGE_OFFSET % PGDIR_SIZE) != 0);

0 commit comments

Comments
 (0)