Skip to contentSkip to conversation

riscv: enable BUILDTIME_TABLE_SORT for !MMU

PATCH In review Jisheng Zhang 2 participants 3 messages Apr 9, 2023 – May 9, 2023 RISC-V

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 riscv: enable BUILDTIME_TABLE_SORT for !MMU

BUILDTIME_TABLE_SORT works for !MMU as well, so enable it.

Tested on QEMU and FPGA.

---
 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/Kconfig +1 -1
index c5e42cc37604..212ea28e346b 100644
@@ -50,7 +50,7 @@ config RISCV
 	select ARCH_WANT_LD_ORPHAN_WARN if !XIP_KERNEL
 	select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
 	select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
-	select BUILDTIME_TABLE_SORT if MMU
+	select BUILDTIME_TABLE_SORT
 	select CLINT_TIMER if !MMU
 	select CLONE_BACKWARDS
 	select COMMON_CLK
Signature · 1 line
2.40.0
#1 lore raw

Hey Jisheng,

Quoted 5 lines · Jisheng Zhang

BUILDTIME_TABLE_SORT works for !MMU as well, so enable it.

Tested on QEMU and FPGA.

Fails to build for nommu_k210_defconfig:

make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build -sk -j30 no __ex_table in file: vmlinux
Failed to sort kernel tables
make[2]: *** [../scripts/Makefile.vmlinux:35: vmlinux] Error 1 make[2]: *** Deleting file 'vmlinux'
make[2]: Target '__default' not remade because of errors. make[1]: *** [/home/conor/stuff/linux/Makefile:1250: vmlinux] Error 2 make[1]: Target '__all' not remade because of errors.
make: *** [Makefile:226: __sub-make] Error 2
make: Target '__all' not remade because of errors.

:(

Quoted 20 lines
---
 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/Kconfig +1 -1
index c5e42cc37604..212ea28e346b 100644
@@ -50,7 +50,7 @@ config RISCV
 	select ARCH_WANT_LD_ORPHAN_WARN if !XIP_KERNEL
 	select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
 	select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
-	select BUILDTIME_TABLE_SORT if MMU
+	select BUILDTIME_TABLE_SORT
 	select CLINT_TIMER if !MMU
 	select CLONE_BACKWARDS
 	select COMMON_CLK
Signature · 1 line
2.40.0

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#2 lore raw
Quoted 5 lines · Conor Dooley

Hey Jisheng,

Quoted 2 lines · Jisheng Zhang

BUILDTIME_TABLE_SORT works for !MMU as well, so enable it.

Quoted 8 lines
Quoted 3 lines

Tested on QEMU and FPGA.

Fails to build for nommu_k210_defconfig:

make ARCH=riscv CROSS_COMPILE=riscv64-unknown-linux-gnu- O=build -sk -j30 no __ex_table in file: vmlinux

This failure log makes me carefully go through the ex_table mechanism again. Now I knew where's the failure from and what should be done:
Because FUTEX is disabled in nommu_k210_defconfig. However, there's a deeply hidden issue here: there should be no __ex_table section usage at all in NOMMU case, becaue __ex_table usage relies on MMU to do the *fixup*, so I need to patch the risc extable part instead.

Thanks

Quoted 31 lines

Failed to sort kernel tables
make[2]: *** [../scripts/Makefile.vmlinux:35: vmlinux] Error 1 make[2]: *** Deleting file 'vmlinux'
make[2]: Target '__default' not remade because of errors. make[1]: *** [/home/conor/stuff/linux/Makefile:1250: vmlinux] Error 2 make[1]: Target '__all' not remade because of errors.
make: *** [Makefile:226: __sub-make] Error 2
make: Target '__all' not remade because of errors.

:(

Quoted 20 lines
---
 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/Kconfig +1 -1
index c5e42cc37604..212ea28e346b 100644
@@ -50,7 +50,7 @@ config RISCV
 	select ARCH_WANT_LD_ORPHAN_WARN if !XIP_KERNEL
 	select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE
 	select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU
-	select BUILDTIME_TABLE_SORT if MMU
+	select BUILDTIME_TABLE_SORT
 	select CLINT_TIMER if !MMU
 	select CLONE_BACKWARDS
 	select COMMON_CLK
Signature · 1 line
2.40.0