All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] riscv: make riscv build happier
@ 2020-05-11  2:19 Kefeng Wang
  2020-05-11  2:19   ` Kefeng Wang
                   ` (10 more replies)
  0 siblings, 11 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Kefeng Wang

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(-)

-- 
2.26.2


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH 01/10] riscv: Fix unmet direct dependencies built based on SOC_VIRT
  2020-05-11  2:19 [PATCH 00/10] riscv: make riscv build happier Kefeng Wang
@ 2020-05-11  2:19   ` Kefeng Wang
  2020-05-11  2:19   ` Kefeng Wang
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Kefeng Wang, Hulk Robot

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]

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/Kconfig.socs | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
index 4b2303ca20b9..6c88148f1b9b 100644
--- a/arch/riscv/Kconfig.socs
+++ b/arch/riscv/Kconfig.socs
@@ -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"
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 01/10] riscv: Fix unmet direct dependencies built based on SOC_VIRT
@ 2020-05-11  2:19   ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Hulk Robot, Kefeng Wang

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]

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/Kconfig.socs | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
index 4b2303ca20b9..6c88148f1b9b 100644
--- a/arch/riscv/Kconfig.socs
+++ b/arch/riscv/Kconfig.socs
@@ -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"
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 02/10] riscv: stacktrace: Fix undefined reference to `walk_stackframe'
  2020-05-11  2:19 [PATCH 00/10] riscv: make riscv build happier Kefeng Wang
@ 2020-05-11  2:19   ` Kefeng Wang
  2020-05-11  2:19   ` Kefeng Wang
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Kefeng Wang, Hulk Robot

Drop 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'

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/kernel/stacktrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
index 38141a3c70f7..595342910c3f 100644
--- a/arch/riscv/kernel/stacktrace.c
+++ b/arch/riscv/kernel/stacktrace.c
@@ -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;
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 02/10] riscv: stacktrace: Fix undefined reference to `walk_stackframe'
@ 2020-05-11  2:19   ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Hulk Robot, Kefeng Wang

Drop 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'

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/kernel/stacktrace.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
index 38141a3c70f7..595342910c3f 100644
--- a/arch/riscv/kernel/stacktrace.c
+++ b/arch/riscv/kernel/stacktrace.c
@@ -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;
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 03/10] riscv: Add pgprot_writecombine/device and PAGE_SHARED defination if NOMMU
  2020-05-11  2:19 [PATCH 00/10] riscv: make riscv build happier Kefeng Wang
@ 2020-05-11  2:19   ` Kefeng Wang
  2020-05-11  2:19   ` Kefeng Wang
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Kefeng Wang, Hulk Robot

Some drivers use PAGE_SHARED, pgprot_writecombine()/pgprot_device(),
add the defination to fix build error if NOMMU.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/include/asm/mmio.h    | 2 ++
 arch/riscv/include/asm/pgtable.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/arch/riscv/include/asm/mmio.h b/arch/riscv/include/asm/mmio.h
index a2c809df2733..56053c9838b2 100644
--- a/arch/riscv/include/asm/mmio.h
+++ b/arch/riscv/include/asm/mmio.h
@@ -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. */
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index 780dd1d4f720..a12d343e080a 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -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
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 03/10] riscv: Add pgprot_writecombine/device and PAGE_SHARED defination if NOMMU
@ 2020-05-11  2:19   ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Hulk Robot, Kefeng Wang

Some drivers use PAGE_SHARED, pgprot_writecombine()/pgprot_device(),
add the defination to fix build error if NOMMU.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/include/asm/mmio.h    | 2 ++
 arch/riscv/include/asm/pgtable.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/arch/riscv/include/asm/mmio.h b/arch/riscv/include/asm/mmio.h
index a2c809df2733..56053c9838b2 100644
--- a/arch/riscv/include/asm/mmio.h
+++ b/arch/riscv/include/asm/mmio.h
@@ -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. */
diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index 780dd1d4f720..a12d343e080a 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -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
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 04/10] riscv: Fix print_vm_layout build error if NOMMU
  2020-05-11  2:19 [PATCH 00/10] riscv: make riscv build happier Kefeng Wang
@ 2020-05-11  2:19   ` Kefeng Wang
  2020-05-11  2:19   ` Kefeng Wang
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Kefeng Wang, Hulk Robot

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’ 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);

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index dfcaebc3928f..58c39c44b9c9 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -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,
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 04/10] riscv: Fix print_vm_layout build error if NOMMU
@ 2020-05-11  2:19   ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Hulk Robot, 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’ 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);

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/mm/init.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index dfcaebc3928f..58c39c44b9c9 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -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,
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 05/10] riscv: Disable ARCH_HAS_DEBUG_WX if NOMMU
  2020-05-11  2:19 [PATCH 00/10] riscv: make riscv build happier Kefeng Wang
@ 2020-05-11  2:19   ` Kefeng Wang
  2020-05-11  2:19   ` Kefeng Wang
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Kefeng Wang, Hulk Robot

DEBUG_WX is only useful when MMU enabled, diable it if nommu
and fix the build error.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 78f30f2fdd51..7da0a36a8df0 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -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
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 05/10] riscv: Disable ARCH_HAS_DEBUG_WX if NOMMU
@ 2020-05-11  2:19   ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Hulk Robot, Kefeng Wang

DEBUG_WX is only useful when MMU enabled, diable it if nommu
and fix the build error.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 78f30f2fdd51..7da0a36a8df0 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -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
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 06/10] riscv: Disable ARCH_HAS_DEBUG_VIRTUAL if NOMMU
  2020-05-11  2:19 [PATCH 00/10] riscv: make riscv build happier Kefeng Wang
                   ` (4 preceding siblings ...)
  2020-05-11  2:19   ` Kefeng Wang
@ 2020-05-11  2:19 ` Kefeng Wang
  2020-05-11  2:19   ` Kefeng Wang
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Kefeng Wang

DEBUG_VIRTUAL should only used when MMU enabled, add the dependence.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 7da0a36a8df0..494e670520ae 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -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
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 07/10] riscv: Make SYS_SUPPORTS_HUGETLBFS depends on MMU
  2020-05-11  2:19 [PATCH 00/10] riscv: make riscv build happier Kefeng Wang
