linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* x86/include/asm/arch_hweight.h:49:15: error: invalid input size for constraint 'D'
@ 2023-02-07  7:57 Naresh Kamboju
  2023-02-07 16:28 ` Nathan Chancellor
  0 siblings, 1 reply; 5+ messages in thread
From: Naresh Kamboju @ 2023-02-07  7:57 UTC (permalink / raw)
  To: llvm, open list, Linux-Next Mailing List, lkft-triage
  Cc: borislav.petkov, H. Peter Anvin, Thomas Gleixner,
	Sebastian Andrzej Siewior, Nathan Chancellor

Following Build regressions warnings / errors noticed on Linux next-20230207.

Regressions found on x86_64:

    - build/clang-15-lkftconfig-compat
    - build/clang-nightly-lkftconfig
    - build/clang-15-lkftconfig
    - build/clang-15-lkftconfig-kcsan
    - build/clang-lkftconfig

In file included from arch/x86/entry/vdso/vdso32/vgetcpu.c:2:
In file included from arch/x86/entry/vdso/vdso32/../vgetcpu.c:8:
In file included from include/linux/kernel.h:22:
In file included from include/linux/bitops.h:68:
In file included from arch/x86/include/asm/bitops.h:420:
arch/x86/include/asm/arch_hweight.h:49:15: error: invalid input size
for constraint 'D'
                         : REG_IN (w));
                                   ^
In file included from arch/x86/entry/vdso/vdso32/vgetcpu.c:2:
In file included from arch/x86/entry/vdso/vdso32/../vgetcpu.c:8:
In file included from include/linux/kernel.h:25:
In file included from include/linux/math.h:6:
arch/x86/include/asm/div64.h:85:34: error: invalid output size for
constraint '=a'
        asm ("mulq %2; divq %3" : "=a" (q)
                                        ^
2 errors generated.

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

Following config diff found.
 + CONFIG_COMPAT_WARN_32BIT_FILESYSTEM_ACCESS=y

Build details link,
https://qa-reports.linaro.org/lkft/linux-next-master/build/next-20230207/testrun/14611359/suite/build/test/clang-lkftconfig/details/

# To install tuxmake on your system globally:
# sudo pip3 install -U tuxmake
#
# See https://docs.tuxmake.org/ for complete documentation.
# Original tuxmake command with fragments listed below.
tuxmake \
 --runtime podman \
 --target-arch x86_64 \
 --toolchain clang-15 \
 --kconfig defconfig \
 --kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/lkft.config
\
 --kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/lkft-crypto.config
\
 --kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/distro-overrides.config
\
 --kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/systemd.config
\
 --kconfig-add https://raw.githubusercontent.com/Linaro/meta-lkft/kirkstone/meta/recipes-kernel/linux/files/virtio.config
\
 --kconfig-add CONFIG_IGB=y \
 --kconfig-add CONFIG_UNWINDER_FRAME_POINTER=y LLVM=1 LLVM_IAS=1


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

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

* Re: x86/include/asm/arch_hweight.h:49:15: error: invalid input size for constraint 'D'
  2023-02-07  7:57 x86/include/asm/arch_hweight.h:49:15: error: invalid input size for constraint 'D' Naresh Kamboju
@ 2023-02-07 16:28 ` Nathan Chancellor
  2023-02-07 16:30   ` Borislav Petkov
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2023-02-07 16:28 UTC (permalink / raw)
  To: Naresh Kamboju
  Cc: llvm, open list, Linux-Next Mailing List, lkft-triage,
	borislav.petkov, H. Peter Anvin, Thomas Gleixner,
	Sebastian Andrzej Siewior

Hi Naresh,

On Tue, Feb 07, 2023 at 01:27:05PM +0530, Naresh Kamboju wrote:
> Following Build regressions warnings / errors noticed on Linux next-20230207.
> 
> Regressions found on x86_64:
> 
>     - build/clang-15-lkftconfig-compat
>     - build/clang-nightly-lkftconfig
>     - build/clang-15-lkftconfig
>     - build/clang-15-lkftconfig-kcsan
>     - build/clang-lkftconfig
> 
> In file included from arch/x86/entry/vdso/vdso32/vgetcpu.c:2:
> In file included from arch/x86/entry/vdso/vdso32/../vgetcpu.c:8:
> In file included from include/linux/kernel.h:22:
> In file included from include/linux/bitops.h:68:
> In file included from arch/x86/include/asm/bitops.h:420:
> arch/x86/include/asm/arch_hweight.h:49:15: error: invalid input size
> for constraint 'D'
>                          : REG_IN (w));
>                                    ^
> In file included from arch/x86/entry/vdso/vdso32/vgetcpu.c:2:
> In file included from arch/x86/entry/vdso/vdso32/../vgetcpu.c:8:
> In file included from include/linux/kernel.h:25:
> In file included from include/linux/math.h:6:
> arch/x86/include/asm/div64.h:85:34: error: invalid output size for
> constraint '=a'
>         asm ("mulq %2; divq %3" : "=a" (q)
>                                         ^
> 2 errors generated.
> 
> Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>

Thanks a lot for the report as always! Looks like there is a fix pending
on the list:

https://lore.kernel.org/Y+IsCWQdXEr8d9Vy@linutronix.de/

Cheers,
Nathan

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

* Re: x86/include/asm/arch_hweight.h:49:15: error: invalid input size for constraint 'D'
  2023-02-07 16:28 ` Nathan Chancellor
