Skip to content

Commit 00e35f2

Browse files
committed
parisc: Enable -mlong-calls gcc option by default when !CONFIG_MODULES
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 <deller@gmx.de> Reported-by: kernel test robot <lkp@intel.com> Cc: stable@vger.kernel.org # v5.6+
1 parent 0aa91f8 commit 00e35f2

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

arch/parisc/Kconfig

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,8 @@ config PREFETCH
202202
depends on PA8X00 || PA7200
203203

204204
config MLONGCALLS
205-
bool "Enable the -mlong-calls compiler option for big kernels"
206-
default y if !MODULES || UBSAN || FTRACE
207-
default n
205+
def_bool y if !MODULES || UBSAN || FTRACE
206+
bool "Enable the -mlong-calls compiler option for big kernels" if MODULES && !UBSAN && !FTRACE
208207
depends on PA8X00
209208
help
210209
If you configure the kernel to include many drivers built-in instead

arch/parisc/kernel/entry.S

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -997,10 +997,17 @@ intr_do_preempt:
997997
bb,<,n %r20, 31 - PSW_SM_I, intr_restore
998998
nop
999999

1000+
/* ssm PSW_SM_I done later in intr_restore */
1001+
#ifdef CONFIG_MLONGCALLS
1002+
ldil L%intr_restore, %r2
1003+
load32 preempt_schedule_irq, %r1
1004+
bv %r0(%r1)
1005+
ldo R%intr_restore(%r2), %r2
1006+
#else
1007+
ldil L%intr_restore, %r1
10001008
BL preempt_schedule_irq, %r2
1001-
nop
1002-
1003-
b,n intr_restore /* ssm PSW_SM_I done by intr_restore */
1009+
ldo R%intr_restore(%r1), %r2
1010+
#endif
10041011
#endif /* CONFIG_PREEMPTION */
10051012

10061013
/*

0 commit comments

Comments
 (0)