Skip to contentSkip to conversation

riscv: Fix 32b kernel build with CONFIG_DEBUG_VIRTUAL=y

PATCH In review Alexandre Ghiti 2 participants 2 messages Apr 28, 2021 – Apr 29, 2021 RISC-V

lore
Share & tools
lore

Alexandre Ghiti

author reviewer
#0 lore raw

PATCH 1/1 riscv: Fix 32b kernel build with CONFIG_DEBUG_VIRTUAL=y

Declare kernel_virt_addr for 32b kernel since it is used in __phys_addr_symbol defined when CONFIG_DEBUG_VIRTUAL is set.

Fixes 2bfc6cd81bd17 ("riscv: Move kernel mapping outside of linear

mapping")

---
 arch/riscv/include/asm/page.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/include/asm/page.h +1 -1
index e280ba60cb34..6a7761c86ec2 100644
@@ -106,9 +106,9 @@ extern unsigned long pfn_base;
 #define ARCH_PFN_OFFSET		(PAGE_OFFSET >> PAGE_SHIFT)
 #endif /* CONFIG_MMU */
 
-#ifdef CONFIG_64BIT
 extern unsigned long kernel_virt_addr;
 
+#ifdef CONFIG_64BIT
 #define linear_mapping_pa_to_va(x)	((void *)((unsigned long)(x) + va_pa_offset))
 #ifdef CONFIG_XIP_KERNEL
 #define kernel_mapping_pa_to_va(y)	({						\
Signature · 1 line
2.20.1
maintainer
#1 lore raw
Quoted 15 lines · On Wed, 28 Apr 2021 03:02:17 PDT (-0700), [email protected] wrote:

Declare kernel_virt_addr for 32b kernel since it is used in __phys_addr_symbol defined when CONFIG_DEBUG_VIRTUAL is set.

Fixes 2bfc6cd81bd17 ("riscv: Move kernel mapping outside of linear

mapping")

---
 arch/riscv/include/asm/page.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/include/asm/page.h +0 -0
index e280ba60cb34..6a7761c86ec2 100644

arch/riscv/include/asm/page.h extern unsigned long pfn_base; · line 114

Quoted 10 lines
arch/riscv/include/asm/page.h +1 -1
@@ -106,9 +106,9 @@ extern unsigned long pfn_base;
 #define ARCH_PFN_OFFSET		(PAGE_OFFSET >> PAGE_SHIFT)
 #endif /* CONFIG_MMU */
 
-#ifdef CONFIG_64BIT
 extern unsigned long kernel_virt_addr;
 
+#ifdef CONFIG_64BIT
 #define linear_mapping_pa_to_va(x)	((void *)((unsigned long)(x) + va_pa_offset))
 #ifdef CONFIG_XIP_KERNEL
 #define kernel_mapping_pa_to_va(y)	({						\

Thanks, this is on for-next.