@ 2023-02-07 16:30   ` Borislav Petkov
  2023-02-07 16:37     ` Nathan Chancellor
  0 siblings, 1 reply; 5+ messages in thread
From: Borislav Petkov @ 2023-02-07 16:30 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Naresh Kamboju, llvm, open list, Linux-Next Mailing List,
	lkft-triage, H. Peter Anvin, Thomas Gleixner,
	Sebastian Andrzej Siewior

On Tue, Feb 07, 2023 at 09:28:58AM -0700, Nathan Chancellor wrote:
> Thanks a lot for the report as always! Looks like there is a fix pending
> on the list:
> 
> https://lore.kernel.org/Y+IsCWQdXEr8d9Vy@linutronix.de/

Btw, while I have you, do you know why clang isn't DCOing this chunk
like gcc does?

Thx.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

* Re: x86/include/asm/arch_hweight.h:49:15: error: invalid input size for constraint 'D'
  2023-02-07 16:30   ` Borislav Petkov
@ 2023-02-07 16:37     ` Nathan Chancellor
  2023-02-07 16:44       ` Borislav Petkov
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2023-02-07 16:37 UTC (permalink / raw)
  To: Borislav Petkov
  Cc: Naresh Kamboju, llvm, open list, Linux-Next Mailing List,
	lkft-triage, H. Peter Anvin, Thomas Gleixner,
	Sebastian Andrzej Siewior

On Tue, Feb 07, 2023 at 05:30:38PM +0100, Borislav Petkov wrote:
> On Tue, Feb 07, 2023 at 09:28:58AM -0700, Nathan Chancellor wrote:
> > Thanks a lot for the report as always! Looks like there is a fix pending
> > on the list:
> > 
> > https://lore.kernel.org/Y+IsCWQdXEr8d9Vy@linutronix.de/
> 
> Btw, while I have you, do you know why clang isn't DCOing this chunk
> like gcc does?

Clang does its semantic analysis before optimization, so it cannot dead
code eliminate that chunk before it checks the validity of the asm
constraints, that is just how the pipeline is structured as far as I
understand it. That is one of the biggest and longest standing
differences between clang and GCC that we know about, the upstream link
in the issue below has some more info.

https://github.com/ClangBuiltLinux/linux/issues/3

I am not super familiar with the internal details of LLVM and clang as
other folks are though so I could be wrong or missing something :)

Cheers,
Nathan

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

* Re: x86/include/asm/arch_hweight.h:49:15: error: invalid input size for constraint 'D'
  2023-02-07 16:37     ` Nathan Chancellor
@ 2023-02-07 16:44       ` Borislav Petkov
  0 siblings, 0 replies; 5+ messages in thread
From: Borislav Petkov @ 2023-02-07 16:44 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Naresh Kamboju, llvm, open list, Linux-Next Mailing List,
	lkft-triage, H. Peter Anvin, Thomas Gleixner,
	Sebastian Andrzej Siewior

On Tue, Feb 07, 2023 at 09:37:37AM -0700, Nathan Chancellor wrote:
> Clang does its semantic analysis before optimization, so it cannot dead
> code eliminate that chunk before it checks the validity of the asm
> constraints, that is just how the pipeline is structured as far as I
> understand it. That is one of the biggest and longest standing
> differences between clang and GCC that we know about, the upstream link
> in the issue below has some more info.
> 
> https://github.com/ClangBuiltLinux/linux/issues/3
> 
> I am not super familiar with the internal details of LLVM and clang as
> other folks are though so I could be wrong or missing something :)

Thanks and wow, that's issue #3. Like wow that's old. And reading Nick's
text, it sure does sound like that's the one.

Fun.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

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

end of thread, other threads:[~2023-02-07 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-07  7:57 x86/include/asm/arch_hweight.h:49:15: error: invalid input size for constraint 'D' Naresh Kamboju
2023-02-07 16:28 ` Nathan Chancellor
2023-02-07 16:30   ` Borislav Petkov
2023-02-07 16:37     ` Nathan Chancellor
2023-02-07 16:44       ` Borislav Petkov

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).