@ 2020-05-11  2:19   ` Kefeng Wang
  2020-05-11  2:19   ` Kefeng Wang
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Kefeng Wang, Hulk Robot

HUGETLBFS only used when MMU enabled, add the dependence.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 494e670520ae..d0010ed8e0f4 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -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
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 07/10] riscv: Make SYS_SUPPORTS_HUGETLBFS depends on MMU
@ 2020-05-11  2:19   ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Hulk Robot, Kefeng Wang

HUGETLBFS only used when MMU enabled, add the dependence.

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index 494e670520ae..d0010ed8e0f4 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -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
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 08/10] riscv: pgtable: Fix __kernel_map_pages build error if NOMMU
  2020-05-11  2:19 [PATCH 00/10] riscv: make riscv build happier Kefeng Wang
@ 2020-05-11  2:19   ` Kefeng Wang
  2020-05-11  2:19   ` Kefeng Wang
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Kefeng Wang, Hulk Robot

riscv64-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'

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/include/asm/pgtable.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index a12d343e080a..d50706ea1c94 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -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 */
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 08/10] riscv: pgtable: Fix __kernel_map_pages build error if NOMMU
@ 2020-05-11  2:19   ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:19 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Hulk Robot, Kefeng Wang

riscv64-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'

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/include/asm/pgtable.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h
index a12d343e080a..d50706ea1c94 100644
--- a/arch/riscv/include/asm/pgtable.h
+++ b/arch/riscv/include/asm/pgtable.h
@@ -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 */
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
  2020-05-11  2:19 [PATCH 00/10] riscv: make riscv build happier Kefeng Wang
@ 2020-05-11  2:20   ` Kefeng Wang
  2020-05-11  2:19   ` Kefeng Wang
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:20 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Kefeng Wang, Hulk Robot

ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 drivers/clocksource/timer-riscv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
index c4f15c4068c0..071b8c144027 100644
--- a/drivers/clocksource/timer-riscv.c
+++ b/drivers/clocksource/timer-riscv.c
@@ -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)
 {
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
@ 2020-05-11  2:20   ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:20 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Hulk Robot, Kefeng Wang

ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 drivers/clocksource/timer-riscv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
index c4f15c4068c0..071b8c144027 100644
--- a/drivers/clocksource/timer-riscv.c
+++ b/drivers/clocksource/timer-riscv.c
@@ -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)
 {
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 10/10] riscv: mmiowb: Fix implicit declaration of function 'smp_processor_id'
  2020-05-11  2:19 [PATCH 00/10] riscv: make riscv build happier Kefeng Wang
@ 2020-05-11  2:20   ` Kefeng Wang
  2020-05-11  2:19   ` Kefeng Wang
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:20 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Kefeng Wang, Hulk Robot

In 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();
                            ^~~~~~~~~~~~~~

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/include/asm/mmiowb.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/include/asm/mmiowb.h b/arch/riscv/include/asm/mmiowb.h
index bb4091ff4a21..0b2333e71fdc 100644
--- a/arch/riscv/include/asm/mmiowb.h
+++ b/arch/riscv/include/asm/mmiowb.h
@@ -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 */
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH 10/10] riscv: mmiowb: Fix implicit declaration of function 'smp_processor_id'
@ 2020-05-11  2:20   ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-11  2:20 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Hulk Robot, Kefeng Wang

In 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();
                            ^~~~~~~~~~~~~~

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
 arch/riscv/include/asm/mmiowb.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/riscv/include/asm/mmiowb.h b/arch/riscv/include/asm/mmiowb.h
index bb4091ff4a21..0b2333e71fdc 100644
--- a/arch/riscv/include/asm/mmiowb.h
+++ b/arch/riscv/include/asm/mmiowb.h
@@ -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 */
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: [PATCH 01/10] riscv: Fix unmet direct dependencies built based on SOC_VIRT
  2020-05-11  2:19   ` Kefeng Wang
@ 2020-05-13 21:14     ` Palmer Dabbelt
  -1 siblings, 0 replies; 52+ messages in thread
From: Palmer Dabbelt @ 2020-05-13 21:14 UTC (permalink / raw)
  To: wangkefeng.wang
  Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, wangkefeng.wang, hulkci

On Sun, 10 May 2020 19:19:52 PDT (-0700), wangkefeng.wang@huawei.com wrote:
> 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]
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  arch/riscv/Kconfig.socs | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
> index 4b2303ca20b9..6c88148f1b9b 100644
> --- a/arch/riscv/Kconfig.socs
> +++ b/arch/riscv/Kconfig.socs
> @@ -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"

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!

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 01/10] riscv: Fix unmet direct dependencies built based on SOC_VIRT
@ 2020-05-13 21:14     ` Palmer Dabbelt
  0 siblings, 0 replies; 52+ messages in thread
From: Palmer Dabbelt @ 2020-05-13 21:14 UTC (permalink / raw)
  To: wangkefeng.wang
  Cc: wangkefeng.wang, aou, linux-kernel, hulkci, Paul Walmsley, linux-riscv

On Sun, 10 May 2020 19:19:52 PDT (-0700), wangkefeng.wang@huawei.com wrote:
> 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]
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  arch/riscv/Kconfig.socs | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/arch/riscv/Kconfig.socs b/arch/riscv/Kconfig.socs
> index 4b2303ca20b9..6c88148f1b9b 100644
> --- a/arch/riscv/Kconfig.socs
> +++ b/arch/riscv/Kconfig.socs
> @@ -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"

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!


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 05/10] riscv: Disable ARCH_HAS_DEBUG_WX if NOMMU
  2020-05-11  2:19   ` Kefeng Wang
@ 2020-05-13 21:14     ` Palmer Dabbelt
  -1 siblings, 0 replies; 52+ messages in thread
From: Palmer Dabbelt @ 2020-05-13 21:14 UTC (permalink / raw)
  To: wangkefeng.wang
  Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, wangkefeng.wang, hulkci

On Sun, 10 May 2020 19:19:56 PDT (-0700), wangkefeng.wang@huawei.com wrote:
> DEBUG_WX is only useful when MMU enabled, diable it if nommu
> and fix the build error.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  arch/riscv/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 78f30f2fdd51..7da0a36a8df0 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -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.

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 05/10] riscv: Disable ARCH_HAS_DEBUG_WX if NOMMU
@ 2020-05-13 21:14     ` Palmer Dabbelt
  0 siblings, 0 replies; 52+ messages in thread
