diff mbox series

[-mm] fixup "Decouple build from userspace headers"

Message ID YPClYgoJOTUn4V0w@localhost.localdomain (mailing list archive)
State New, archived
Headers show
Series [-mm] fixup "Decouple build from userspace headers" | expand

Commit Message

Alexey Dobriyan July 15, 2021, 9:15 p.m. UTC
Allow to find SIMD headers where necessary.

Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

	fold into decouple-build-from-userspace-headers.patch

 arch/arm64/lib/Makefile   |    2 +-
 arch/powerpc/lib/Makefile |    2 +-
 lib/raid6/Makefile        |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

Comments

Masahiro Yamada July 18, 2021, 12:36 p.m. UTC | #1
On Fri, Jul 16, 2021 at 6:15 AM Alexey Dobriyan <adobriyan@gmail.com> wrote:
>
> Allow to find SIMD headers where necessary.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> ---
>
>         fold into decouple-build-from-userspace-headers.patch
>
>  arch/arm64/lib/Makefile   |    2 +-
>  arch/powerpc/lib/Makefile |    2 +-
>  lib/raid6/Makefile        |    4 ++--
>  3 files changed, 4 insertions(+), 4 deletions(-)


OK. Perhaps, we can import <arm_neon.h> and  <altivec.h>
into the kernel tree as we did for <stdarg.h>,
then remove "-isystem $(shell $(CC) -print-file-name=include)"
entirely, but I did not look into it.


If we can avoid the arm_neon.h mess,
we can clean up arch/arm/include/uapi/asm/types.h as well.
It is a possible future work.

Anyway, could you add some comments?
(see blew)



> --- a/arch/arm64/lib/Makefile
> +++ b/arch/arm64/lib/Makefile
> @@ -8,7 +8,7 @@ lib-y           := clear_user.o delay.o copy_from_user.o                \
>  ifeq ($(CONFIG_KERNEL_MODE_NEON), y)
>  obj-$(CONFIG_XOR_BLOCKS)       += xor-neon.o
>  CFLAGS_REMOVE_xor-neon.o       += -mgeneral-regs-only
> -CFLAGS_xor-neon.o              += -ffreestanding

Can you add comment, # for <arm_neon.h>

> +CFLAGS_xor-neon.o              += -ffreestanding -isystem $(shell $(CC) -print-file-name=include)
>  endif
>
>  lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o
> --- a/arch/powerpc/lib/Makefile
> +++ b/arch/powerpc/lib/Makefile
> @@ -64,6 +64,6 @@ obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
>  obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o
>
>  obj-$(CONFIG_ALTIVEC)  += xor_vmx.o xor_vmx_glue.o
> -CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec)

Can you add comment, # for <altivec.h>

> +CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec) -isystem $(shell $(CC) -print-file-name=include)
>
>  obj-$(CONFIG_PPC64) += $(obj64-y)
> --- a/lib/raid6/Makefile
> +++ b/lib/raid6/Makefile
> @@ -13,7 +13,7 @@ raid6_pq-$(CONFIG_S390) += s390vx8.o recov_s390xc.o
>  hostprogs      += mktables
>
>  ifeq ($(CONFIG_ALTIVEC),y)
> -altivec_flags := -maltivec $(call cc-option,-mabi=altivec)

Can you add comment, # for <altivec.h>

> +altivec_flags := -maltivec $(call cc-option,-mabi=altivec) -isystem $(shell $(CC) -print-file-name=include)
>
>  ifdef CONFIG_CC_IS_CLANG
>  # clang ppc port does not yet support -maltivec when -msoft-float is
> @@ -33,7 +33,7 @@ endif
>  # The GCC option -ffreestanding is required in order to compile code containing
>  # ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
>  ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
> -NEON_FLAGS := -ffreestanding

Can you add comment, # for <arm_neon.h>

> +NEON_FLAGS := -ffreestanding -isystem $(shell $(CC) -print-file-name=include)
>  ifeq ($(ARCH),arm)
>  NEON_FLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon
>  endif
Masahiro Yamada July 18, 2021, 1:05 p.m. UTC | #2
On Sun, Jul 18, 2021 at 9:36 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Fri, Jul 16, 2021 at 6:15 AM Alexey Dobriyan <adobriyan@gmail.com> wrote:
> >
> > Allow to find SIMD headers where necessary.
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
> > ---
> >
> >         fold into decouple-build-from-userspace-headers.patch
> >
> >  arch/arm64/lib/Makefile   |    2 +-
> >  arch/powerpc/lib/Makefile |    2 +-
> >  lib/raid6/Makefile        |    4 ++--


I did not compile-test it yet, but
I see more <arm_neon.h> inclusion.



crypto/aegis128-neon-inner.c:



#ifdef CONFIG_ARM64
#include <asm/neon-intrinsics.h>

#define AES_ROUND       "aese %0.16b, %1.16b \n\t aesmc %0.16b, %0.16b"
#else
#include <arm_neon.h>

#define AES_ROUND       "aese.8 %q0, %q1 \n\t aesmc.8 %q0, %q0"
#endif




Can you test crypto/aegis128-neon-inner.c
with CONFIG_ARM64=n  (i.e. CONFIG_ARM=y) ?

















