All of lore.kernel.org
 help / color / mirror / Atom feed
* clang-13: s390/kernel/head64.S:24:17: error: invalid operand for instruction
@ 2021-10-11  6:17 Naresh Kamboju
  2021-10-11 10:00 ` Heiko Carstens
  0 siblings, 1 reply; 3+ messages in thread
From: Naresh Kamboju @ 2021-10-11  6:17 UTC (permalink / raw)
  To: llvm, linux-s390, clang-built-linux, open list
  Cc: Nathan Chancellor, Nick Desaulniers, Alexander Egorenkov,
	Christian Borntraeger, Vasily Gorbik, Heiko Carstens

[Please ignore this email if it is already reported ]

Following s390 builds failed due to warnings / errors.

metadata:
    git_describe: v5.15-rc5
    git_repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
    git_short_log: 64570fbc14f8 (\"Linux 5.15-rc5\")
    target_arch: s390
    toolchain: clang-13


Fail (2861 errors) s390 (tinyconfig) with clang-nightly
  @ https://builds.tuxbuild.com/1zL35IUSGhDGeVuyIrAp7eyzEUi/
Fail (2861 errors) s390 (tinyconfig) with clang-13
  @ https://builds.tuxbuild.com/1zL35Hn7wjErKsLDM6zAgh27BYJ/
Fail (4112 errors) s390 (allnoconfig) with clang-13
  @ https://builds.tuxbuild.com/1zL35HR60hSFvBmAcYJvKHm8Lko/
Fail (4112 errors) s390 (allnoconfig) with clang-nightly
  @ https://builds.tuxbuild.com/1zL35DTlrX9qRGCtGqgtmmMDjnQ/
Fail (23048 errors) s390 (defconfig) with clang-13
  @ https://builds.tuxbuild.com/1zL35DE2KWQUPxbbXeTbwIJaWXS/
Fail (23045 errors) s390 (defconfig) with clang-nightly
  @ https://builds.tuxbuild.com/1zL35EgeQfWQDXDupp4itkUO5At/


Build errors log:
----------------
arch/s390/kernel/head64.S:24:17: error: invalid operand for instruction
 lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
                ^
arch/s390/kernel/head64.S:40:8: error: invalid operand for instruction
 lpswe .Ldw-.(%r13) # load disabled wait psw
       ^
make[3]: *** [scripts/Makefile.build:379: arch/s390/kernel/head64.o] Error 1
In file included from kernel/sched/cputime.c:5:
In file included from kernel/sched/sched.h:5:
In file included from include/linux/sched.h:14:
In file included from include/linux/pid.h:6:
In file included from include/linux/wait.h:9:
In file included from include/linux/spinlock.h:94:
arch/s390/include/asm/spinlock.h:89:3: error: expected absolute expression
                ALTERNATIVE("", ".long 0xb2fa0070", 49) /* NIAI 7 */
                ^
arch/s390/include/asm/alternative.h:111:2: note: expanded from macro
'ALTERNATIVE'
        ALTINSTR_REPLACEMENT(altinstr, 1)                               \
        ^
arch/s390/include/asm/alternative.h:106:2: note: expanded from macro
'ALTINSTR_REPLACEMENT'
        INSTR_LEN_SANITY_CHECK(altinstr_len(num))
        ^
arch/s390/include/asm/alternative.h:62:3: note: expanded from macro
'INSTR_LEN_SANITY_CHECK'
        ".if " len " > 254\n"                                           \
         ^
<inline asm>:5:5: note: instantiated into assembly here
.if 6651b-6641b > 254
    ^
In file included from kernel/sched/cputime.c:5:
In file included from kernel/sched/sched.h:5:
In file included from include/linux/sched.h:14:
In file included from include/linux/pid.h:6:
In file included from include/linux/wait.h:9:
In file included from include/linux/spinlock.h:94:
arch/s390/include/asm/spinlock.h:89:3: error: cpu alternatives does
not support instructions blocks > 254 bytes
                ALTERNATIVE("", ".long 0xb2fa0070", 49) /* NIAI 7 */
                ^
arch/s390/include/asm/alternative.h:111:2: note: expanded from macro
'ALTERNATIVE'
        ALTINSTR_REPLACEMENT(altinstr, 1)                               \
        ^
arch/s390/include/asm/alternative.h:106:2: note: expanded from macro
'ALTINSTR_REPLACEMENT'
        INSTR_LEN_SANITY_CHECK(altinstr_len(num))
        ^
arch/s390/include/asm/alternative.h:63:3: note: expanded from macro
'INSTR_LEN_SANITY_CHECK'
        "\t.error \"cpu alternatives does not support instructions "    \
         ^
<inline asm>:6:2: note: instantiated into assembly here
        .error "cpu alternatives does not support instructions blocks
> 254 bytes"
        ^
In file included from kernel/sched/cputime.c:5:
In file included from kernel/sched/sched.h:5:
In file included from include/linux/sched.h:14:
In file included from include/linux/pid.h:6:
In file included from include/linux/wait.h:9:
In file included from include/linux/spinlock.h:94:
arch/s390/include/asm/spinlock.h:89:3: error: expected absolute expression
                ALTERNATIVE("", ".long 0xb2fa0070", 49) /* NIAI 7 */
                ^
arch/s390/include/asm/alternative.h:111:2: note: expanded from macro
'ALTERNATIVE'
        ALTINSTR_REPLACEMENT(altinstr, 1)                               \
        ^
arch/s390/include/asm/alternative.h:106:2: note: expanded from macro
'ALTINSTR_REPLACEMENT'
        INSTR_LEN_SANITY_CHECK(altinstr_len(num))
        ^
arch/s390/include/asm/alternative.h:66:3: note: expanded from macro
'INSTR_LEN_SANITY_CHECK'
        ".if (" len ") %% 2\n"                                          \
         ^
<inline asm>:8:5: note: instantiated into assembly here
.if (6651b-6641b) % 2
    ^
In file included from kernel/sched/cputime.c:5:
In file included from kernel/sched/sched.h:5:
In file included from include/linux/sched.h:14:
In file included from include/linux/pid.h:6:
In file included from include/linux/wait.h:9:
In file included from include/linux/spinlock.h:94:
arch/s390/include/asm/spinlock.h:89:3: error: cpu alternatives
instructions length is odd
                ALTERNATIVE("", ".long 0xb2fa0070", 49) /* NIAI 7 */
                ^

Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>

# To install tuxmake on your system globally:
# sudo pip3 install -U tuxmake
#
# See https://docs.tuxmake.org/ for complete documentation.

tuxmake --runtime podman --target-arch s390 --toolchain clang-13
--kconfig defconfig

-- 
Linaro LKFT
https://lkft.linaro.org

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: clang-13: s390/kernel/head64.S:24:17: error: invalid operand for instruction
  2021-10-11  6:17 clang-13: s390/kernel/head64.S:24:17: error: invalid operand for instruction Naresh Kamboju
@ 2021-10-11 10:00 ` Heiko Carstens
  2021-10-11 17:31   ` Nick Desaulniers
  0 siblings, 1 reply; 3+ messages in thread
From: Heiko Carstens @ 2021-10-11 10:00 UTC (permalink / raw)
  To: Naresh Kamboju
  Cc: llvm, linux-s390, clang-built-linux, open list,
	Nathan Chancellor, Nick Desaulniers, Alexander Egorenkov,
	Christian Borntraeger, Vasily Gorbik, Andreas Krebbel,
	Ulrich Weigand, Jonas Paulsson

On Mon, Oct 11, 2021 at 11:47:42AM +0530, Naresh Kamboju wrote:
> [Please ignore this email if it is already reported ]
> 
> Following s390 builds failed due to warnings / errors.
> 
> metadata:
>     git_describe: v5.15-rc5
>     git_repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>     git_short_log: 64570fbc14f8 (\"Linux 5.15-rc5\")
>     target_arch: s390
>     toolchain: clang-13
> 
> 
> Fail (2861 errors) s390 (tinyconfig) with clang-nightly
>   @ https://builds.tuxbuild.com/1zL35IUSGhDGeVuyIrAp7eyzEUi/
> Fail (2861 errors) s390 (tinyconfig) with clang-13
>   @ https://builds.tuxbuild.com/1zL35Hn7wjErKsLDM6zAgh27BYJ/
> Fail (4112 errors) s390 (allnoconfig) with clang-13
>   @ https://builds.tuxbuild.com/1zL35HR60hSFvBmAcYJvKHm8Lko/
> Fail (4112 errors) s390 (allnoconfig) with clang-nightly
>   @ https://builds.tuxbuild.com/1zL35DTlrX9qRGCtGqgtmmMDjnQ/
> Fail (23048 errors) s390 (defconfig) with clang-13
>   @ https://builds.tuxbuild.com/1zL35DE2KWQUPxbbXeTbwIJaWXS/
> Fail (23045 errors) s390 (defconfig) with clang-nightly
>   @ https://builds.tuxbuild.com/1zL35EgeQfWQDXDupp4itkUO5At/
> 
> 
> Build errors log:
> ----------------
> arch/s390/kernel/head64.S:24:17: error: invalid operand for instruction
>  lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
>                 ^
> arch/s390/kernel/head64.S:40:8: error: invalid operand for instruction
>  lpswe .Ldw-.(%r13) # load disabled wait psw

You need to pass LLVM_IAS=0 on the make command line on s390 since
commit f12b034afeb3 ("scripts/Makefile.clang: default to LLVM_IAS=1").

LLVM's integrated assembler doesn't seem to work well when compiling
the kernel for s390 yet.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: clang-13: s390/kernel/head64.S:24:17: error: invalid operand for instruction
  2021-10-11 10:00 ` Heiko Carstens