From: Palmer Dabbelt @ 2020-05-13 21:14 UTC (permalink / raw)
  To: wangkefeng.wang
  Cc: wangkefeng.wang, aou, linux-kernel, hulkci, Paul Walmsley, linux-riscv

On Sun, 10 May 2020 19:19:56 PDT (-0700), wangkefeng.wang@huawei.com wrote:
> DEBUG_WX is only useful when MMU enabled, diable it if nommu
> and fix the build error.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  arch/riscv/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 78f30f2fdd51..7da0a36a8df0 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -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.


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 07/10] riscv: Make SYS_SUPPORTS_HUGETLBFS depends on MMU
  2020-05-11  2:19   ` Kefeng Wang
@ 2020-05-13 21:14     ` Palmer Dabbelt
  -1 siblings, 0 replies; 52+ messages in thread
From: Palmer Dabbelt @ 2020-05-13 21:14 UTC (permalink / raw)
  To: wangkefeng.wang
  Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, wangkefeng.wang, hulkci

On Sun, 10 May 2020 19:19:58 PDT (-0700), wangkefeng.wang@huawei.com wrote:
> HUGETLBFS only used when MMU enabled, add the dependence.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  arch/riscv/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 494e670520ae..d0010ed8e0f4 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -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.

>
>  config STACKTRACE_SUPPORT

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 07/10] riscv: Make SYS_SUPPORTS_HUGETLBFS depends on MMU
@ 2020-05-13 21:14     ` Palmer Dabbelt
  0 siblings, 0 replies; 52+ messages in thread
From: Palmer Dabbelt @ 2020-05-13 21:14 UTC (permalink / raw)
  To: wangkefeng.wang
  Cc: wangkefeng.wang, aou, linux-kernel, hulkci, Paul Walmsley, linux-riscv

On Sun, 10 May 2020 19:19:58 PDT (-0700), wangkefeng.wang@huawei.com wrote:
> HUGETLBFS only used when MMU enabled, add the dependence.
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  arch/riscv/Kconfig | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index 494e670520ae..d0010ed8e0f4 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -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.

>
>  config STACKTRACE_SUPPORT


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
  2020-05-11  2:20   ` Kefeng Wang
@ 2020-05-13 21:14     ` Palmer Dabbelt
  -1 siblings, 0 replies; 52+ messages in thread
From: Palmer Dabbelt @ 2020-05-13 21:14 UTC (permalink / raw)
  To: wangkefeng.wang, daniel.lezcano, tglx
  Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, wangkefeng.wang, hulkci

On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com wrote:
> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  drivers/clocksource/timer-riscv.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
> index c4f15c4068c0..071b8c144027 100644
> --- a/drivers/clocksource/timer-riscv.c
> +++ b/drivers/clocksource/timer-riscv.c
> @@ -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 <palmerdabbelt@google.com>
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>

Adding the clocksource maintainers.  Let me know if you want this through my
tree, I'm assuming you want it through your tree.

Thanks!

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
@ 2020-05-13 21:14     ` Palmer Dabbelt
  0 siblings, 0 replies; 52+ messages in thread
From: Palmer Dabbelt @ 2020-05-13 21:14 UTC (permalink / raw)
  To: wangkefeng.wang, daniel.lezcano, tglx
  Cc: wangkefeng.wang, aou, linux-kernel, hulkci, Paul Walmsley, linux-riscv

On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com wrote:
> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>  drivers/clocksource/timer-riscv.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/clocksource/timer-riscv.c b/drivers/clocksource/timer-riscv.c
> index c4f15c4068c0..071b8c144027 100644
> --- a/drivers/clocksource/timer-riscv.c
> +++ b/drivers/clocksource/timer-riscv.c
> @@ -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 <palmerdabbelt@google.com>
Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>

Adding the clocksource maintainers.  Let me know if you want this through my
tree, I'm assuming you want it through your tree.

Thanks!


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 00/10] riscv: make riscv build happier
  2020-05-11  2:19 [PATCH 00/10] riscv: make riscv build happier Kefeng Wang
@ 2020-05-13 21:14   ` Palmer Dabbelt
  2020-05-11  2:19   ` Kefeng Wang
                     ` (9 subsequent siblings)
  10 siblings, 0 replies; 52+ messages in thread
From: Palmer Dabbelt @ 2020-05-13 21:14 UTC (permalink / raw)
  To: wangkefeng.wang
  Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, wangkefeng.wang

On Sun, 10 May 2020 19:19:51 PDT (-0700), wangkefeng.wang@huawei.com 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 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(-)

Unless I said otherwise in the patch reviews, these are all on fixes.

Thanks!

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 00/10] riscv: make riscv build happier
@ 2020-05-13 21:14   ` Palmer Dabbelt
  0 siblings, 0 replies; 52+ messages in thread
From: Palmer Dabbelt @ 2020-05-13 21:14 UTC (permalink / raw)
  To: wangkefeng.wang
  Cc: wangkefeng.wang, linux-riscv, aou, linux-kernel, Paul Walmsley

On Sun, 10 May 2020 19:19:51 PDT (-0700), wangkefeng.wang@huawei.com 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 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(-)

Unless I said otherwise in the patch reviews, these are all on fixes.

Thanks!


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 05/10] riscv: Disable ARCH_HAS_DEBUG_WX if NOMMU
  2020-05-13 21:14     ` Palmer Dabbelt
@ 2020-05-14  8:26       ` Kefeng Wang
  -1 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-14  8:26 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, hulkci


