Thread (12 messages) 12 messages, 5 authors, 2021-05-06

Re: [PATCH v8] RISC-V: enable XIP

From: Palmer Dabbelt <palmer@dabbelt.com>
Date: 2021-05-06 06:38:36
Also in: linux-mm, linux-riscv, lkml

On Mon, 26 Apr 2021 09:46:16 PDT (-0700), naresh.kamboju@linaro.org wrote:
my two cents,

The riscv build failed on Linux -next 20210426 tag kernel due to
below warnings / errors.
Following builds failed.
 - riscv (tinyconfig) with gcc-8
 - riscv (allnoconfig) with gcc-8
 - riscv (tinyconfig) with gcc-9
 - riscv (allnoconfig) with gcc-9
 - riscv (tinyconfig) with gcc-10
 - riscv (allnoconfig) with gcc-10
quoted
quoted
quoted
quoted
diff --git a/arch/riscv/kernel/setup.c b/arch/riscv/kernel/setup.c
index 30e4af0fd50c..2ddf654c72bb 100644
--- a/arch/riscv/kernel/setup.c
+++ b/arch/riscv/kernel/setup.c
@@ -50,7 +50,11 @@ struct screen_info screen_info __section(".data") = {
  * This is used before the kernel initializes the BSS so it can't be in the
  * BSS.
  */
-atomic_t hart_lottery __section(".sdata");
+atomic_t hart_lottery __section(".sdata")
+#ifdef CONFIG_XIP_KERNEL
+= ATOMIC_INIT(0xC001BEEF)
+#endif
+;
 unsigned long boot_cpu_hartid;
 static DEFINE_PER_CPU(struct cpu, cpu_devices);
@@ -254,7 +258,7 @@ void __init setup_arch(char **cmdline_p)
 #if IS_ENABLED(CONFIG_BUILTIN_DTB)
      unflatten_and_copy_device_tree();
 #else
-     if (early_init_dt_verify(__va(dtb_early_pa)))
+     if (early_init_dt_verify(__va(XIP_FIXUP(dtb_early_pa))))
arch/riscv/kernel/setup.c: In function 'setup_arch':
arch/riscv/kernel/setup.c:284:32: error: implicit declaration of
function 'XIP_FIXUP' [-Werror=implicit-function-declaration]
  if (early_init_dt_verify(__va(XIP_FIXUP(dtb_early_pa))))
                                ^~~~~~~~~
arch/riscv/include/asm/page.h:112:62: note: in definition of macro
'linear_mapping_pa_to_va'
 #define linear_mapping_pa_to_va(x) ((void *)((unsigned long)(x) +
va_pa_offset))
                                                              ^
arch/riscv/include/asm/page.h:156:27: note: in expansion of macro
'__pa_to_va_nodebug'
 #define __va(x)  ((void *)__pa_to_va_nodebug((phys_addr_t)(x)))
                           ^~~~~~~~~~~~~~~~~~
arch/riscv/kernel/setup.c:284:27: note: in expansion of macro '__va'
  if (early_init_dt_verify(__va(XIP_FIXUP(dtb_early_pa))))
                           ^~~~
cc1: some warnings being treated as errors

Reported-by: Naresh Kamboju <redacted>


steps to reproduce:
---------------------------
# TuxMake is a command line tool and Python library that provides
# portable and repeatable Linux kernel builds across a variety of
# architectures, toolchains, kernel configurations, and make targets.
#
# TuxMake supports the concept of runtimes.
# See https://docs.tuxmake.org/runtimes/, for that to work it requires
# that you install podman or docker on your system.
#
# To install tuxmake on your system globally:
# sudo pip3 install -U tuxmake
#
# See https://docs.tuxmake.org/ for complete documentation.


tuxmake --runtime podman --target-arch riscv --toolchain gcc-8
--kconfig allnoconfig
Sorry, I didn't notice this as it went by but I think I've already fixed 
this one up.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help