arch/s390/Makefile | 2 + arch/s390/boot/head.S | 34 +++++---- arch/s390/include/asm/alternative-asm.h | 76 +++----------------- arch/s390/include/asm/alternative.h | 93 ++++++------------------- arch/s390/include/asm/spinlock.h | 2 +- arch/s390/kernel/alternative.c | 61 +--------------- arch/s390/kernel/entry.S | 39 +++++++---- arch/s390/lib/spinlock.c | 4 +- arch/s390/purgatory/head.S | 29 ++++++-- scripts/min-tool-version.sh | 3 +- 10 files changed, 104 insertions(+), 239 deletions(-)
A couple of patches which in result make it finally possible to build the
kernel for s390 with llvm's integrated assembler. Several configs build
without errors or warnings, and the kernel also works as expected.
Note that patch 6 ("s390/boot: workaround llvm IAS bug") reveals a
miscompile. This looks like a bug in the instruction definitions of the mvc
and clc instructions(?). I'd like to ask people to look into this, since
this silently generated broken code.
This patch series is based on linux-next, which contains two additional
required s390 specific patches to make llvm's IAS work.
Thanks,
Heiko
Heiko Carstens (8):
s390/alternatives: provide identical sized orginal/alternative sequences
s390/alternatives: remove padding generation code
s390/entry: shorten OUTSIDE macro
s390/entry: workaround llvm's IAS limitations
s390/purgatory: workaround llvm's IAS limitations
s390/boot: workaround llvm IAS bug
s390/boot: do not emit debug info for assembly with llvm's IAS
scripts/min-tool-version.sh: raise minimum clang version to 14.0.0 for s390
arch/s390/Makefile | 2 +
arch/s390/boot/head.S | 34 +++++----
arch/s390/include/asm/alternative-asm.h | 76 +++-----------------
arch/s390/include/asm/alternative.h | 93 ++++++-------------------
arch/s390/include/asm/spinlock.h | 2 +-
arch/s390/kernel/alternative.c | 61 +---------------
arch/s390/kernel/entry.S | 39 +++++++----
arch/s390/lib/spinlock.c | 4 +-
arch/s390/purgatory/head.S | 29 ++++++--
scripts/min-tool-version.sh | 3 +-
10 files changed, 104 insertions(+), 239 deletions(-)
--
2.32.0
Hi Heiko,
On Wed, May 11, 2022 at 02:05:24PM +0200, Heiko Carstens wrote:
> A couple of patches which in result make it finally possible to build the
> kernel for s390 with llvm's integrated assembler. Several configs build
> without errors or warnings, and the kernel also works as expected.
>
> Note that patch 6 ("s390/boot: workaround llvm IAS bug") reveals a
> miscompile. This looks like a bug in the instruction definitions of the mvc
> and clc instructions(?). I'd like to ask people to look into this, since
> this silently generated broken code.
I think it should be pretty simple to file a bug report for this since
it occurs in a standalone assembly file? I agree with Nick that there
should be a bug report filed and linked to in patch 6 so that we don't
lose track of it.
> This patch series is based on linux-next, which contains two additional
> required s390 specific patches to make llvm's IAS work.
>
> Thanks,
> Heiko
>
> Heiko Carstens (8):
> s390/alternatives: provide identical sized orginal/alternative sequences
> s390/alternatives: remove padding generation code
> s390/entry: shorten OUTSIDE macro
> s390/entry: workaround llvm's IAS limitations
> s390/purgatory: workaround llvm's IAS limitations
> s390/boot: workaround llvm IAS bug
> s390/boot: do not emit debug info for assembly with llvm's IAS
> scripts/min-tool-version.sh: raise minimum clang version to 14.0.0 for s390
>
> arch/s390/Makefile | 2 +
> arch/s390/boot/head.S | 34 +++++----
> arch/s390/include/asm/alternative-asm.h | 76 +++-----------------
> arch/s390/include/asm/alternative.h | 93 ++++++-------------------
> arch/s390/include/asm/spinlock.h | 2 +-
> arch/s390/kernel/alternative.c | 61 +---------------
> arch/s390/kernel/entry.S | 39 +++++++----
> arch/s390/lib/spinlock.c | 4 +-
> arch/s390/purgatory/head.S | 29 ++++++--
> scripts/min-tool-version.sh | 3 +-
> 10 files changed, 104 insertions(+), 239 deletions(-)
I applied this series to the latest s390 for-next branch (c4fb15578802)
and built a few in-tree and distribution configurations with clang-14
and clang-15 then boot tested them in QEMU with a simple buildroot
userspace. I did not see any new warnings or errors. This is awesome, I
am excited to get this wired up in our CI!
In case it is worthwhile:
Tested-by: Nathan Chancellor <nathan@kernel.org>
Cheers,
Nathan
On Wed, May 11, 2022 at 01:52:13PM -0700, Nathan Chancellor wrote:
> Hi Heiko,
>
> On Wed, May 11, 2022 at 02:05:24PM +0200, Heiko Carstens wrote:
> > A couple of patches which in result make it finally possible to build the
> > kernel for s390 with llvm's integrated assembler. Several configs build
> > without errors or warnings, and the kernel also works as expected.
> >
> > Note that patch 6 ("s390/boot: workaround llvm IAS bug") reveals a
> > miscompile. This looks like a bug in the instruction definitions of the mvc
> > and clc instructions(?). I'd like to ask people to look into this, since
> > this silently generated broken code.
>
> I think it should be pretty simple to file a bug report for this since
> it occurs in a standalone assembly file? I agree with Nick that there
> should be a bug report filed and linked to in patch 6 so that we don't
> lose track of it.
https://github.com/llvm/llvm-project/issues/55411
> I applied this series to the latest s390 for-next branch (c4fb15578802)
> and built a few in-tree and distribution configurations with clang-14
> and clang-15 then boot tested them in QEMU with a simple buildroot
> userspace. I did not see any new warnings or errors. This is awesome, I
> am excited to get this wired up in our CI!
>
> In case it is worthwhile:
>
> Tested-by: Nathan Chancellor <nathan@kernel.org>
Yes, it is. Thanks a lot!
On Wed, May 11, 2022 at 5:05 AM Heiko Carstens <hca@linux.ibm.com> wrote:
>
> A couple of patches which in result make it finally possible to build the
> kernel for s390 with llvm's integrated assembler. Several configs build
> without errors or warnings, and the kernel also works as expected.
>
> Note that patch 6 ("s390/boot: workaround llvm IAS bug") reveals a
> miscompile. This looks like a bug in the instruction definitions of the mvc
> and clc instructions(?). I'd like to ask people to look into this, since
> this silently generated broken code.
>
> This patch series is based on linux-next, which contains two additional
> required s390 specific patches to make llvm's IAS work.
I did a quick test of just a defconfig via:
$ ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- make CC=clang -j72 defconfig all
and this assembled then booted in qemu for me. Thanks for the work
that went into this!
Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Sounds like Nathan is doing additional testing as well.
>
> Thanks,
> Heiko
>
> Heiko Carstens (8):
> s390/alternatives: provide identical sized orginal/alternative sequences
> s390/alternatives: remove padding generation code
> s390/entry: shorten OUTSIDE macro
> s390/entry: workaround llvm's IAS limitations
> s390/purgatory: workaround llvm's IAS limitations
> s390/boot: workaround llvm IAS bug
> s390/boot: do not emit debug info for assembly with llvm's IAS
> scripts/min-tool-version.sh: raise minimum clang version to 14.0.0 for s390
>
> arch/s390/Makefile | 2 +
> arch/s390/boot/head.S | 34 +++++----
> arch/s390/include/asm/alternative-asm.h | 76 +++-----------------
> arch/s390/include/asm/alternative.h | 93 ++++++-------------------
> arch/s390/include/asm/spinlock.h | 2 +-
> arch/s390/kernel/alternative.c | 61 +---------------
> arch/s390/kernel/entry.S | 39 +++++++----
> arch/s390/lib/spinlock.c | 4 +-
> arch/s390/purgatory/head.S | 29 ++++++--
> scripts/min-tool-version.sh | 3 +-
> 10 files changed, 104 insertions(+), 239 deletions(-)
>
> --
> 2.32.0
>
--
Thanks,
~Nick Desaulniers
On Wed, May 11, 2022 at 12:48:34PM -0700, Nick Desaulniers wrote:
> On Wed, May 11, 2022 at 5:05 AM Heiko Carstens <hca@linux.ibm.com> wrote:
> >
> > A couple of patches which in result make it finally possible to build the
> > kernel for s390 with llvm's integrated assembler. Several configs build
> > without errors or warnings, and the kernel also works as expected.
> >
> > Note that patch 6 ("s390/boot: workaround llvm IAS bug") reveals a
> > miscompile. This looks like a bug in the instruction definitions of the mvc
> > and clc instructions(?). I'd like to ask people to look into this, since
> > this silently generated broken code.
> >
> > This patch series is based on linux-next, which contains two additional
> > required s390 specific patches to make llvm's IAS work.
>
> I did a quick test of just a defconfig via:
> $ ARCH=s390 CROSS_COMPILE=s390x-linux-gnu- make CC=clang -j72 defconfig all
> and this assembled then booted in qemu for me. Thanks for the work
> that went into this!
>
> Tested-by: Nick Desaulniers <ndesaulniers@google.com>
Will add this too. Thank you!
© 2016 - 2026 Red Hat, Inc.