On 2020/5/14 5:14, Palmer Dabbelt wrote:
> On Sun, 10 May 2020 19:19:56 PDT (-0700), wangkefeng.wang@huawei.com 
> wrote:
>> DEBUG_WX is only useful when MMU enabled, diable it if nommu
>> and fix the build error.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>>  arch/riscv/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
>> index 78f30f2fdd51..7da0a36a8df0 100644
>> --- a/arch/riscv/Kconfig
>> +++ b/arch/riscv/Kconfig
>> @@ -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.
as said in cover letter, the patch is based on linux-next, tag 
next-20200508 :)
>
>


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 05/10] riscv: Disable ARCH_HAS_DEBUG_WX if NOMMU
@ 2020-05-14  8:26       ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-14  8:26 UTC (permalink / raw)
  To: Palmer Dabbelt; +Cc: hulkci, linux-riscv, aou, linux-kernel, Paul Walmsley


On 2020/5/14 5:14, Palmer Dabbelt wrote:
> On Sun, 10 May 2020 19:19:56 PDT (-0700), wangkefeng.wang@huawei.com 
> wrote:
>> DEBUG_WX is only useful when MMU enabled, diable it if nommu
>> and fix the build error.
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>>  arch/riscv/Kconfig | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
>> index 78f30f2fdd51..7da0a36a8df0 100644
>> --- a/arch/riscv/Kconfig
>> +++ b/arch/riscv/Kconfig
>> @@ -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.
as said in cover letter, the patch is based on linux-next, tag 
next-20200508 :)
>
>



^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 04/10] riscv: Fix print_vm_layout build error if NOMMU
  2020-05-11  2:19   ` Kefeng Wang
  (?)
@ 2020-05-14 10:10   ` Alex Ghiti
  2020-05-14 11:42     ` Kefeng Wang
  -1 siblings, 1 reply; 52+ messages in thread
From: Alex Ghiti @ 2020-05-14 10:10 UTC (permalink / raw)
  To: Kefeng Wang, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	linux-riscv, linux-kernel
  Cc: Hulk Robot

Hi,

On 5/10/20 10:19 PM, Kefeng Wang 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’ 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);
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
>   arch/riscv/mm/init.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index dfcaebc3928f..58c39c44b9c9 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -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 ?


>   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


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 04/10] riscv: Fix print_vm_layout build error if NOMMU
  2020-05-14 10:10   ` Alex Ghiti
@ 2020-05-14 11:42     ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-14 11:42 UTC (permalink / raw)
  To: Alex Ghiti, Paul Walmsley, Palmer Dabbelt, Albert Ou,
	linux-riscv, linux-kernel
  Cc: Hulk Robot


On 2020/5/14 18:10, Alex Ghiti wrote:
> Hi,
>
> On 5/10/20 10:19 PM, Kefeng Wang 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’ 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);
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>>   arch/riscv/mm/init.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
>> index dfcaebc3928f..58c39c44b9c9 100644
>> --- a/arch/riscv/mm/init.c
>> +++ b/arch/riscv/mm/init.c
>> @@ -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 ?
oops, should be CONFIG_DEBUG_VM, will send v2, thanks.
>
>
>>   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
>
>
> .
>


^ permalink raw reply	[flat|nested] 52+ messages in thread

* [PATCH v2] riscv: Fix print_vm_layout build error if NOMMU
  2020-05-11  2:19   ` Kefeng Wang
@ 2020-05-14 11:53     ` Kefeng Wang
  -1 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-14 11:53 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: alex, Kefeng Wang, Hulk Robot

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’ 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);

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
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(-)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 27a334106708..736de6c8739f 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -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,
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 52+ messages in thread

* [PATCH v2] riscv: Fix print_vm_layout build error if NOMMU
@ 2020-05-14 11:53     ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-14 11:53 UTC (permalink / raw)
  To: Paul Walmsley, Palmer Dabbelt, Albert Ou, linux-riscv, linux-kernel
  Cc: Hulk Robot, Kefeng Wang, alex

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’ 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);

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
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(-)

diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
index 27a334106708..736de6c8739f 100644
--- a/arch/riscv/mm/init.c
+++ b/arch/riscv/mm/init.c
@@ -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,
-- 
2.26.2



^ permalink raw reply related	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
  2020-05-13 21:14     ` Palmer Dabbelt
@ 2020-05-18 14:09       ` Daniel Lezcano
  -1 siblings, 0 replies; 52+ messages in thread
From: Daniel Lezcano @ 2020-05-18 14:09 UTC (permalink / raw)
  To: Palmer Dabbelt, wangkefeng.wang, tglx
  Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, hulkci

On 13/05/2020 23:14, Palmer Dabbelt wrote:
> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com wrote:
>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>>  drivers/clocksource/timer-riscv.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/clocksource/timer-riscv.c
>> b/drivers/clocksource/timer-riscv.c
>> index c4f15c4068c0..071b8c144027 100644
>> --- a/drivers/clocksource/timer-riscv.c
>> +++ b/drivers/clocksource/timer-riscv.c
>> @@ -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 <palmerdabbelt@google.com>
> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
> 
> 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 ?!


-- 
<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

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
@ 2020-05-18 14:09       ` Daniel Lezcano
  0 siblings, 0 replies; 52+ messages in thread
From: Daniel Lezcano @ 2020-05-18 14:09 UTC (permalink / raw)
  To: Palmer Dabbelt, wangkefeng.wang, tglx
  Cc: hulkci, linux-riscv, aou, linux-kernel, Paul Walmsley

On 13/05/2020 23:14, Palmer Dabbelt wrote:
> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com wrote:
>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>> ---
>>  drivers/clocksource/timer-riscv.c | 1 +
>>  1 file changed, 1 insertion(+)
>>
>> diff --git a/drivers/clocksource/timer-riscv.c
>> b/drivers/clocksource/timer-riscv.c
>> index c4f15c4068c0..071b8c144027 100644
>> --- a/drivers/clocksource/timer-riscv.c
>> +++ b/drivers/clocksource/timer-riscv.c
>> @@ -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 <palmerdabbelt@google.com>
> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
> 
> 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 ?!


-- 
<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


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
  2020-05-18 14:09       ` Daniel Lezcano