> >  3 files changed, 4 insertions(+), 4 deletions(-)
>
>
> OK. Perhaps, we can import <arm_neon.h> and  <altivec.h>
> into the kernel tree as we did for <stdarg.h>,
> then remove "-isystem $(shell $(CC) -print-file-name=include)"
> entirely, but I did not look into it.
>
>
> If we can avoid the arm_neon.h mess,
> we can clean up arch/arm/include/uapi/asm/types.h as well.
> It is a possible future work.
>
> Anyway, could you add some comments?
> (see blew)
>
>
>
> > --- a/arch/arm64/lib/Makefile
> > +++ b/arch/arm64/lib/Makefile
> > @@ -8,7 +8,7 @@ lib-y           := clear_user.o delay.o copy_from_user.o                \
> >  ifeq ($(CONFIG_KERNEL_MODE_NEON), y)
> >  obj-$(CONFIG_XOR_BLOCKS)       += xor-neon.o
> >  CFLAGS_REMOVE_xor-neon.o       += -mgeneral-regs-only
> > -CFLAGS_xor-neon.o              += -ffreestanding
>
> Can you add comment, # for <arm_neon.h>
>
> > +CFLAGS_xor-neon.o              += -ffreestanding -isystem $(shell $(CC) -print-file-name=include)
> >  endif
> >
> >  lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o
> > --- a/arch/powerpc/lib/Makefile
> > +++ b/arch/powerpc/lib/Makefile
> > @@ -64,6 +64,6 @@ obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
> >  obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o
> >
> >  obj-$(CONFIG_ALTIVEC)  += xor_vmx.o xor_vmx_glue.o
> > -CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec)
>
> Can you add comment, # for <altivec.h>
>
> > +CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec) -isystem $(shell $(CC) -print-file-name=include)
> >
> >  obj-$(CONFIG_PPC64) += $(obj64-y)
> > --- a/lib/raid6/Makefile
> > +++ b/lib/raid6/Makefile
> > @@ -13,7 +13,7 @@ raid6_pq-$(CONFIG_S390) += s390vx8.o recov_s390xc.o
> >  hostprogs      += mktables
> >
> >  ifeq ($(CONFIG_ALTIVEC),y)
> > -altivec_flags := -maltivec $(call cc-option,-mabi=altivec)
>
> Can you add comment, # for <altivec.h>
>
> > +altivec_flags := -maltivec $(call cc-option,-mabi=altivec) -isystem $(shell $(CC) -print-file-name=include)
> >
> >  ifdef CONFIG_CC_IS_CLANG
> >  # clang ppc port does not yet support -maltivec when -msoft-float is
> > @@ -33,7 +33,7 @@ endif
> >  # The GCC option -ffreestanding is required in order to compile code containing
> >  # ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
> >  ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
> > -NEON_FLAGS := -ffreestanding
>
> Can you add comment, # for <arm_neon.h>
>
> > +NEON_FLAGS := -ffreestanding -isystem $(shell $(CC) -print-file-name=include)
> >  ifeq ($(ARCH),arm)
> >  NEON_FLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon
> >  endif
>
>
>
> --
> Best Regards
> Masahiro Yamada
diff mbox series

Patch

--- a/arch/arm64/lib/Makefile
+++ b/arch/arm64/lib/Makefile
@@ -8,7 +8,7 @@  lib-y		:= clear_user.o delay.o copy_from_user.o		\
 ifeq ($(CONFIG_KERNEL_MODE_NEON), y)
 obj-$(CONFIG_XOR_BLOCKS)	+= xor-neon.o
 CFLAGS_REMOVE_xor-neon.o	+= -mgeneral-regs-only
-CFLAGS_xor-neon.o		+= -ffreestanding
+CFLAGS_xor-neon.o		+= -ffreestanding -isystem $(shell $(CC) -print-file-name=include)
 endif
 
 lib-$(CONFIG_ARCH_HAS_UACCESS_FLUSHCACHE) += uaccess_flushcache.o
--- a/arch/powerpc/lib/Makefile
+++ b/arch/powerpc/lib/Makefile
@@ -64,6 +64,6 @@  obj-$(CONFIG_PPC_LIB_RHEAP) += rheap.o
 obj-$(CONFIG_FTR_FIXUP_SELFTEST) += feature-fixups-test.o
 
 obj-$(CONFIG_ALTIVEC)	+= xor_vmx.o xor_vmx_glue.o
-CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec)
+CFLAGS_xor_vmx.o += -maltivec $(call cc-option,-mabi=altivec) -isystem $(shell $(CC) -print-file-name=include)
 
 obj-$(CONFIG_PPC64) += $(obj64-y)
--- a/lib/raid6/Makefile
+++ b/lib/raid6/Makefile
@@ -13,7 +13,7 @@  raid6_pq-$(CONFIG_S390) += s390vx8.o recov_s390xc.o
 hostprogs	+= mktables
 
 ifeq ($(CONFIG_ALTIVEC),y)
-altivec_flags := -maltivec $(call cc-option,-mabi=altivec)
+altivec_flags := -maltivec $(call cc-option,-mabi=altivec) -isystem $(shell $(CC) -print-file-name=include)
 
 ifdef CONFIG_CC_IS_CLANG
 # clang ppc port does not yet support -maltivec when -msoft-float is
@@ -33,7 +33,7 @@  endif
 # The GCC option -ffreestanding is required in order to compile code containing
 # ARM/NEON intrinsics in a non C99-compliant environment (such as the kernel)
 ifeq ($(CONFIG_KERNEL_MODE_NEON),y)
-NEON_FLAGS := -ffreestanding
+NEON_FLAGS := -ffreestanding -isystem $(shell $(CC) -print-file-name=include)
 ifeq ($(ARCH),arm)
 NEON_FLAGS += -march=armv7-a -mfloat-abi=softfp -mfpu=neon
 endif