@ 2021-10-11 17:31   ` Nick Desaulniers
  0 siblings, 0 replies; 3+ messages in thread
From: Nick Desaulniers @ 2021-10-11 17:31 UTC (permalink / raw)
  To: Ulrich Weigand, Jonas Paulsson, Andreas Krebbel, nemanja.i.ibm
  Cc: Naresh Kamboju, llvm, linux-s390, open list, Nathan Chancellor,
	Alexander Egorenkov, Christian Borntraeger, Vasily Gorbik,
	Heiko Carstens, Michael Ellerman

+ Nemanja


On Mon, Oct 11, 2021 at 3:01 AM Heiko Carstens <hca@linux.ibm.com> wrote:
>
> On Mon, Oct 11, 2021 at 11:47:42AM +0530, Naresh Kamboju wrote:
> > [Please ignore this email if it is already reported ]
> >
> > Following s390 builds failed due to warnings / errors.
> >
> > metadata:
> >     git_describe: v5.15-rc5
> >     git_repo: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> >     git_short_log: 64570fbc14f8 (\"Linux 5.15-rc5\")
> >     target_arch: s390
> >     toolchain: clang-13
> >
> >
> > Fail (2861 errors) s390 (tinyconfig) with clang-nightly
> >   @ https://builds.tuxbuild.com/1zL35IUSGhDGeVuyIrAp7eyzEUi/
> > Fail (2861 errors) s390 (tinyconfig) with clang-13
> >   @ https://builds.tuxbuild.com/1zL35Hn7wjErKsLDM6zAgh27BYJ/
> > Fail (4112 errors) s390 (allnoconfig) with clang-13
> >   @ https://builds.tuxbuild.com/1zL35HR60hSFvBmAcYJvKHm8Lko/
> > Fail (4112 errors) s390 (allnoconfig) with clang-nightly
> >   @ https://builds.tuxbuild.com/1zL35DTlrX9qRGCtGqgtmmMDjnQ/
> > Fail (23048 errors) s390 (defconfig) with clang-13
> >   @ https://builds.tuxbuild.com/1zL35DE2KWQUPxbbXeTbwIJaWXS/
> > Fail (23045 errors) s390 (defconfig) with clang-nightly
> >   @ https://builds.tuxbuild.com/1zL35EgeQfWQDXDupp4itkUO5At/
> >
> >
> > Build errors log:
> > ----------------
> > arch/s390/kernel/head64.S:24:17: error: invalid operand for instruction
> >  lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers
> >                 ^
> > arch/s390/kernel/head64.S:40:8: error: invalid operand for instruction
> >  lpswe .Ldw-.(%r13) # load disabled wait psw
>
> You need to pass LLVM_IAS=0 on the make command line on s390 since
> commit f12b034afeb3 ("scripts/Makefile.clang: default to LLVM_IAS=1").
>
> LLVM's integrated assembler doesn't seem to work well when compiling
> the kernel for s390 yet.

Dunno if you folks have cycles to work on it, but if you do, we have
just a handful of bugs left in Clang's assembler (or kernel source
issues) preventing us from assembling the kernel with clang for
SystemZ and PPC.

s390:
https://github.com/ClangBuiltLinux/linux/issues?q=is%3Aopen+is%3Aissue+label%3A%22%5BARCH%5D+s390%22+label%3A%22%5BTOOL%5D+integrated-as%22

ppc:
https://github.com/ClangBuiltLinux/linux/issues?q=is%3Aopen+is%3Aissue+label%3A%22%5BTOOL%5D+integrated-as%22+label%3A%22%5BARCH%5D+powerpc%22

I'm happy to hop on a call to discuss these more.  We have all other
architectures working here, in the sense that if we can build them
with clang, we're using the integrated assembler by default.
-- 
Thanks,
~Nick Desaulniers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-11 17:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-11  6:17 clang-13: s390/kernel/head64.S:24:17: error: invalid operand for instruction Naresh Kamboju
2021-10-11 10:00 ` Heiko Carstens
2021-10-11 17:31   ` Nick Desaulniers

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.