@ 2020-05-18 15:40         ` Kefeng Wang
  -1 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-18 15:40 UTC (permalink / raw)
  To: Daniel Lezcano, Palmer Dabbelt, tglx
  Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, hulkci


On 2020/5/18 22:09, Daniel Lezcano wrote:
> On 13/05/2020 23:14, Palmer Dabbelt wrote:
>> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com wrote:
>>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>>>
>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>> ---
>>>   drivers/clocksource/timer-riscv.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/clocksource/timer-riscv.c
>>> b/drivers/clocksource/timer-riscv.c
>>> index c4f15c4068c0..071b8c144027 100644
>>> --- a/drivers/clocksource/timer-riscv.c
>>> +++ b/drivers/clocksource/timer-riscv.c
>>> @@ -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 <palmerdabbelt@google.com>
>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>
>> 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.

>
>


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
@ 2020-05-18 15:40         ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-18 15:40 UTC (permalink / raw)
  To: Daniel Lezcano, Palmer Dabbelt, tglx
  Cc: hulkci, linux-riscv, aou, linux-kernel, Paul Walmsley


On 2020/5/18 22:09, Daniel Lezcano wrote:
> On 13/05/2020 23:14, Palmer Dabbelt wrote:
>> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com wrote:
>>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>>>
>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>> ---
>>>   drivers/clocksource/timer-riscv.c | 1 +
>>>   1 file changed, 1 insertion(+)
>>>
>>> diff --git a/drivers/clocksource/timer-riscv.c
>>> b/drivers/clocksource/timer-riscv.c
>>> index c4f15c4068c0..071b8c144027 100644
>>> --- a/drivers/clocksource/timer-riscv.c
>>> +++ b/drivers/clocksource/timer-riscv.c
>>> @@ -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 <palmerdabbelt@google.com>
>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>
>> 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.

>
>



^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
  2020-05-18 15:40         ` Kefeng Wang
@ 2020-05-18 20:23           ` Daniel Lezcano
  -1 siblings, 0 replies; 52+ messages in thread
From: Daniel Lezcano @ 2020-05-18 20:23 UTC (permalink / raw)
  To: Kefeng Wang, Palmer Dabbelt, tglx
  Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, hulkci


Hi Kefeng,

On 18/05/2020 17:40, Kefeng Wang wrote:
> 
> On 2020/5/18 22:09, Daniel Lezcano wrote:
>> On 13/05/2020 23:14, Palmer Dabbelt wrote:
>>> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com
>>> wrote:
>>>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>>>>
>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>>> ---
>>>>   drivers/clocksource/timer-riscv.c | 1 +
>>>>   1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/clocksource/timer-riscv.c
>>>> b/drivers/clocksource/timer-riscv.c
>>>> index c4f15c4068c0..071b8c144027 100644
>>>> --- a/drivers/clocksource/timer-riscv.c
>>>> +++ b/drivers/clocksource/timer-riscv.c
>>>> @@ -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 <palmerdabbelt@google.com>
>>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>>
>>> 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/

> 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 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.



-- 
<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

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
@ 2020-05-18 20:23           ` Daniel Lezcano
  0 siblings, 0 replies; 52+ messages in thread
From: Daniel Lezcano @ 2020-05-18 20:23 UTC (permalink / raw)
  To: Kefeng Wang, Palmer Dabbelt, tglx
  Cc: hulkci, linux-riscv, aou, linux-kernel, Paul Walmsley


Hi Kefeng,

On 18/05/2020 17:40, Kefeng Wang wrote:
> 
> On 2020/5/18 22:09, Daniel Lezcano wrote:
>> On 13/05/2020 23:14, Palmer Dabbelt wrote:
>>> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com
>>> wrote:
>>>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>>>>
>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>>> ---
>>>>   drivers/clocksource/timer-riscv.c | 1 +
>>>>   1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/clocksource/timer-riscv.c
>>>> b/drivers/clocksource/timer-riscv.c
>>>> index c4f15c4068c0..071b8c144027 100644
>>>> --- a/drivers/clocksource/timer-riscv.c
>>>> +++ b/drivers/clocksource/timer-riscv.c
>>>> @@ -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 <palmerdabbelt@google.com>
>>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>>
>>> 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/

> 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 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.



-- 
<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


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
  2020-05-18 20:23           ` Daniel Lezcano
@ 2020-05-19 12:39             ` Kefeng Wang
  -1 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-19 12:39 UTC (permalink / raw)
  To: Daniel Lezcano, Palmer Dabbelt, tglx
  Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, hulkci


On 2020/5/19 4:23, Daniel Lezcano wrote:
> Hi Kefeng,
>
> On 18/05/2020 17:40, Kefeng Wang wrote:
>> On 2020/5/18 22:09, Daniel Lezcano wrote:
>>> On 13/05/2020 23:14, Palmer Dabbelt wrote:
>>>> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com
>>>> wrote:
>>>>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>>>>>
>>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>>>> ---
>>>>>    drivers/clocksource/timer-riscv.c | 1 +
>>>>>    1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/drivers/clocksource/timer-riscv.c
>>>>> b/drivers/clocksource/timer-riscv.c
>>>>> index c4f15c4068c0..071b8c144027 100644
>>>>> --- a/drivers/clocksource/timer-riscv.c
>>>>> +++ b/drivers/clocksource/timer-riscv.c
>>>>> @@ -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 <palmerdabbelt@google.com>
>>>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>>>
>>>> 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.
>
>> 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 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.

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?



>
>
>


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
@ 2020-05-19 12:39             ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-19 12:39 UTC (permalink / raw)
  To: Daniel Lezcano, Palmer Dabbelt, tglx
  Cc: hulkci, linux-riscv, aou, linux-kernel, Paul Walmsley


On 2020/5/19 4:23, Daniel Lezcano wrote:
> Hi Kefeng,
>
> On 18/05/2020 17:40, Kefeng Wang wrote:
>> On 2020/5/18 22:09, Daniel Lezcano wrote:
>>> On 13/05/2020 23:14, Palmer Dabbelt wrote:
>>>> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com
>>>> wrote:
>>>>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>>>>>
>>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>>>> ---
>>>>>    drivers/clocksource/timer-riscv.c | 1 +
>>>>>    1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/drivers/clocksource/timer-riscv.c
>>>>> b/drivers/clocksource/timer-riscv.c
>>>>> index c4f15c4068c0..071b8c144027 100644
>>>>> --- a/drivers/clocksource/timer-riscv.c
>>>>> +++ b/drivers/clocksource/timer-riscv.c
>>>>> @@ -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 <palmerdabbelt@google.com>
>>>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>>>
>>>> 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.
>
>> 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 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.

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?



