From: John David Anglin <dave.anglin@bell.net>
To: Helge Deller <deller@gmx.de>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
James Bottomley <James.Bottomley@hansenpartnership.com>,
linux-parisc@vger.kernel.org, kbuild-all@lists.01.org,
LKML <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@kernel.org>, Kees Cook <keescook@chromium.org>,
kernel test robot <lkp@intel.com>
Subject: Re: hppa64-linux-ld: mm/hugetlb.o(.text+0x50dc): cannot reach printk
Date: Mon, 25 Jan 2021 16:08:37 -0500 [thread overview]
Message-ID: <627d4b69-79cf-371b-9aa7-d87f26e4f088@bell.net> (raw)
In-Reply-To: <4bdf35de-f804-4e9d-cde9-cc6785840a60@gmx.de>
I would suggest the following for this hunk:
+ ldil L%intr_restore, %r2
+ BL preempt_schedule_irq
+ ldo R%intr_restore(%r2), %r2
ldil L%intr_restore, %r1
b,l preempt_schedule_irq,%r2
ldo R%intr_restore(%r1), %r2
On PA 2.0 hardware that gives a 22-bit call.
Dave
On 2021-01-25 3:59 p.m., Helge Deller wrote:
> On 1/25/21 9:47 PM, Helge Deller wrote:
>>>>> On Sat, Jan 16, 2021 at 6:37 AM kernel test robot <lkp@intel.com> wrote:
>>>>>> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>>>>> head: 1d94330a437a573cfdf848f6743b1ed169242c8a
>>>>>> commit: eff8728fe69880d3f7983bec3fb6cea4c306261f vmlinux.lds.h: Add PGO and AutoFDO input sections
>>>>>> date: 5 months ago
>>>>>> config: parisc-randconfig-r032-20210116 (attached as .config)
>>>>>> compiler: hppa64-linux-gcc (GCC) 9.3.0
>>>>>> reproduce (this is a W=1 build):
>>>>>> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>>>>>> chmod +x ~/bin/make.cross
>>>>>> # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eff8728fe69880d3f7983bec3fb6cea4c306261f
>>>>>> git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>>>>>> git fetch --no-tags linus master
>>>>>> git checkout eff8728fe69880d3f7983bec3fb6cea4c306261f
>>>>>> # save the attached .config to linux build tree
>>>>>> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
>>>>>>
>>>>>> If you fix the issue, kindly add following tag as appropriate
>>>>>> Reported-by: kernel test robot <lkp@intel.com>
>>>>>>
>>>>>> All errors (new ones prefixed by >>):
>>>>>>
>>>>>> hppa64-linux-ld: mm/page_alloc.o(.ref.text+0x110): cannot reach unknown
>>>>>> hppa64-linux-ld: mm/memblock.o(.text+0x27c): cannot reach __warn_printk
>>>>>> hppa64-linux-ld: mm/memblock.o(.meminit.text+0xc4): cannot reach printk
>> ....
>>
>> The problem with this .config is, that both CONFIG_MODULES and
>> CONFIG_MLONGCALLS are set to "n".
>> The Kconfig autodetection needs fixing to enable CONFIG_MLONGCALLS in
>> this case.
>>
>>
>> This patch fixes it for me:
>>
>> [PATCH] Require -mlong-calls gcc option for !CONFIG_MODULES
>>
>> When building a kernel without module support, the CONFIG_MLONGCALL
>> option needs to be enabled. This patch fixes the autodetection in the
>> Kconfig script and uses a far call to preempt_schedule_irq() in
>> intr_do_preempt().
>>
>> Signed-off-by: Helge Deller <deller@gmx.de>
>> Reported-by: kernel test robot <lkp@intel.com>
> There's a small bug in the code below:
> BL preempt_schedule_irq
> needs to be
> BL preempt_schedule_irq, %r0
>
> I'll do some more testing and will push the final version
> through the parisc tree.
>
> Helge
>
>
>> ---
>>
>> diff --git a/arch/parisc/Kconfig b/arch/parisc/Kconfig
>> index 78b17621ee4a..278462186ac4 100644
>> --- a/arch/parisc/Kconfig
>> +++ b/arch/parisc/Kconfig
>> @@ -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
>> diff --git a/arch/parisc/kernel/entry.S b/arch/parisc/kernel/entry.S
>> index beba9816cc6c..6320f6a8397c 100644
>> --- a/arch/parisc/kernel/entry.S
>> +++ b/arch/parisc/kernel/entry.S
>> @@ -997,10 +997,19 @@ intr_do_preempt:
>> bb,<,n %r20, 31 - PSW_SM_I, intr_restore
>> nop
>>
>> - BL preempt_schedule_irq, %r2
>> - 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, %r2
>> + BL preempt_schedule_irq
>> + ldo R%intr_restore(%r2), %r2
>> +#endif
>> +
>>
>> - b,n intr_restore /* ssm PSW_SM_I done by intr_restore */
>> #endif /* CONFIG_PREEMPTION */
>>
>> /*
>>
>>
--
John David Anglin dave.anglin@bell.net
next prev parent reply other threads:[~2021-01-25 21:12 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-16 14:36 hppa64-linux-ld: mm/hugetlb.o(.text+0x50dc): cannot reach printk kernel test robot
2021-01-25 17:54 ` Nick Desaulniers
2021-01-25 18:34 ` John David Anglin
2021-01-25 19:25 ` Helge Deller
2021-01-25 20:47 ` Helge Deller
2021-01-25 20:58 ` Nick Desaulniers
2021-01-25 21:05 ` Helge Deller
2021-01-25 20:59 ` Helge Deller
2021-01-25 21:08 ` John David Anglin [this message]
2021-01-25 21:13 ` Helge Deller
2021-01-25 21:17 ` John David Anglin
2021-01-25 21:37 ` Helge Deller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=627d4b69-79cf-371b-9aa7-d87f26e4f088@bell.net \
--to=dave.anglin@bell.net \
--cc=James.Bottomley@hansenpartnership.com \
--cc=deller@gmx.de \
--cc=kbuild-all@lists.01.org \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mingo@kernel.org \
--cc=ndesaulniers@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).