diff mbox series

riscv: enable BUILDTIME_TABLE_SORT for !MMU

Message ID 20230409164306.3801-1-jszhang@kernel.org (mailing list archive)
State Changes Requested
Headers show
Series riscv: enable BUILDTIME_TABLE_SORT for !MMU | expand

Checks

Context Check Description
conchuod/cover_letter success Single patches do not need cover letters
conchuod/tree_selection success Guessed tree name to be for-next at HEAD d34a6b715a23
conchuod/fixes_present success Fixes tag not required for -next series
conchuod/maintainers_pattern success MAINTAINERS pattern errors before the patch: 1 and now 1
conchuod/verify_signedoff success Signed-off-by tag matches author and committer
conchuod/kdoc success Errors and warnings before: 0 this patch: 0
conchuod/build_rv64_clang_allmodconfig success Errors and warnings before: 18 this patch: 18
conchuod/module_param success Was 0 now: 0
conchuod/build_rv64_gcc_allmodconfig success Errors and warnings before: 18 this patch: 18
conchuod/build_rv32_defconfig success Build OK
conchuod/dtb_warn_rv64 success Errors and warnings before: 3 this patch: 3
conchuod/header_inline success No static functions without inline keyword in header files
conchuod/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
conchuod/source_inline success Was 0 now: 0
conchuod/build_rv64_nommu_k210_defconfig fail Build failed
conchuod/verify_fixes success No Fixes tag
conchuod/build_rv64_nommu_virt_defconfig success Build OK

Commit Message

Jisheng Zhang April 9, 2023, 4:43 p.m. UTC
BUILDTIME_TABLE_SORT works for !MMU as well, so enable it.

Tested on QEMU and FPGA.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
---
 arch/riscv/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Conor Dooley April 11, 2023, 9:37 a.m. UTC | #1
Hey Jisheng,

On Mon, Apr 10, 2023 at 12:43:06AM +0800, Jisheng Zhang wrote:
> BUILDTIME_TABLE_SORT works for !MMU as well, so enable it.
> 
> Tested on QEMU and FPGA.
> 
> Signed-off-by: Jisheng Zhang <jszhang@kernel.org>

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.

:(

> ---
>  arch/riscv/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> index c5e42cc37604..212ea28e346b 100644
> --- a/arch/riscv/Kconfig
> +++ b/arch/riscv/Kconfig
> @@ -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
> -- 
> 2.40.0
>
Jisheng Zhang May 9, 2023, 2:37 p.m. UTC | #2
On Tue, Apr 11, 2023 at 10:37:36AM +0100, Conor Dooley wrote:
> Hey Jisheng,
> 
> On Mon, Apr 10, 2023 at 12:43:06AM +0800, Jisheng Zhang wrote:
> > BUILDTIME_TABLE_SORT works for !MMU as well, so enable it.
> > 
> > Tested on QEMU and FPGA.
> > 
> > Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
> 
> 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

> 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.
> 
> :(
> 
> > ---
> >  arch/riscv/Kconfig | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> > index c5e42cc37604..212ea28e346b 100644
> > --- a/arch/riscv/Kconfig
> > +++ b/arch/riscv/Kconfig
> > @@ -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
> > -- 
> > 2.40.0
> >
diff mbox series

Patch

diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
index c5e42cc37604..212ea28e346b 100644
--- a/arch/riscv/Kconfig
+++ b/arch/riscv/Kconfig
@@ -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