>
>
>



^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
  2020-05-19 12:39             ` Kefeng Wang
@ 2020-05-19 13:51               ` Daniel Lezcano
  -1 siblings, 0 replies; 52+ messages in thread
From: Daniel Lezcano @ 2020-05-19 13:51 UTC (permalink / raw)
  To: Kefeng Wang, Palmer Dabbelt, tglx
  Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, hulkci

On 19/05/2020 14:39, Kefeng Wang wrote:
> 
> On 2020/5/19 4:23, Daniel Lezcano wrote:
>> Hi Kefeng,
>>
>> On 18/05/2020 17:40, Kefeng Wang wrote:
>>> On 2020/5/18 22:09, Daniel Lezcano wrote:
>>>> On 13/05/2020 23:14, Palmer Dabbelt wrote:
>>>>> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com
>>>>> wrote:
>>>>>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>>>>>>
>>>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>>>>> ---
>>>>>>    drivers/clocksource/timer-riscv.c | 1 +
>>>>>>    1 file changed, 1 insertion(+)
>>>>>>
>>>>>> diff --git a/drivers/clocksource/timer-riscv.c
>>>>>> b/drivers/clocksource/timer-riscv.c
>>>>>> index c4f15c4068c0..071b8c144027 100644
>>>>>> --- a/drivers/clocksource/timer-riscv.c
>>>>>> +++ b/drivers/clocksource/timer-riscv.c
>>>>>> @@ -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 <palmerdabbelt@google.com>
>>>>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>>>>
>>>>> 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.
>>
>>> 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 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.
> 
> 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?

I do not maintain acpi neither arm64.mm.

AFAICT, riscv_time_val is globally declared in
drivers/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.


-- 
<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

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
@ 2020-05-19 13:51               ` Daniel Lezcano
  0 siblings, 0 replies; 52+ messages in thread
From: Daniel Lezcano @ 2020-05-19 13:51 UTC (permalink / raw)
  To: Kefeng Wang, Palmer Dabbelt, tglx
  Cc: hulkci, linux-riscv, aou, linux-kernel, Paul Walmsley

On 19/05/2020 14:39, Kefeng Wang wrote:
> 
> On 2020/5/19 4:23, Daniel Lezcano wrote:
>> Hi Kefeng,
>>
>> On 18/05/2020 17:40, Kefeng Wang wrote:
>>> On 2020/5/18 22:09, Daniel Lezcano wrote:
>>>> On 13/05/2020 23:14, Palmer Dabbelt wrote:
>>>>> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com
>>>>> wrote:
>>>>>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>>>>>>
>>>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>>>>> ---
>>>>>>    drivers/clocksource/timer-riscv.c | 1 +
>>>>>>    1 file changed, 1 insertion(+)
>>>>>>
>>>>>> diff --git a/drivers/clocksource/timer-riscv.c
>>>>>> b/drivers/clocksource/timer-riscv.c
>>>>>> index c4f15c4068c0..071b8c144027 100644
>>>>>> --- a/drivers/clocksource/timer-riscv.c
>>>>>> +++ b/drivers/clocksource/timer-riscv.c
>>>>>> @@ -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 <palmerdabbelt@google.com>
>>>>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>>>>
>>>>> 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.
>>
>>> 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 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.
> 
> 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?

I do not maintain acpi neither arm64.mm.

AFAICT, riscv_time_val is globally declared in
drivers/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.


-- 
<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


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
  2020-05-19 13:51               ` Daniel Lezcano
@ 2020-05-20  1:14                 ` Anup Patel
  -1 siblings, 0 replies; 52+ messages in thread
From: Anup Patel @ 2020-05-20  1:14 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Kefeng Wang, Palmer Dabbelt, Thomas Gleixner, Paul Walmsley,
	Albert Ou, linux-riscv, linux-kernel@vger.kernel.org List,
	hulkci

On Tue, May 19, 2020 at 7:21 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> On 19/05/2020 14:39, Kefeng Wang wrote:
> >
> > On 2020/5/19 4:23, Daniel Lezcano wrote:
> >> Hi Kefeng,
> >>
> >> On 18/05/2020 17:40, Kefeng Wang wrote:
> >>> On 2020/5/18 22:09, Daniel Lezcano wrote:
> >>>> On 13/05/2020 23:14, Palmer Dabbelt wrote:
> >>>>> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com
> >>>>> wrote:
> >>>>>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
> >>>>>>
> >>>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
> >>>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> >>>>>> ---
> >>>>>>    drivers/clocksource/timer-riscv.c | 1 +
> >>>>>>    1 file changed, 1 insertion(+)
> >>>>>>
> >>>>>> diff --git a/drivers/clocksource/timer-riscv.c
> >>>>>> b/drivers/clocksource/timer-riscv.c
> >>>>>> index c4f15c4068c0..071b8c144027 100644
> >>>>>> --- a/drivers/clocksource/timer-riscv.c
> >>>>>> +++ b/drivers/clocksource/timer-riscv.c
> >>>>>> @@ -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 <palmerdabbelt@google.com>
> >>>>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
> >>>>>
> >>>>> 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.
> >>
> >>> 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 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.
> >
> > 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?
>
> I do not maintain acpi neither arm64.mm.
>
> AFAICT, riscv_time_val is globally declared in
> drivers/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.

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

>
>
> --
> <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

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
@ 2020-05-20  1:14                 ` Anup Patel
  0 siblings, 0 replies; 52+ messages in thread
From: Anup Patel @ 2020-05-20  1:14 UTC (permalink / raw)
  To: Daniel Lezcano
  Cc: Kefeng Wang, Albert Ou, linux-kernel@vger.kernel.org List,
	hulkci, Palmer Dabbelt, Paul Walmsley, Thomas Gleixner,
	linux-riscv

