All of lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <masahiroy@kernel.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Nicholas Piggin <npiggin@gmail.com>,
	Christophe Leroy <christophe.leroy@csgroup.eu>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] powerpc: align syscall table for ppc32
Date: Thu, 25 Aug 2022 22:13:56 +0900	[thread overview]
Message-ID: <CAK7LNAQ8ZQHYzoJTPxiRYBsdVXdYUt=bxyrag-d7UnwQ9r7q=w@mail.gmail.com> (raw)
In-Reply-To: <874jy0lpy9.fsf@mpe.ellerman.id.au>

On Thu, Aug 25, 2022 at 4:53 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> Masahiro Yamada <masahiroy@kernel.org> writes:
> > Christophe Leroy reported that commit 7b4537199a4a ("kbuild: link
> > symbol CRCs at final link,  removing CONFIG_MODULE_REL_CRCS") broke
> > mpc85xx_defconfig + CONFIG_RELOCATABLE=y.
> >
> >     LD      vmlinux
> >     SYSMAP  System.map
> >     SORTTAB vmlinux
> >     CHKREL  vmlinux
> >   WARNING: 451 bad relocations
> >   c0b312a9 R_PPC_UADDR32     .head.text-0x3ff9ed54
> >   c0b312ad R_PPC_UADDR32     .head.text-0x3ffac224
> >   c0b312b1 R_PPC_UADDR32     .head.text-0x3ffb09f4
> >   c0b312b5 R_PPC_UADDR32     .head.text-0x3fe184dc
> >   c0b312b9 R_PPC_UADDR32     .head.text-0x3fe183a8
> >       ...
> >
> > The compiler emits a bunch of R_PPC_UADDR32, which is not supported by
> > arch/powerpc/kernel/reloc_32.S.
> >
> > The reason is there exists an unaligned symbol.
> >
> >   $ powerpc-linux-gnu-nm -n vmlinux
> >     ...
> >   c0b31258 d spe_aligninfo
> >   c0b31298 d __func__.0
> >   c0b312a9 D sys_call_table
> >   c0b319b8 d __func__.0
> >
> > Commit 7b4537199a4a is not the root cause. Even before that, I can
> > reproduce the same issue for mpc85xx_defconfig + CONFIG_RELOCATABLE=y
> > + CONFIG_MODVERSIONS=n.
> >
> > It is just that nobody did not notice it because when CONFIG_MODVERSIONS



I wrote weird English (double negation)


nobody did not notice   --> nobody noticed



Please fix it if you have not yet.


Thank you.





> > is enabled, a __crc_* symbol inserted before sys_call_table was hiding
> > the unalignment issue.
> >
> > I checked the commit history, but I could not understand commit
> > 46b45b10f142 ("[POWERPC] Align the sys_call_table").
> >
> > It said 'Our _GLOBAL macro does a ".align 2" so the alignment is fine
> > for 32 bit'. I checked the _GLOBAL in include/asm-powerpc/ppc_asm.h
> > at that time. _GLOBAL specifies ".align 2" for ppc64, but no .align
> > for ppc32.
> >
> > Commit c857c43b34ec ("powerpc: Don't use a function descriptor for
> > system call table") removed _GLOBAL from the syscall table.
> >
> > Anyway, adding alignment to the syscall table for ppc32 fixes the issue.
> >
> > I am not giving Fixes tag because I do not know since when it has been
> > broken, but presumably it has been for a long while.
>
> Thanks.
>
> I trimmed the change log a bit just to say ~= it's been broken for ever,
> and added a Cc to stable.
>
> cheers






-- 
Best Regards
Masahiro Yamada

WARNING: multiple messages have this Message-ID (diff)
From: Masahiro Yamada <masahiroy@kernel.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	Nicholas Piggin <npiggin@gmail.com>,
	Linux Kbuild mailing list <linux-kbuild@vger.kernel.org>
Subject: Re: [PATCH] powerpc: align syscall table for ppc32
Date: Thu, 25 Aug 2022 22:13:56 +0900	[thread overview]
Message-ID: <CAK7LNAQ8ZQHYzoJTPxiRYBsdVXdYUt=bxyrag-d7UnwQ9r7q=w@mail.gmail.com> (raw)
In-Reply-To: <874jy0lpy9.fsf@mpe.ellerman.id.au>

On Thu, Aug 25, 2022 at 4:53 PM Michael Ellerman <mpe@ellerman.id.au> wrote:
>
> Masahiro Yamada <masahiroy@kernel.org> writes:
> > Christophe Leroy reported that commit 7b4537199a4a ("kbuild: link
> > symbol CRCs at final link,  removing CONFIG_MODULE_REL_CRCS") broke
> > mpc85xx_defconfig + CONFIG_RELOCATABLE=y.
> >
> >     LD      vmlinux
> >     SYSMAP  System.map
> >     SORTTAB vmlinux
> >     CHKREL  vmlinux
> >   WARNING: 451 bad relocations
> >   c0b312a9 R_PPC_UADDR32     .head.text-0x3ff9ed54
> >   c0b312ad R_PPC_UADDR32     .head.text-0x3ffac224
> >   c0b312b1 R_PPC_UADDR32     .head.text-0x3ffb09f4
> >   c0b312b5 R_PPC_UADDR32     .head.text-0x3fe184dc
> >   c0b312b9 R_PPC_UADDR32     .head.text-0x3fe183a8
> >       ...
> >
> > The compiler emits a bunch of R_PPC_UADDR32, which is not supported by
> > arch/powerpc/kernel/reloc_32.S.
> >
> > The reason is there exists an unaligned symbol.
> >
> >   $ powerpc-linux-gnu-nm -n vmlinux
> >     ...
> >   c0b31258 d spe_aligninfo
> >   c0b31298 d __func__.0
> >   c0b312a9 D sys_call_table
> >   c0b319b8 d __func__.0
> >
> > Commit 7b4537199a4a is not the root cause. Even before that, I can
> > reproduce the same issue for mpc85xx_defconfig + CONFIG_RELOCATABLE=y
> > + CONFIG_MODVERSIONS=n.
> >
> > It is just that nobody did not notice it because when CONFIG_MODVERSIONS



I wrote weird English (double negation)


nobody did not notice   --> nobody noticed



Please fix it if you have not yet.


Thank you.





> > is enabled, a __crc_* symbol inserted before sys_call_table was hiding
> > the unalignment issue.
> >
> > I checked the commit history, but I could not understand commit
> > 46b45b10f142 ("[POWERPC] Align the sys_call_table").
> >
> > It said 'Our _GLOBAL macro does a ".align 2" so the alignment is fine
> > for 32 bit'. I checked the _GLOBAL in include/asm-powerpc/ppc_asm.h
> > at that time. _GLOBAL specifies ".align 2" for ppc64, but no .align
> > for ppc32.
> >
> > Commit c857c43b34ec ("powerpc: Don't use a function descriptor for
> > system call table") removed _GLOBAL from the syscall table.
> >
> > Anyway, adding alignment to the syscall table for ppc32 fixes the issue.
> >
> > I am not giving Fixes tag because I do not know since when it has been
> > broken, but presumably it has been for a long while.
>
> Thanks.
>
> I trimmed the change log a bit just to say ~= it's been broken for ever,
> and added a Cc to stable.
>
> cheers






-- 
Best Regards
Masahiro Yamada

  reply	other threads:[~2022-08-25 13:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-20 16:51 [PATCH] powerpc: align syscall table for ppc32 Masahiro Yamada
2022-08-20 16:51 ` Masahiro Yamada
2022-08-20 17:50 ` Christophe Leroy
2022-08-20 17:50   ` Christophe Leroy
2022-08-25  7:53 ` Michael Ellerman
2022-08-25  7:53   ` Michael Ellerman
2022-08-25 13:13   ` Masahiro Yamada [this message]
2022-08-25 13:13     ` Masahiro Yamada
2022-08-25 22:51     ` Michael Ellerman
2022-08-25 22:51       ` Michael Ellerman
2022-08-31 13:12 ` Michael Ellerman

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='CAK7LNAQ8ZQHYzoJTPxiRYBsdVXdYUt=bxyrag-d7UnwQ9r7q=w@mail.gmail.com' \
    --to=masahiroy@kernel.org \
    --cc=christophe.leroy@csgroup.eu \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.