Skip to content

Commit

Permalink
parisc: Enable -mlong-calls gcc option by default when !CONFIG_MODULES
Browse files Browse the repository at this point in the history
When building a kernel without module support, the CONFIG_MLONGCALL option
needs to be enabled in order to reach symbols which are outside of a 22-bit
branch.

This patch changes the autodetection in the Kconfig script to always enable
CONFIG_MLONGCALL when modules are disabled and uses a far call to
preempt_schedule_irq() in intr_do_preempt() to reach the symbol in all cases.

Signed-off-by: Helge Deller <[email protected]>
Reported-by: kernel test robot <[email protected]>
Cc: [email protected] # v5.6+
  • Loading branch information
hdeller committed Jan 26, 2021
1 parent 0aa91f8 commit 00e35f2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
5 changes: 2 additions & 3 deletions arch/parisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,8 @@ config PREFETCH
depends on PA8X00 || PA7200

config MLONGCALLS
bool "Enable the -mlong-calls compiler option for big kernels"
default y if !MODULES || UBSAN || FTRACE
default n
def_bool y if !MODULES || UBSAN || FTRACE
bool "Enable the -mlong-calls compiler option for big kernels" if MODULES && !UBSAN && !FTRACE
depends on PA8X00
help
If you configure the kernel to include many drivers built-in instead
Expand Down
13 changes: 10 additions & 3 deletions arch/parisc/kernel/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -997,10 +997,17 @@ intr_do_preempt:
bb,<,n %r20, 31 - PSW_SM_I, intr_restore
nop

/* ssm PSW_SM_I done later in intr_restore */
#ifdef CONFIG_MLONGCALLS
ldil L%intr_restore, %r2
load32 preempt_schedule_irq, %r1
bv %r0(%r1)
ldo R%intr_restore(%r2), %r2
#else
ldil L%intr_restore, %r1
BL preempt_schedule_irq, %r2
nop

b,n intr_restore /* ssm PSW_SM_I done by intr_restore */
ldo R%intr_restore(%r1), %r2
#endif
#endif /* CONFIG_PREEMPTION */

/*
Expand Down

0 comments on commit 00e35f2

Please sign in to comment.