On Tue, May 19, 2020 at 7:21 PM Daniel Lezcano
<daniel.lezcano@linaro.org> wrote:
>
> On 19/05/2020 14:39, Kefeng Wang wrote:
> >
> > On 2020/5/19 4:23, Daniel Lezcano wrote:
> >> Hi Kefeng,
> >>
> >> On 18/05/2020 17:40, Kefeng Wang wrote:
> >>> On 2020/5/18 22:09, Daniel Lezcano wrote:
> >>>> On 13/05/2020 23:14, Palmer Dabbelt wrote:
> >>>>> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com
> >>>>> wrote:
> >>>>>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
> >>>>>>
> >>>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
> >>>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> >>>>>> ---
> >>>>>>    drivers/clocksource/timer-riscv.c | 1 +
> >>>>>>    1 file changed, 1 insertion(+)
> >>>>>>
> >>>>>> diff --git a/drivers/clocksource/timer-riscv.c
> >>>>>> b/drivers/clocksource/timer-riscv.c
> >>>>>> index c4f15c4068c0..071b8c144027 100644
> >>>>>> --- a/drivers/clocksource/timer-riscv.c
> >>>>>> +++ b/drivers/clocksource/timer-riscv.c
> >>>>>> @@ -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 <palmerdabbelt@google.com>
> >>>>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
> >>>>>
> >>>>> 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.
> >>
> >>> 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 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.
> >
> > 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?
>
> I do not maintain acpi neither arm64.mm.
>
> AFAICT, riscv_time_val is globally declared in
> drivers/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.

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

>
>
> --
> <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


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
  2020-05-20  1:14                 ` Anup Patel
@ 2020-05-20  2:57                   ` Kefeng Wang
  -1 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-20  2:57 UTC (permalink / raw)
  To: Anup Patel, Daniel Lezcano
  Cc: Palmer Dabbelt, Thomas Gleixner, Paul Walmsley, Albert Ou,
	linux-riscv, linux-kernel@vger.kernel.org List, hulkci


On 2020/5/20 9:14, Anup Patel wrote:
> On Tue, May 19, 2020 at 7:21 PM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>> On 19/05/2020 14:39, Kefeng Wang wrote:
>>> On 2020/5/19 4:23, Daniel Lezcano wrote:
>>>> Hi Kefeng,
>>>>
>>>> On 18/05/2020 17:40, Kefeng Wang wrote:
>>>>> On 2020/5/18 22:09, Daniel Lezcano wrote:
>>>>>> On 13/05/2020 23:14, Palmer Dabbelt wrote:
>>>>>>> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com
>>>>>>> wrote:
>>>>>>>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>>>>>>>>
>>>>>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>>>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>>>>>>> ---
>>>>>>>>     drivers/clocksource/timer-riscv.c | 1 +
>>>>>>>>     1 file changed, 1 insertion(+)
>>>>>>>>
>>>>>>>> diff --git a/drivers/clocksource/timer-riscv.c
>>>>>>>> b/drivers/clocksource/timer-riscv.c
>>>>>>>> index c4f15c4068c0..071b8c144027 100644
>>>>>>>> --- a/drivers/clocksource/timer-riscv.c
>>>>>>>> +++ b/drivers/clocksource/timer-riscv.c
>>>>>>>> @@ -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 <palmerdabbelt@google.com>
>>>>>>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>>>>>>
>>>>>>> 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.
>>>>> 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 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.
>>> 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?
>> I do not maintain acpi neither arm64.mm.
>>
>> AFAICT, riscv_time_val is globally declared in
>> drivers/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.

ok, it's better.  thanks for your explanation.


> I agree with Daniel. Exporting riscv_time_val is a temporary fix.

yes.  it's only for build,  let's wait for Anup's patch.

>
> 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
>
>>
>> --
>> <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
> .
>


^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val
@ 2020-05-20  2:57                   ` Kefeng Wang
  0 siblings, 0 replies; 52+ messages in thread
From: Kefeng Wang @ 2020-05-20  2:57 UTC (permalink / raw)
  To: Anup Patel, Daniel Lezcano
  Cc: Albert Ou, linux-kernel@vger.kernel.org List, hulkci,
	Palmer Dabbelt, Paul Walmsley, Thomas Gleixner, linux-riscv


On 2020/5/20 9:14, Anup Patel wrote:
> On Tue, May 19, 2020 at 7:21 PM Daniel Lezcano
> <daniel.lezcano@linaro.org> wrote:
>> On 19/05/2020 14:39, Kefeng Wang wrote:
>>> On 2020/5/19 4:23, Daniel Lezcano wrote:
>>>> Hi Kefeng,
>>>>
>>>> On 18/05/2020 17:40, Kefeng Wang wrote:
>>>>> On 2020/5/18 22:09, Daniel Lezcano wrote:
>>>>>> On 13/05/2020 23:14, Palmer Dabbelt wrote:
>>>>>>> On Sun, 10 May 2020 19:20:00 PDT (-0700), wangkefeng.wang@huawei.com
>>>>>>> wrote:
>>>>>>>> ERROR: modpost: "riscv_time_val" [crypto/tcrypt.ko] undefined!
>>>>>>>>
>>>>>>>> Reported-by: Hulk Robot <hulkci@huawei.com>
>>>>>>>> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
>>>>>>>> ---
>>>>>>>>     drivers/clocksource/timer-riscv.c | 1 +
>>>>>>>>     1 file changed, 1 insertion(+)
>>>>>>>>
>>>>>>>> diff --git a/drivers/clocksource/timer-riscv.c
>>>>>>>> b/drivers/clocksource/timer-riscv.c
>>>>>>>> index c4f15c4068c0..071b8c144027 100644
>>>>>>>> --- a/drivers/clocksource/timer-riscv.c
>>>>>>>> +++ b/drivers/clocksource/timer-riscv.c
>>>>>>>> @@ -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 <palmerdabbelt@google.com>
>>>>>>> Acked-by: Palmer Dabbelt <palmerdabbelt@google.com>
>>>>>>>
>>>>>>> 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.
>>>>> 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 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.
>>> 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?
>> I do not maintain acpi neither arm64.mm.
>>
>> AFAICT, riscv_time_val is globally declared in
>> drivers/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.

ok, it's better.  thanks for your explanation.


> I agree with Daniel. Exporting riscv_time_val is a temporary fix.

yes.  it's only for build,  let's wait for Anup's patch.

>
> 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
>
>>
>> --
>> <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
> .
>



^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2] riscv: Fix print_vm_layout build error if NOMMU
  2020-05-14 11:53     ` Kefeng Wang
