riscv: make riscv build happier
Subsystems (2)
cover riscv: make riscv build happier
When add RISCV arch to huawei build test, there are some build issue, let's fix them to make riscv build happier :)
Those patches is rebased on next-20200508.
Kefeng Wang (10):
riscv: Fix unmet direct dependencies built based on SOC_VIRT
riscv: stacktrace: Fix undefined reference to `walk_stackframe'
riscv: Add pgprot_writecombine/device and PAGE_SHARED defination if
NOMMU
riscv: Fix print_vm_layout build error if NOMMU
riscv: Disable ARCH_HAS_DEBUG_WX if NOMMU
riscv: Disable ARCH_HAS_DEBUG_VIRTUAL if NOMMU
riscv: Make SYS_SUPPORTS_HUGETLBFS depends on MMU
riscv: pgtable: Fix __kernel_map_pages build error if NOMMU
timer-riscv: Fix undefined riscv_time_val
riscv: mmiowb: Fix implicit declaration of function 'smp_processor_id'
arch/riscv/Kconfig | 5 +++-- arch/riscv/Kconfig.socs | 17 +++++++++-------- arch/riscv/include/asm/mmio.h | 2 ++ arch/riscv/include/asm/mmiowb.h | 1 + arch/riscv/include/asm/pgtable.h | 3 +++ arch/riscv/kernel/stacktrace.c | 2 +- arch/riscv/mm/init.c | 2 +- drivers/clocksource/timer-riscv.c | 1 + 8 files changed, 21 insertions(+), 12 deletions(-)
Signature · 1 line
2.26.2
PATCH 1/10 riscv: Fix unmet direct dependencies built based on SOC_VIRT
Fix unmet direct dependencies Warning and fix Kconfig indent.
WARNING: unmet direct dependencies detected for POWER_RESET_SYSCON
Depends on [n]: POWER_RESET [=n] && OF [=y] && HAS_IOMEM [=y] Selected by [y]:
- SOC_VIRT [=y]
WARNING: unmet direct dependencies detected for POWER_RESET_SYSCON_POWEROFF
Depends on [n]: POWER_RESET [=n] && OF [=y] && HAS_IOMEM [=y] Selected by [y]:
- SOC_VIRT [=y]
WARNING: unmet direct dependencies detected for RTC_DRV_GOLDFISH
Depends on [n]: RTC_CLASS [=n] && OF [=y] && HAS_IOMEM [=y] && (GOLDFISH [=y] || COMPILE_TEST [=n]) Selected by [y]:
- SOC_VIRT [=y]
--- arch/riscv/Kconfig.socs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
arch/riscv/Kconfig.socs +9 -8
@@ -11,14 +11,15 @@ config SOC_SIFIVE This enables support for SiFive SoC platform hardware. config SOC_VIRT - bool "QEMU Virt Machine" - select POWER_RESET_SYSCON - select POWER_RESET_SYSCON_POWEROFF - select GOLDFISH - select RTC_DRV_GOLDFISH - select SIFIVE_PLIC - help - This enables support for QEMU Virt Machine. + bool "QEMU Virt Machine" + select POWER_RESET + select POWER_RESET_SYSCON + select POWER_RESET_SYSCON_POWEROFF + select GOLDFISH + select RTC_DRV_GOLDFISH if RTC_CLASS + select SIFIVE_PLIC + help + This enables support for QEMU Virt Machine. config SOC_KENDRYTE bool "Kendryte K210 SoC"
Signature · 1 line
2.26.2
Palmer Dabbelt
maintainerRe: [PATCH 01/10] riscv: Fix unmet direct dependencies built based on SOC_VIRT
Quoted 41 lines · On Sun, 10 May 2020 19:19:52 PDT (-0700), [email protected] wrote:
Fix unmet direct dependencies Warning and fix
Kconfigindent.WARNING: unmet direct dependencies detected for
POWER_RESET_SYSCON
Depends on [n]:POWER_RESET[=n] && OF [=y] &&HAS_IOMEM[=y] Selected by [y]:
-SOC_VIRT[=y]WARNING: unmet direct dependencies detected for
POWER_RESET_SYSCON_POWEROFF
Depends on [n]:POWER_RESET[=n] && OF [=y] &&HAS_IOMEM[=y] Selected by [y]:
-SOC_VIRT[=y]WARNING: unmet direct dependencies detected for
RTC_DRV_GOLDFISH
Depends on [n]:RTC_CLASS[=n] && OF [=y] &&HAS_IOMEM[=y] && (GOLDFISH [=y] ||COMPILE_TEST[=n]) Selected by [y]:
-SOC_VIRT[=y]Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>--- arch/riscv/Kconfig.socs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)arch/riscv/Kconfig.socs +2
-8@@ -11,14 +11,15 @@ config SOC_SIFIVE This enables support for SiFive SoC platform hardware. config SOC_VIRT - bool "QEMU Virt Machine" - select POWER_RESET_SYSCON - select POWER_RESET_SYSCON_POWEROFF - select GOLDFISH - select RTC_DRV_GOLDFISH - select SIFIVE_PLIC - help - This enables support for QEMU Virt Machine. + bool "QEMU Virt Machine" + select POWER_RESET
arch/riscv/Kconfig.socs config SOC_SIFIVE · line 25
Quoted 10 lines
arch/riscv/Kconfig.socs +7
-0+ select POWER_RESET_SYSCON + select POWER_RESET_SYSCON_POWEROFF + select GOLDFISH + select RTC_DRV_GOLDFISH if RTC_CLASS + select SIFIVE_PLIC + help + This enables support for QEMU Virt Machine. config SOC_KENDRYTE bool "Kendryte K210 SoC"
This is another area we need to clean up (maybe converting from select to imply?), but given this fixes likely build errors I'm going to take it onto fixes.
Thanks!
PATCH 2/10 riscv: stacktrace: Fix undefined reference to `walk_stackframe'
In reply to Kefeng WangDrop static declaration to fix following build error if FRAME_POINTER disabled,
riscv64-linux-ld: arch/riscv/kernel/perf_callchain.o: in function `.L0':
perf_callchain.c:(.text+0x2b8): undefined reference to `walk_stackframe'
--- arch/riscv/kernel/stacktrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/kernel/stacktrace.c +1 -1
@@ -65,7 +65,7 @@ void notrace walk_stackframe(struct task_struct *task, struct pt_regs *regs,#else /* !CONFIG_FRAME_POINTER */ -static void notrace walk_stackframe(struct task_struct *task, +void notrace walk_stackframe(struct task_struct *task,struct pt_regs *regs,bool (*fn)(unsigned long ,void *),void *arg) {unsigned long sp, pc;
Signature · 1 line
2.26.2
PATCH 3/10 riscv: Add pgprot_writecombine/device and PAGE_SHARED defination if NOMMU
In reply to Kefeng WangSome drivers use PAGE_SHARED, pgprot_writecombine()/pgprot_device(), add the defination to fix build error if NOMMU.
--- arch/riscv/include/asm/mmio.h | 2 ++ arch/riscv/include/asm/pgtable.h | 1 + 2 files changed, 3 insertions(+)
arch/riscv/include/asm/mmio.h +2 -0
@@ -16,6 +16,8 @@#ifndef CONFIG_MMU #define pgprot_noncached (x) (x) +#define pgprot_writecombine (x) (x) +#define pgprot_device (x) (x)#endif /* CONFIG_MMU */ /* Generic IO read/write. These perform native-endian accesses. */
arch/riscv/include/asm/pgtable.h +1 -0
@@ -470,6 +470,7 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,#else /* CONFIG_MMU */ +#define PAGE_SHARED __pgprot(0)#define PAGE_KERNEL __pgprot(0)#define swapper_pg_dir NULL#define TASK_SIZE 0xffffffffUL
Signature · 1 line
2.26.2
PATCH 4/10 riscv: Fix print_vm_layout build error if NOMMU
In reply to Kefeng Wangarch/riscv/mm/init.c: In function ‘print_vm_layout’:arch/riscv/mm/init.c:68:37: error: ‘FIXADDR_START’ undeclared (first use in this function); arch/riscv/mm/init.c:69:20: error: ‘FIXADDR_TOP’ undeclared arch/riscv/mm/init.c:70:37: error: ‘PCI_IO_START’ undeclared arch/riscv/mm/init.c:71:20: error: ‘PCI_IO_END’ undeclared arch/riscv/mm/init.c:72:38: error: ‘VMEMMAP_START’ undeclared arch/riscv/mm/init.c:73:20: error: ‘VMEMMAP_END’ undeclared (first use in this function);
--- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/mm/init.c +1 -1
@@ -49,7 +49,7 @@ static void setup_zero_page(void)memset ((void *)empty_zero_page,0 ,PAGE_SIZE ); } -#ifdef CONFIG_DEBUG_VM +#if defined(CONFIG_MMU ) && defined(DEBUG_VM )static inline void print_mlk (char *name,unsigned long b,unsigned long t) { pr_notice("%12s : 0x%08lx - 0x%08lx (%4ld kB)\n", name, b, t,
Signature · 1 line
2.26.2
Alex Ghiti
reviewerRe: [PATCH 04/10] riscv: Fix print_vm_layout build error if NOMMU
Hi,
Quoted 19 lines · Kefeng Wang
arch/riscv/mm/init.c: In function ‘print_vm_layout’:arch/riscv/mm/init.c:68:37: error: ‘FIXADDR_START’ undeclared (first use in this function);arch/riscv/mm/init.c:69:20: error: ‘FIXADDR_TOP’ undeclaredarch/riscv/mm/init.c:70:37: error: ‘PCI_IO_START’ undeclaredarch/riscv/mm/init.c:71:20: error: ‘PCI_IO_END’ undeclaredarch/riscv/mm/init.c:72:38: error: ‘VMEMMAP_START’ undeclaredarch/riscv/mm/init.c:73:20: error: ‘VMEMMAP_END’ undeclared (first use in this function);Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>--- arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/mm/init.c +0
-0
arch/riscv/mm/init.c static void setup_zero_page(void) · line 52
Quoted 5 lines
arch/riscv/mm/init.c +1
-1@@ -49,7 +49,7 @@ static void setup_zero_page(void)memset ((void *)empty_zero_page,0 ,PAGE_SIZE ); } -#ifdef CONFIG_DEBUG_VM +#if defined(CONFIG_MMU ) && defined(DEBUG_VM )
Shouldn't it be CONFIG_DEBUG_VM ?
arch/riscv/mm/init.c static void setup_zero_page(void) · line 55
Quoted 3 lines
arch/riscv/mm/init.c +0
-0static inline void print_mlk (char *name,unsigned long b,unsigned long t) { pr_notice("%12s : 0x%08lx - 0x%08lx (%4ld kB)\n", name, b, t,
Alex
Re: [PATCH 04/10] riscv: Fix print_vm_layout build error if NOMMU
Quoted 17 lines · Alex Ghiti
Hi,
Quoted 14 lines · Kefeng Wang
arch/riscv/mm/init.c: In function ‘print_vm_layout’:arch/riscv/mm/init.c:68:37: error: ‘FIXADDR_START’ undeclared (first use in this function);arch/riscv/mm/init.c:69:20: error: ‘FIXADDR_TOP’ undeclaredarch/riscv/mm/init.c:70:37: error: ‘PCI_IO_START’ undeclaredarch/riscv/mm/init.c:71:20: error: ‘PCI_IO_END’ undeclaredarch/riscv/mm/init.c:72:38: error: ‘VMEMMAP_START’ undeclaredarch/riscv/mm/init.c:73:20: error: ‘VMEMMAP_END’ undeclared (first use in this function);Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
arch/riscv/mm/init.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines
Quoted 9 lines
arch/riscv/mm/init.c +0
-0@@ -49,7 +49,7 @@ static void setup_zero_page(void) memset((void *)empty_zero_page, 0, PAGE_SIZE); }-#ifdef
CONFIG_DEBUG_VM
+#ifdefined(CONFIG_MMU)&&defined(DEBUG_VM)Shouldn't it be
CONFIG_DEBUG_VM?
oops, should be CONFIG_DEBUG_VM, will send v2, thanks.
Quoted 12 lines
Quoted 5 lines
static inline void
print_mlk(char *name, unsigned long b, unsigned long t){
pr_notice("%12s : 0x%08lx - 0x%08lx (%4ld kB)\n", name, b, t,Alex
.
PATCH v2 1/1 riscv: Fix print_vm_layout build error if NOMMU
In reply to Kefeng Wangarch/riscv/mm/init.c: In function ‘print_vm_layout’:arch/riscv/mm/init.c:68:37: error: ‘FIXADDR_START’ undeclared (first use in this function); arch/riscv/mm/init.c:69:20: error: ‘FIXADDR_TOP’ undeclared arch/riscv/mm/init.c:70:37: error: ‘PCI_IO_START’ undeclared arch/riscv/mm/init.c:71:20: error: ‘PCI_IO_END’ undeclared arch/riscv/mm/init.c:72:38: error: ‘VMEMMAP_START’ undeclared arch/riscv/mm/init.c:73:20: error: ‘VMEMMAP_END’ undeclared (first use in this function);
---
v2:
- Should CONFIG_DEBUG_VM instead of DEBUG_VM
- Based on riscv fixes branch
arch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/mm/init.c +1 -1
@@ -47,7 +47,7 @@ static void setup_zero_page(void)memset ((void *)empty_zero_page,0 ,PAGE_SIZE ); } -#ifdef CONFIG_DEBUG_VM +#if defined(CONFIG_MMU ) && defined(CONFIG_DEBUG_VM )static inline void print_mlk (char *name,unsigned long b,unsigned long t) { pr_notice("%12s : 0x%08lx - 0x%08lx (%4ld kB)\n", name, b, t,
Signature · 1 line
2.26.2
Palmer Dabbelt
maintainerRe: [PATCH v2] riscv: Fix print_vm_layout build error if NOMMU
Quoted 23 lines · On Thu, 14 May 2020 04:53:35 PDT (-0700), [email protected] wrote:
arch/riscv/mm/init.c: In function ‘print_vm_layout’:arch/riscv/mm/init.c:68:37: error: ‘FIXADDR_START’ undeclared (first use in this function);arch/riscv/mm/init.c:69:20: error: ‘FIXADDR_TOP’ undeclaredarch/riscv/mm/init.c:70:37: error: ‘PCI_IO_START’ undeclaredarch/riscv/mm/init.c:71:20: error: ‘PCI_IO_END’ undeclaredarch/riscv/mm/init.c:72:38: error: ‘VMEMMAP_START’ undeclaredarch/riscv/mm/init.c:73:20: error: ‘VMEMMAP_END’ undeclared (first use in this function);Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
v2:
- ShouldCONFIG_DEBUG_VMinstead ofDEBUG_VM
- Based on riscv fixes brancharch/riscv/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/mm/init.c +0
-0
arch/riscv/mm/init.c static void setup_zero_page(void) · line 53
Quoted 8 lines
arch/riscv/mm/init.c +1
-1@@ -47,7 +47,7 @@ static void setup_zero_page(void)memset ((void *)empty_zero_page,0 ,PAGE_SIZE ); } -#ifdef CONFIG_DEBUG_VM +#if defined(CONFIG_MMU ) && defined(CONFIG_DEBUG_VM )static inline void print_mlk (char *name,unsigned long b,unsigned long t) { pr_notice("%12s : 0x%08lx - 0x%08lx (%4ld kB)\n", name, b, t,
Thanks, this is on fixes.
PATCH 5/10 riscv: Disable ARCH_HAS_DEBUG_WX if NOMMU
In reply to Kefeng WangDEBUG_WX is only useful when MMU enabled, diable it if nommu and fix the build error.
--- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/Kconfig +1 -1
@@ -69,7 +69,7 @@ config RISCV select HAVE_ARCH_KASAN if MMU && 64BIT select HAVE_ARCH_KGDB select HAVE_ARCH_KGDB_QXFER_PKT - select ARCH_HAS_DEBUG_WX + select ARCH_HAS_DEBUG_WX if MMU config ARCH_MMAP_RND_BITS_MIN default 18 if 64BIT
Signature · 1 line
2.26.2
Palmer Dabbelt
maintainerRe: [PATCH 05/10] riscv: Disable ARCH_HAS_DEBUG_WX if NOMMU
Quoted 14 lines · On Sun, 10 May 2020 19:19:56 PDT (-0700), [email protected] wrote:
DEBUG_WXis only useful when MMU enabled, diable it if nommu and fix the build error.Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>--- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/Kconfig +0
-0
arch/riscv/Kconfig config RISCV · line 75
Quoted 8 lines
arch/riscv/Kconfig +1
-1@@ -69,7 +69,7 @@ config RISCV select HAVE_ARCH_KASAN if MMU && 64BIT select HAVE_ARCH_KGDB select HAVE_ARCH_KGDB_QXFER_PKT - select ARCH_HAS_DEBUG_WX + select ARCH_HAS_DEBUG_WX if MMU config ARCH_MMAP_RND_BITS_MIN default 18 if 64BIT
Looks like this depends on something that isn't in any of my trees yet.
Re: [PATCH 05/10] riscv: Disable ARCH_HAS_DEBUG_WX if NOMMU
Quoted 21 lines · Palmer Dabbelt
Quoted 20 lines · On Sun, 10 May 2020 19:19:56 PDT (-0700), [email protected] wrote:
DEBUG_WXis only useful when MMU enabled, diable it if nommu and fix the build error.Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
arch/riscv/Kconfig | 2 +-1 file changed, 1 insertion(+), 1 deletion(-)arch/riscv/Kconfig +0
-0@@ -69,7 +69,7 @@ config RISCVselect
HAVE_ARCH_KASANif MMU && 64BIT
selectHAVE_ARCH_KGDB
selectHAVE_ARCH_KGDB_QXFER_PKT
- selectARCH_HAS_DEBUG_WX
+ selectARCH_HAS_DEBUG_WXif MMU
Quoted 4 lines
Quoted 2 lines
config
ARCH_MMAP_RND_BITS_MIN
default 18 if 64BITLooks like this depends on something that isn't in any of my trees yet.
as said in cover letter, the patch is based on linux-next, tag next-20200508 :)
Quoted 2 lines
PATCH 6/10 riscv: Disable ARCH_HAS_DEBUG_VIRTUAL if NOMMU
In reply to Kefeng WangDEBUG_VIRTUAL should only used when MMU enabled, add the dependence.
--- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/Kconfig +1 -1
@@ -53,7 +53,7 @@ config RISCV select GENERIC_ARCH_TOPOLOGY if SMP select ARCH_HAS_PTE_SPECIAL select ARCH_HAS_MMIOWB - select ARCH_HAS_DEBUG_VIRTUAL + select ARCH_HAS_DEBUG_VIRTUAL if MMU select HAVE_EBPF_JIT if MMU select EDAC_SUPPORT select ARCH_HAS_GIGANTIC_PAGE
Signature · 1 line
2.26.2
PATCH 7/10 riscv: Make SYS_SUPPORTS_HUGETLBFS depends on MMU
In reply to Kefeng WangHUGETLBFS only used when MMU enabled, add the dependence.
--- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/riscv/Kconfig +1 -0
@@ -138,6 +138,7 @@ config ARCH_SUPPORTS_DEBUG_PAGEALLOC def_bool y config SYS_SUPPORTS_HUGETLBFS + depends on MMU def_bool y config STACKTRACE_SUPPORT
Signature · 1 line
2.26.2
Palmer Dabbelt
maintainerRe: [PATCH 07/10] riscv: Make SYS_SUPPORTS_HUGETLBFS depends on MMU
Quoted 13 lines · On Sun, 10 May 2020 19:19:58 PDT (-0700), [email protected] wrote:
HUGETLBFS only used when MMU enabled, add the dependence.
Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>--- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+)arch/riscv/Kconfig +0
-0
arch/riscv/Kconfig config ARCH_SUPPORTS_DEBUG_PAGEALLOC · line 142
Quoted 5 lines
arch/riscv/Kconfig +1
-0@@ -138,6 +138,7 @@ config ARCH_SUPPORTS_DEBUG_PAGEALLOC def_bool y config SYS_SUPPORTS_HUGETLBFS + depends on MMU def_bool y
I don't think this is the right way to do this: there's nothing specific to the RISC-V implementation that makes HUGETLBFS depend on MMU. That said, SH appears to do it this way so I'm OK taking this for now.
Quoted 2 lines
arch/riscv/Kconfig +0
-0config STACKTRACE_SUPPORT
PATCH 8/10 riscv: pgtable: Fix __kernel_map_pages build error if NOMMU
In reply to Kefeng Wangriscv64-none-linux-gnu-ld: mm/page_alloc.o: in function `.L0 ':
page_alloc.c:(.text+0xd34): undefined reference to `__kernel_map_pages'
riscv64-none-linux-gnu-ld: page_alloc.c:(.text+0x104a): undefined reference to `__kernel_map_pages'
riscv64-none-linux-gnu-ld: mm/page_alloc.o: in function `__pageblock_pfn_to_page':
page_alloc.c:(.text+0x145e): undefined reference to `__kernel_map_pages'
--- arch/riscv/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+)
arch/riscv/include/asm/pgtable.h +2 -0
@@ -477,6 +477,8 @@ static inline int ptep_clear_flush_young(struct vm_area_struct *vma,#define VMALLOC_START 0#define VMALLOC_END TASK_SIZE +static inline void __kernel_map_pages (struct page *page,int numpages,int enable) {} +#endif /* !CONFIG_MMU */ #define kern_addr_valid (addr) (1)/* FIXME */
Signature · 1 line
2.26.2
PATCH 9/10 timer-riscv: Fix undefined riscv_time_val
In reply to Kefeng WangERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
--- drivers/clocksource/timer-riscv.c | 1 + 1 file changed, 1 insertion(+)
drivers/clocksource/timer-riscv.c +1 -0
@@ -19,6 +19,7 @@u64 __iomem *riscv_time_cmp;u64 __iomem *riscv_time_val; +EXPORT_SYMBOL (riscv_time_val);static inline void mmio_set_timer (u64 val) {
Signature · 1 line
2.26.2
Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
Quoted 13 lines · On Sun, 10 May 2020 19:20:00 PDT (-0700), [email protected] wrote:
ERROR: modpost: "
riscv_time_val" [crypto/tcrypt.ko] undefined!Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>--- drivers/clocksource/timer-riscv.c | 1 + 1 file changed, 1 insertion(+)drivers/clocksource/timer-riscv.c +0
-0
drivers/clocksource/timer-riscv.c line 25
Quoted 7 lines
drivers/clocksource/timer-riscv.c +1
-0@@ -19,6 +19,7 @@u64 __iomem *riscv_time_cmp;u64 __iomem *riscv_time_val; +EXPORT_SYMBOL (riscv_time_val);static inline void mmio_set_timer (u64 val) {
Adding the clocksource maintainers. Let me know if you want this through my tree, I'm assuming you want it through your tree.
Thanks!
Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
Quoted 26 lines · Palmer Dabbelt
Quoted 14 lines · On Sun, 10 May 2020 19:20:00 PDT (-0700), [email protected] wrote:
ERROR: modpost: "
riscv_time_val" [crypto/tcrypt.ko] undefined!Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
drivers/clocksource/timer-riscv.c | 1 +1 file changed, 1 insertion(+)drivers/clocksource/timer-riscv.c +0
-0drivers/clocksource/timer-riscv.c line 25
Quoted 7 lines
drivers/clocksource/timer-riscv.c +1
-0@@ -19,6 +19,7 @@ u64 __iomem *riscv_time_cmp; u64 __iomem *riscv_time_val; +EXPORT_SYMBOL (riscv_time_val); static inline void mmio_set_timer(u64 val) {Reviewed-by Palmer Dabbelt <[email protected]>Acked-by Palmer Dabbelt <[email protected]>
Quoted 3 lines
Adding the clocksource maintainers. Let me know if you want this through my
tree, I'm assuming you want it through your tree.
How can we end up by an export symbol here ?!
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
Quoted 26 lines · Daniel Lezcano
Quoted 25 lines · Palmer Dabbelt
Quoted 14 lines · On Sun, 10 May 2020 19:20:00 PDT (-0700), [email protected] wrote:
ERROR: modpost: "
riscv_time_val" [crypto/tcrypt.ko] undefined!Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>--- drivers/clocksource/timer-riscv.c | 1 + 1 file changed, 1 insertion(+)drivers/clocksource/timer-riscv.c +0
-0drivers/clocksource/timer-riscv.c line 25
Quoted 7 lines
drivers/clocksource/timer-riscv.c +1
-0@@ -19,6 +19,7 @@ u64 __iomem *riscv_time_cmp; u64 __iomem *riscv_time_val; +EXPORT_SYMBOL (riscv_time_val); static inline void mmio_set_timer(u64 val) {Reviewed-by Palmer Dabbelt <[email protected]>Acked-by Palmer Dabbelt <[email protected]>
Quoted 4 lines
Quoted 3 lines
Adding the clocksource maintainers. Let me know if you want this through my
tree, I'm assuming you want it through your tree.How can we end up by an export symbol here ?!
Hi Danile,
Found this build error when CONFIG_RISCV_M_MODE=y and CONFIG_RISCV_SBI is not,
see patch "4f9bbcefa142 riscv: add support for MMIO access to the timer registers"
thanks.
Quoted 2 lines
Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
Hi Kefeng,
Quoted 29 lines · Kefeng Wang
Quoted 27 lines · Daniel Lezcano
Quoted 26 lines · Palmer Dabbelt
Quoted 14 lines · On Sun, 10 May 2020 19:20:00 PDT (-0700), [email protected] wrote:
ERROR: modpost: "
riscv_time_val" [crypto/tcrypt.ko] undefined!Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
drivers/clocksource/timer-riscv.c | 1 +1 file changed, 1 insertion(+)drivers/clocksource/timer-riscv.c +0
-0drivers/clocksource/timer-riscv.c line 25
Quoted 7 lines
drivers/clocksource/timer-riscv.c +1
-0@@ -19,6 +19,7 @@ u64 __iomem *riscv_time_cmp; u64 __iomem *riscv_time_val; +EXPORT_SYMBOL (riscv_time_val); static inline void mmio_set_timer(u64 val) {Reviewed-by Palmer Dabbelt <[email protected]>Acked-by Palmer Dabbelt <[email protected]>
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Adding the clocksource maintainers. Let me know if you want this through my
tree, I'm assuming you want it through your tree.How can we end up by an export symbol here ?!
Hi Danile,
s/Danile/Daniel/
Quoted 5 lines
Found this build error when
CONFIG_RISCV_M_MODE=yandCONFIG_RISCV_SBIis not,see patch "
4f9bbcefa142riscv: add support for MMIO access to the timer registers"
Thanks for the pointer.
The question still remains, how do we end up with this EXPORT_SYMBOL?
There is something wrong if the fix is an EXPORT_SYMBOL for a global variable.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
Quoted 31 lines · Daniel Lezcano
Hi Kefeng,
Quoted 28 lines · Kefeng Wang
Quoted 27 lines · Daniel Lezcano
Quoted 26 lines · Palmer Dabbelt
Quoted 14 lines · On Sun, 10 May 2020 19:20:00 PDT (-0700), [email protected] wrote:
ERROR: modpost: "
riscv_time_val" [crypto/tcrypt.ko] undefined!Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>--- drivers/clocksource/timer-riscv.c | 1 + 1 file changed, 1 insertion(+)drivers/clocksource/timer-riscv.c +0
-0drivers/clocksource/timer-riscv.c line 25
Quoted 7 lines
drivers/clocksource/timer-riscv.c +1
-0@@ -19,6 +19,7 @@ u64 __iomem *riscv_time_cmp; u64 __iomem *riscv_time_val; +EXPORT_SYMBOL (riscv_time_val); static inline void mmio_set_timer(u64 val) {Reviewed-by Palmer Dabbelt <[email protected]>Acked-by Palmer Dabbelt <[email protected]>
Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines
Adding the clocksource maintainers. Let me know if you want this through my
tree, I'm assuming you want it through your tree.How can we end up by an export symbol here ?!
Hi Danile,
s/Danile/Daniel/
Sorry for typing error.
Quoted 4 lines
Quoted 4 lines
Found this build error when
CONFIG_RISCV_M_MODE=yandCONFIG_RISCV_SBIis not,
Quoted 8 lines
Quoted 2 lines
see patch "
4f9bbcefa142riscv: add support for MMIO access to the timer registers"Thanks for the pointer.
The question still remains, how do we end up with this
EXPORT_SYMBOL?There is something wrong if the fix is an
EXPORT_SYMBOLfor a global variable.
Not very clear, there are some global variable( eg, acpi_disabled, memstart_addr in arm64,) is exported by EXPORT_SYMBOL, do you mean that export riscv_time_val is wrong way?
Quoted 3 lines
Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
Quoted 48 lines · Kefeng Wang
Quoted 31 lines · Daniel Lezcano
Hi Kefeng,
Quoted 28 lines · Kefeng Wang
Quoted 27 lines · Daniel Lezcano
Quoted 26 lines · Palmer Dabbelt
Quoted 14 lines · On Sun, 10 May 2020 19:20:00 PDT (-0700), [email protected] wrote:
ERROR: modpost: "
riscv_time_val" [crypto/tcrypt.ko] undefined!Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>---
drivers/clocksource/timer-riscv.c | 1 +1 file changed, 1 insertion(+)drivers/clocksource/timer-riscv.c +0
-0drivers/clocksource/timer-riscv.c line 25
Quoted 7 lines
drivers/clocksource/timer-riscv.c +1
-0@@ -19,6 +19,7 @@ u64 __iomem *riscv_time_cmp; u64 __iomem *riscv_time_val; +EXPORT_SYMBOL (riscv_time_val); static inline void mmio_set_timer(u64 val) {Reviewed-by Palmer Dabbelt <[email protected]>Acked-by Palmer Dabbelt <[email protected]>Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines
Adding the clocksource maintainers. Let me know if you want this through my
tree, I'm assuming you want it through your tree.How can we end up by an export symbol here ?!
Hi Danile,
s/Danile/Daniel/
Sorry for typing error.
Quoted 8 lines
Quoted 6 lines
Found this build error when
CONFIG_RISCV_M_MODE=yandCONFIG_RISCV_SBIis not,see patch "
4f9bbcefa142riscv: add support for MMIO access to the timer registers"Thanks for the pointer.
Quoted 8 lines
Quoted 4 lines
The question still remains, how do we end up with this
EXPORT_SYMBOL?There is something wrong if the fix is an
EXPORT_SYMBOLfor a global variable.Not very clear, there are some global
variable( eg, acpi_disabled, memstart_addr in arm64,)is exported by EXPORT_SYMBOL, do you mean that exportriscv_time_valis wrong way?
I do not maintain acpi neither arm64.mm.
AFAICT, riscv_time_val is globally declared indrivers/clocksource/timer-riscv.c
The driver does not use this variable at all. Then there is a readl on it in the header file arch/riscv/include/asm/timex.h
And finally it is initialized in arch/riscv/kernel/clint.c
Same thing for riscv_time_cmp.
The correct fix is to initialize the variables in the place where they belong to (drivers/clocksource/timer-riscv.c), create a function to read their content and export-symbol-gpl the function.
Signature · 5 lines
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook | <http://twitter.com/#!/linaroorg> Twitter | <http://www.linaro.org/linaro-blog/> Blog
Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
Quoted 67 lines · Daniel Lezcano
Quoted 48 lines · Kefeng Wang
Quoted 31 lines · Daniel Lezcano
Hi Kefeng,
Quoted 28 lines · Kefeng Wang
Quoted 27 lines · Daniel Lezcano
Quoted 26 lines · Palmer Dabbelt
Quoted 14 lines · On Sun, 10 May 2020 19:20:00 PDT (-0700), [email protected] wrote:
ERROR: modpost: "
riscv_time_val" [crypto/tcrypt.ko] undefined!Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>--- drivers/clocksource/timer-riscv.c | 1 + 1 file changed, 1 insertion(+)drivers/clocksource/timer-riscv.c +0
-0drivers/clocksource/timer-riscv.c line 25
Quoted 7 lines
drivers/clocksource/timer-riscv.c +1
-0@@ -19,6 +19,7 @@u64 __iomem *riscv_time_cmp;u64 __iomem *riscv_time_val; +EXPORT_SYMBOL (riscv_time_val);static inline void mmio_set_timer (u64 val) {Reviewed-by Palmer Dabbelt <[email protected]>Acked-by Palmer Dabbelt <[email protected]>Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines
Adding the clocksource maintainers. Let me know if you want this through my
tree, I'm assuming you want it through your tree.How can we end up by an export symbol here ?!
Hi Danile,
s/Danile/Daniel/
Sorry for typing error.
Quoted 8 lines
Quoted 6 lines
Found this build error when
CONFIG_RISCV_M_MODE=yandCONFIG_RISCV_SBIis not,see patch "
4f9bbcefa142riscv: add support for MMIO access to the timer registers"Thanks for the pointer.
Quoted 8 lines
Quoted 4 lines
The question still remains, how do we end up with this
EXPORT_SYMBOL?There is something wrong if the fix is an
EXPORT_SYMBOLfor a global variable.Not very clear, there are some global
variable( eg, acpi_disabled, memstart_addr in arm64,)is exported byEXPORT_SYMBOL, do you mean that exportriscv_time_valis wrong way?I do not maintain acpi neither arm64.mm.
AFAICT,
riscv_time_valis globally declared indrivers/clocksource/timer-riscv.cThe driver does not use this variable at all. Then there is a readl on it in the header file
arch/riscv/include/asm/timex.h
Quoted 7 lines
And finally it is initialized in
arch/riscv/kernel/clint.cSame thing for
riscv_time_cmp.The correct fix is to initialize the variables in the place where they belong to (
drivers/clocksource/timer-riscv.c), create a function to read their content and export-symbol-gpl the function.
I agree with Daniel. Exporting riscv_time_val is a temporary fix.
The problem is timer-riscv.c is pretty convoluted right now. It is implementing two different clocksources and clockevents in one-place.
I think we need two separate drivers for RISC-V world.
1. timer-riscv: This for regular S-mode kernel with MMU. The clocksource will use TIME CSR and the clockevent device will use SBI calls.
2. timer-clint: This for M-mode kernel without MMU (or NoMMU kernel). The clocksource will use MMIO counter for clocksource and the clockevent device will use MMIO compare registers.
I will send a patch to have a separate timer-clint driver under drivers/clocksource. (@Daniel, I hope you will be fine with this?)
Regards,
Anup
Quoted 8 lines
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCsFollow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
Quoted 64 lines · Anup Patel
Quoted 62 lines · Daniel Lezcano
Quoted 46 lines · Kefeng Wang
Quoted 31 lines · Daniel Lezcano
Hi Kefeng,
Quoted 28 lines · Kefeng Wang
Quoted 27 lines · Daniel Lezcano
Quoted 26 lines · Palmer Dabbelt
Quoted 14 lines · On Sun, 10 May 2020 19:20:00 PDT (-0700), [email protected] wrote:
ERROR: modpost: "
riscv_time_val" [crypto/tcrypt.ko] undefined!Reported-by Hulk Robot <[email protected]>Signed-off-by Kefeng Wang <[email protected]>--- drivers/clocksource/timer-riscv.c | 1 + 1 file changed, 1 insertion(+)drivers/clocksource/timer-riscv.c +0
-0drivers/clocksource/timer-riscv.c line 25
Quoted 7 lines
drivers/clocksource/timer-riscv.c +1
-0@@ -19,6 +19,7 @@u64 __iomem *riscv_time_cmp;u64 __iomem *riscv_time_val; +EXPORT_SYMBOL (riscv_time_val);static inline void mmio_set_timer (u64 val) {Reviewed-by Palmer Dabbelt <[email protected]>Acked-by Palmer Dabbelt <[email protected]>Quoted 6 lines
Quoted 5 lines
Quoted 4 lines
Quoted 3 lines
Adding the clocksource maintainers. Let me know if you want this through my
tree, I'm assuming you want it through your tree.How can we end up by an export symbol here ?!
Hi Danile,
s/Danile/Daniel/
Sorry for typing error.
Quoted 7 lines
Quoted 5 lines
Found this build error when
CONFIG_RISCV_M_MODE=yandCONFIG_RISCV_SBIis not,see patch "
4f9bbcefa142riscv: add support for MMIO access to the timer registers"Thanks for the pointer.
Quoted 7 lines
Quoted 4 lines
The question still remains, how do we end up with this
EXPORT_SYMBOL?There is something wrong if the fix is an
EXPORT_SYMBOLfor a global variable.Not very clear, there are some global
variable( eg, acpi_disabled, memstart_addr in arm64,)is exported byEXPORT_SYMBOL, do you mean that exportriscv_time_valis wrong way?I do not maintain acpi neither arm64.mm.
AFAICT,
riscv_time_valis globally declared indrivers/clocksource/timer-riscv.cThe driver does not use this variable at all. Then there is a readl on it in the header file
arch/riscv/include/asm/timex.h
Quoted 7 lines
Quoted 7 lines
And finally it is initialized in
arch/riscv/kernel/clint.cSame thing for
riscv_time_cmp.The correct fix is to initialize the variables in the place where they belong to (
drivers/clocksource/timer-riscv.c), create a function to read their content and export-symbol-gpl the function.
ok, it's better. thanks for your explanation.
Quoted 1 line
I agree with Daniel. Exporting
riscv_time_valis a temporary fix.
yes. it's only for build, let's wait for Anup's patch.
Quoted 27 lines
The problem is
timer-riscv.cis pretty convoluted right now. It is implementing two different clocksources and clockevents in one-place.I think we need two separate drivers for RISC-V world.
1. timer-riscv: This for regular S-mode kernel with MMU. The clocksource will use TIME CSR and the clockevent device will use SBI calls.
2. timer-clint: This for M-mode kernel without MMU (or NoMMU kernel). The clocksource will use MMIO counter for clocksource and the clockevent device will use MMIO compare registers.
I will send a patch to have a separate timer-clint driver under
drivers/clocksource. (@Daniel, I hope you will be fine with this?) Regards,
AnupQuoted 7 lines
--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCsFollow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog.
PATCH 10/10 riscv: mmiowb: Fix implicit declaration of function 'smp_processor_id'
In reply to Kefeng WangIn file included from ./../include/linux/compiler_types.h:68,
from <command-line>:../include/asm-generic/mmiowb.h: In function ‘mmiowb_set_pending’:../include/asm-generic/percpu.h:34:38: error: implicit declaration of function ‘smp_processor_id’; did you mean ‘raw_smp_processor_id’? [-Werror=implicit-function-declaration]
#define my_cpu_offset per_cpu_offset(smp_processor_id())
^~~~~~~~~~~~~~~~
../include/linux/compiler-gcc.h:58:26: note: in definition of macro ‘RELOC_HIDE’
(typeof(ptr)) (__ptr + (off)); \
^~~../include/linux/percpu-defs.h:249:2: note: in expansion of macro ‘SHIFT_PERCPU_PTR’
SHIFT_PERCPU_PTR(ptr, my_cpu_offset); \
^~~~~~~~~~~~~~~~../include/asm-generic/percpu.h:34:23: note: in expansion of macro ‘per_cpu_offset’
#define my_cpu_offset per_cpu_offset(smp_processor_id())
^~~~~~~~~~~~~~
../include/linux/percpu-defs.h:249:24: note: in expansion of macro ‘my_cpu_offset’
SHIFT_PERCPU_PTR(ptr, my_cpu_offset); \
^~~~~~~~~~~~~
../include/asm-generic/mmiowb.h:30:26: note: in expansion of macro ‘this_cpu_ptr’
#define __mmiowb_state() this_cpu_ptr(&__mmiowb_state)
^~~~~~~~~~~~
../include/asm-generic/mmiowb.h:37:28: note: in expansion of macro ‘__mmiowb_state’
struct mmiowb_state *ms = __mmiowb_state();
^~~~~~~~~~~~~~--- arch/riscv/include/asm/mmiowb.h | 1 + 1 file changed, 1 insertion(+)
arch/riscv/include/asm/mmiowb.h +1 -0
@@ -9,6 +9,7 @@*/ #define mmiowb () __asm__ __volatile__ ("fence o,w" : : : "memory"); +#include <linux/smp.h> #include <asm-generic/mmiowb.h> #endif /* _ASM_RISCV_MMIOWB_H */
Signature · 1 line
2.26.2
Palmer Dabbelt
maintainerQuoted 18 lines · On Sun, 10 May 2020 19:19:51 PDT (-0700), [email protected] wrote:
When add RISCV arch to huawei build test, there are some build issue, let's fix them to make riscv build happier :)
Those patches is rebased on next-20200508.
Kefeng Wang (10):
riscv: Fix unmet direct dependencies built based onSOC_VIRT
riscv: stacktrace: Fix undefined reference to `walk_stackframe'
riscv: Add pgprot_writecombine/device andPAGE_SHAREDdefination if
NOMMU
riscv: Fixprint_vm_layoutbuild error if NOMMU
riscv: DisableARCH_HAS_DEBUG_WXif NOMMU
riscv: DisableARCH_HAS_DEBUG_VIRTUALif NOMMU
riscv: MakeSYS_SUPPORTS_HUGETLBFSdepends on MMU
riscv: pgtable: Fix__kernel_map_pagesbuild error if NOMMU
timer-riscv: Fix undefinedriscv_time_val
riscv: mmiowb: Fix implicit declaration of function 'smp_processor_id'
Quoted 9 lines
arch/riscv/Kconfig | 5 +++-- arch/riscv/Kconfig.socs | 17 +++++++++-------- arch/riscv/include/asm/mmio.h | 2 ++ arch/riscv/include/asm/mmiowb.h | 1 + arch/riscv/include/asm/pgtable.h | 3 +++ arch/riscv/kernel/stacktrace.c | 2 +- arch/riscv/mm/init.c | 2 +- drivers/clocksource/timer-riscv.c | 1 + 8 files changed, 21 insertions(+), 12 deletions(-)
Unless I said otherwise in the patch reviews, these are all on fixes.
Thanks!