@ 2020-05-20 22:49       ` Palmer Dabbelt
  -1 siblings, 0 replies; 52+ messages in thread
From: Palmer Dabbelt @ 2020-05-20 22:49 UTC (permalink / raw)
  To: wangkefeng.wang
  Cc: Paul Walmsley, aou, linux-riscv, linux-kernel, alex,
	wangkefeng.wang, hulkci

On Thu, 14 May 2020 04:53:35 PDT (-0700), wangkefeng.wang@huawei.com 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’ 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);
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> 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(-)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 27a334106708..736de6c8739f 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -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.

^ permalink raw reply	[flat|nested] 52+ messages in thread

* Re: [PATCH v2] riscv: Fix print_vm_layout build error if NOMMU
@ 2020-05-20 22:49       ` Palmer Dabbelt
  0 siblings, 0 replies; 52+ messages in thread
From: Palmer Dabbelt @ 2020-05-20 22:49 UTC (permalink / raw)
  To: wangkefeng.wang
  Cc: wangkefeng.wang, aou, alex, linux-kernel, hulkci, Paul Walmsley,
	linux-riscv

On Thu, 14 May 2020 04:53:35 PDT (-0700), wangkefeng.wang@huawei.com 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’ 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);
>
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
> ---
> 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(-)
>
> diff --git a/arch/riscv/mm/init.c b/arch/riscv/mm/init.c
> index 27a334106708..736de6c8739f 100644
> --- a/arch/riscv/mm/init.c
> +++ b/arch/riscv/mm/init.c
> @@ -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.


^ permalink raw reply	[flat|nested] 52+ messages in thread

end of thread, other threads:[~2020-05-20 22:50 UTC | newest]

Thread overview: 52+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-11  2:19 [PATCH 00/10] riscv: make riscv build happier Kefeng Wang
2020-05-11  2:19 ` [PATCH 01/10] riscv: Fix unmet direct dependencies built based on SOC_VIRT Kefeng Wang
2020-05-11  2:19   ` Kefeng Wang
2020-05-13 21:14   ` Palmer Dabbelt
2020-05-13 21:14     ` Palmer Dabbelt
2020-05-11  2:19 ` [PATCH 02/10] riscv: stacktrace: Fix undefined reference to `walk_stackframe' Kefeng Wang
2020-05-11  2:19   ` Kefeng Wang
2020-05-11  2:19 ` [PATCH 03/10] riscv: Add pgprot_writecombine/device and PAGE_SHARED defination if NOMMU Kefeng Wang
2020-05-11  2:19   ` Kefeng Wang
2020-05-11  2:19 ` [PATCH 04/10] riscv: Fix print_vm_layout build error " Kefeng Wang
2020-05-11  2:19   ` Kefeng Wang
2020-05-14 10:10   ` Alex Ghiti
2020-05-14 11:42     ` Kefeng Wang
2020-05-14 11:53   ` [PATCH v2] " Kefeng Wang
2020-05-14 11:53     ` Kefeng Wang
2020-05-20 22:49     ` Palmer Dabbelt
2020-05-20 22:49       ` Palmer Dabbelt
2020-05-11  2:19 ` [PATCH 05/10] riscv: Disable ARCH_HAS_DEBUG_WX " Kefeng Wang
2020-05-11  2:19   ` Kefeng Wang
2020-05-13 21:14   ` Palmer Dabbelt
2020-05-13 21:14     ` Palmer Dabbelt
2020-05-14  8:26     ` Kefeng Wang
2020-05-14  8:26       ` Kefeng Wang
2020-05-11  2:19 ` [PATCH 06/10] riscv: Disable ARCH_HAS_DEBUG_VIRTUAL " Kefeng Wang
2020-05-11  2:19 ` [PATCH 07/10] riscv: Make SYS_SUPPORTS_HUGETLBFS depends on MMU Kefeng Wang
2020-05-11  2:19   ` Kefeng Wang
2020-05-13 21:14   ` Palmer Dabbelt
2020-05-13 21:14     ` Palmer Dabbelt
2020-05-11  2:19 ` [PATCH 08/10] riscv: pgtable: Fix __kernel_map_pages build error if NOMMU Kefeng Wang
2020-05-11  2:19   ` Kefeng Wang
2020-05-11  2:20 ` [PATCH 09/10] timer-riscv: Fix undefined riscv_time_val Kefeng Wang
2020-05-11  2:20   ` Kefeng Wang
2020-05-13 21:14   ` Palmer Dabbelt
2020-05-13 21:14     ` Palmer Dabbelt
2020-05-18 14:09     ` Daniel Lezcano
2020-05-18 14:09       ` Daniel Lezcano
2020-05-18 15:40       ` Kefeng Wang
2020-05-18 15:40         ` Kefeng Wang
2020-05-18 20:23         ` Daniel Lezcano
2020-05-18 20:23           ` Daniel Lezcano
2020-05-19 12:39           ` Kefeng Wang
2020-05-19 12:39             ` Kefeng Wang
2020-05-19 13:51             ` Daniel Lezcano
2020-05-19 13:51               ` Daniel Lezcano
2020-05-20  1:14               ` Anup Patel
2020-05-20  1:14                 ` Anup Patel
2020-05-20  2:57                 ` Kefeng Wang
2020-05-20  2:57                   ` Kefeng Wang
2020-05-11  2:20 ` [PATCH 10/10] riscv: mmiowb: Fix implicit declaration of function 'smp_processor_id' Kefeng Wang
2020-05-11  2:20   ` Kefeng Wang
2020-05-13 21:14 ` [PATCH 00/10] riscv: make riscv build happier Palmer Dabbelt
2020-05-13 21:14   ` Palmer Dabbelt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.