linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] x86/vdso: fix flip/flop vdso build bug
@ 2019-07-12 10:15 Naohiro Aota
  2019-07-12 10:15 ` [PATCH v2 2/2] arm64/vdso: " Naohiro Aota
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: Naohiro Aota @ 2019-07-12 10:15 UTC (permalink / raw)
  To: Vincenzo Frascino, linux-kernel
  Cc: x86, Masahiro Yamada, Andy Lutomirski, Thomas Gleixner,
	linux-arm-kernel, Catalin Marinas, Will Deacon,
	Peter Collingbourne, Naohiro Aota

Two consecutive "make" on an already compiled kernel tree will show
different behavior:

$ make
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  DESCEND  objtool
  CHK     include/generated/compile.h
  VDSOCHK arch/x86/entry/vdso/vdso64.so.dbg
  VDSOCHK arch/x86/entry/vdso/vdso32.so.dbg
Kernel: arch/x86/boot/bzImage is ready  (#3)
  Building modules, stage 2.
  MODPOST 12 modules

$ make
make
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  DESCEND  objtool
  CHK     include/generated/compile.h
  VDSO    arch/x86/entry/vdso/vdso64.so.dbg
  OBJCOPY arch/x86/entry/vdso/vdso64.so
  VDSO2C  arch/x86/entry/vdso/vdso-image-64.c
  CC      arch/x86/entry/vdso/vdso-image-64.o
  VDSO    arch/x86/entry/vdso/vdso32.so.dbg
  OBJCOPY arch/x86/entry/vdso/vdso32.so
  VDSO2C  arch/x86/entry/vdso/vdso-image-32.c
  CC      arch/x86/entry/vdso/vdso-image-32.o
  AR      arch/x86/entry/vdso/built-in.a
  AR      arch/x86/entry/built-in.a
  AR      arch/x86/built-in.a
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o
<snip>

This is causing "LD vmlinux" once every two times even without any
modifications. This is the same bug fixed in commit 92a4728608a8
("x86/boot: Fix if_changed build flip/flop bug"). We cannot use two
"if_changed" in one target. Fix this build bug by merging two commands into
one function.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Fixes: 7ac870747988 ("x86/vdso: Switch to generic vDSO implementation")
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 arch/x86/entry/vdso/Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index 39106111be86..34773395139a 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -56,8 +56,7 @@ VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -soname linux-vdso.so.1 --no-undefined \
 			-z max-page-size=4096
 
 $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
-	$(call if_changed,vdso)
-	$(call if_changed,vdso_check)
+	$(call if_changed,vdso_and_check)
 
 HOST_EXTRACFLAGS += -I$(srctree)/tools/include -I$(srctree)/include/uapi -I$(srctree)/arch/$(SUBARCH)/include/uapi
 hostprogs-y			+= vdso2c
@@ -127,8 +126,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
 	$(call if_changed,objcopy)
 
 $(obj)/vdsox32.so.dbg: $(obj)/vdsox32.lds $(vobjx32s) FORCE
-	$(call if_changed,vdso)
-	$(call if_changed,vdso_check)
+	$(call if_changed,vdso_and_check)
 
 CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds)
 VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -soname linux-gate.so.1
@@ -167,8 +165,7 @@ $(obj)/vdso32.so.dbg: FORCE \
 		      $(obj)/vdso32/note.o \
 		      $(obj)/vdso32/system_call.o \
 		      $(obj)/vdso32/sigreturn.o
-	$(call if_changed,vdso)
-	$(call if_changed,vdso_check)
+	$(call if_changed,vdso_and_check)
 
 #
 # The DSO images are built using a special linker script.
@@ -184,6 +181,9 @@ VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \
 	-Bsymbolic
 GCOV_PROFILE := n
 
+quiet_cmd_vdso_and_check = VDSO    $@
+      cmd_vdso_and_check = $(cmd_vdso); $(cmd_vdso_check)
+
 #
 # Install the unstripped copies of vdso*.so.  If our toolchain supports
 # build-id, install .build-id links as well.
-- 
2.22.0


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

* [PATCH v2 2/2] arm64/vdso: fix flip/flop vdso build bug
  2019-07-12 10:15 [PATCH v2 1/2] x86/vdso: fix flip/flop vdso build bug Naohiro Aota
@ 2019-07-12 10:15 ` Naohiro Aota
  2019-07-12 12:06   ` [PATCH] arm64: compat: Fix flip/flop vdso building bug Vincenzo Frascino
                     ` (3 more replies)
  2019-07-12 12:09 ` [PATCH v2 1/2] x86/vdso: fix flip/flop vdso build bug Vincenzo Frascino
                   ` (2 subsequent siblings)
  3 siblings, 4 replies; 14+ messages in thread
From: Naohiro Aota @ 2019-07-12 10:15 UTC (permalink / raw)
  To: Vincenzo Frascino, linux-kernel
  Cc: x86, Masahiro Yamada, Andy Lutomirski, Thomas Gleixner,
	linux-arm-kernel, Catalin Marinas, Will Deacon,
	Peter Collingbourne, Naohiro Aota

Running "make" on an already compiled kernel tree will rebuild the kernel
even without any modifications:

$ make ARCH=arm64 CROSS_COMPILE=/usr/bin/aarch64-unknown-linux-gnu-
arch/arm64/Makefile:58: CROSS_COMPILE_COMPAT not defined or empty, the compat vDSO will not be built
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
  VDSOSYM include/generated/vdso-offsets.h
  CHK     include/generated/compile.h
  CC      arch/arm64/kernel/signal.o
  CC      arch/arm64/kernel/vdso.o
  CC      arch/arm64/kernel/signal32.o
  LD      arch/arm64/kernel/vdso/vdso.so.dbg
  OBJCOPY arch/arm64/kernel/vdso/vdso.so
  AS      arch/arm64/kernel/vdso/vdso.o
  AR      arch/arm64/kernel/vdso/built-in.a
  AR      arch/arm64/kernel/built-in.a
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o

This is the same bug fixed in commit 92a4728608a8 ("x86/boot: Fix
if_changed build flip/flop bug"). We cannot use two "if_changed" in one
target. Fix this build bug by merging two commands into one function.

Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Fixes: 28b1a824a4f4 ("arm64: vdso: Substitute gettimeofday() with C implementation")
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
---
 arch/arm64/kernel/vdso/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
index 4ab863045188..068c614b1231 100644
--- a/arch/arm64/kernel/vdso/Makefile
+++ b/arch/arm64/kernel/vdso/Makefile
@@ -57,8 +57,7 @@ $(obj)/vdso.o : $(obj)/vdso.so
 
 # Link rule for the .so file, .lds has to be first
 $(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE
-	$(call if_changed,ld)
-	$(call if_changed,vdso_check)
+	$(call if_changed,ld_and_vdso_check)
 
 # Strip rule for the .so file
 $(obj)/%.so: OBJCOPYFLAGS := -S
@@ -77,6 +76,9 @@ include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE
 quiet_cmd_vdsocc = VDSOCC   $@
       cmd_vdsocc = $(CC) $(a_flags) $(c_flags) -c -o $@ $<
 
+quiet_cmd_ld_and_vdso_check = LD      $@
+      cmd_ld_and_vdso_check = $(cmd_ld); $(cmd_vdso_check)
+
 # Install commands for the unstripped file
 quiet_cmd_vdso_install = INSTALL $@
       cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
-- 
2.22.0


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

* [PATCH] arm64: compat: Fix flip/flop vdso building bug
  2019-07-12 10:15 ` [PATCH v2 2/2] arm64/vdso: " Naohiro Aota
@ 2019-07-12 12:06   ` Vincenzo Frascino
  2019-07-12 12:10   ` [PATCH v2 2/2] arm64/vdso: fix flip/flop vdso build bug Vincenzo Frascino
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 14+ messages in thread
From: Vincenzo Frascino @ 2019-07-12 12:06 UTC (permalink / raw)
  To: linux-arch, linux-arm-kernel, linux-kernel
  Cc: catalin.marinas, will.deacon, arnd, linux, daniel.lezcano, tglx,
	salyzyn, pcc, 0x7f454c46, linux, huw, sthotton, andre.przywara,
	luto, john.stultz, naohiro.aota, yamada.masahiro, Will Deacon

Running "make" on an already compiled kernel tree will rebuild the
vdso32 library even if this has not been modified.

$ make
  GEN     Makefile
  Using linux as source for kernel
  CALL    linux/scripts/atomic/check-atomics.sh
  CALL    linux/scripts/checksyscalls.sh
  VDSOCHK arch/arm64/kernel/vdso32/vdso.so.raw
  VDSOSYM include/generated/vdso32-offsets.h
  CHK     include/generated/compile.h
  CC      arch/arm64/kernel/signal.o
  CC      arch/arm64/kernel/vdso.o
  CC      arch/arm64/kernel/signal32.o
  VDSOL   arch/arm64/kernel/vdso32/vdso.so.raw
  MUNGE   arch/arm64/kernel/vdso32/vdso.so.dbg
  OBJCOPY arch/arm64/kernel/vdso32/vdso.so
  AS      arch/arm64/kernel/vdso32/vdso.o
  AR      arch/arm64/kernel/vdso32/built-in.a
  AR      arch/arm64/kernel/built-in.a
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o
  MODPOST vmlinux.o

The issue is generated by the fact that "if_changed" is called twice
in a single target.

Fix the build bug merging the two commands into a single function.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Fixes: a7f71a2c8903 ("arm64: compat: Add vDSO")
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
 arch/arm64/kernel/vdso32/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
index 288c14d30b45..fb572b6f1bf5 100644
--- a/arch/arm64/kernel/vdso32/Makefile
+++ b/arch/arm64/kernel/vdso32/Makefile
@@ -144,8 +144,7 @@ $(obj)/vdso.so.dbg: $(obj)/vdso.so.raw $(obj)/$(munge) FORCE
 
 # Link rule for the .so file, .lds has to be first
 $(obj)/vdso.so.raw: $(src)/vdso.lds $(obj-vdso) FORCE
-	$(call if_changed,vdsold)
-	$(call if_changed,vdso_check)
+	$(call if_changed,vdsold_and_vdso_check)
 
 # Compilation rules for the vDSO sources
 $(c-obj-vdso): %.o: %.c FORCE
@@ -156,6 +155,9 @@ $(asm-obj-vdso): %.o: %.S FORCE
 	$(call if_changed_dep,vdsoas)
 
 # Actual build commands
+quiet_cmd_vdsold_and_vdso_check = LD   $@
+      cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check)
+
 quiet_cmd_vdsold = VDSOL   $@
       cmd_vdsold = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_LDFLAGS) \
                    -Wl,-T $(filter %.lds,$^) $(filter %.o,$^) -o $@
-- 
2.22.0


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

* Re: [PATCH v2 1/2] x86/vdso: fix flip/flop vdso build bug
  2019-07-12 10:15 [PATCH v2 1/2] x86/vdso: fix flip/flop vdso build bug Naohiro Aota
  2019-07-12 10:15 ` [PATCH v2 2/2] arm64/vdso: " Naohiro Aota
@ 2019-07-12 12:09 ` Vincenzo Frascino
  2019-07-12 14:54 ` Masahiro Yamada
  2019-07-12 15:41 ` [tip:x86/urgent] x86/vdso: Fix " tip-bot for Naohiro Aota
  3 siblings, 0 replies; 14+ messages in thread
From: Vincenzo Frascino @ 2019-07-12 12:09 UTC (permalink / raw)
  To: Naohiro Aota, linux-kernel
  Cc: x86, Masahiro Yamada, Andy Lutomirski, Thomas Gleixner,
	linux-arm-kernel, Catalin Marinas, Will Deacon,
	Peter Collingbourne

Hi Naohiro,

I was working on a similar patch set, but I just noticed you posted this one.
Thanks for that.

In reply to your series I am adding similar fix for arm64 compat.

On 12/07/2019 11:15, Naohiro Aota wrote:
> Two consecutive "make" on an already compiled kernel tree will show
> different behavior:
> 
> $ make
>   CALL    scripts/checksyscalls.sh
>   CALL    scripts/atomic/check-atomics.sh
>   DESCEND  objtool
>   CHK     include/generated/compile.h
>   VDSOCHK arch/x86/entry/vdso/vdso64.so.dbg
>   VDSOCHK arch/x86/entry/vdso/vdso32.so.dbg
> Kernel: arch/x86/boot/bzImage is ready  (#3)
>   Building modules, stage 2.
>   MODPOST 12 modules
> 
> $ make
> make
>   CALL    scripts/checksyscalls.sh
>   CALL    scripts/atomic/check-atomics.sh
>   DESCEND  objtool
>   CHK     include/generated/compile.h
>   VDSO    arch/x86/entry/vdso/vdso64.so.dbg
>   OBJCOPY arch/x86/entry/vdso/vdso64.so
>   VDSO2C  arch/x86/entry/vdso/vdso-image-64.c
>   CC      arch/x86/entry/vdso/vdso-image-64.o
>   VDSO    arch/x86/entry/vdso/vdso32.so.dbg
>   OBJCOPY arch/x86/entry/vdso/vdso32.so
>   VDSO2C  arch/x86/entry/vdso/vdso-image-32.c
>   CC      arch/x86/entry/vdso/vdso-image-32.o
>   AR      arch/x86/entry/vdso/built-in.a
>   AR      arch/x86/entry/built-in.a
>   AR      arch/x86/built-in.a
>   GEN     .version
>   CHK     include/generated/compile.h
>   UPD     include/generated/compile.h
>   CC      init/version.o
>   AR      init/built-in.a
>   LD      vmlinux.o
> <snip>
> 
> This is causing "LD vmlinux" once every two times even without any
> modifications. This is the same bug fixed in commit 92a4728608a8
> ("x86/boot: Fix if_changed build flip/flop bug"). We cannot use two
> "if_changed" in one target. Fix this build bug by merging two commands into
> one function.
> 
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Fixes: 7ac870747988 ("x86/vdso: Switch to generic vDSO implementation")
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>

> ---
>  arch/x86/entry/vdso/Makefile | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
> index 39106111be86..34773395139a 100644
> --- a/arch/x86/entry/vdso/Makefile
> +++ b/arch/x86/entry/vdso/Makefile
> @@ -56,8 +56,7 @@ VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -soname linux-vdso.so.1 --no-undefined \
>  			-z max-page-size=4096
>  
>  $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
> -	$(call if_changed,vdso)
> -	$(call if_changed,vdso_check)
> +	$(call if_changed,vdso_and_check)
>  
>  HOST_EXTRACFLAGS += -I$(srctree)/tools/include -I$(srctree)/include/uapi -I$(srctree)/arch/$(SUBARCH)/include/uapi
>  hostprogs-y			+= vdso2c
> @@ -127,8 +126,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
>  	$(call if_changed,objcopy)
>  
>  $(obj)/vdsox32.so.dbg: $(obj)/vdsox32.lds $(vobjx32s) FORCE
> -	$(call if_changed,vdso)
> -	$(call if_changed,vdso_check)
> +	$(call if_changed,vdso_and_check)
>  
>  CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds)
>  VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -soname linux-gate.so.1
> @@ -167,8 +165,7 @@ $(obj)/vdso32.so.dbg: FORCE \
>  		      $(obj)/vdso32/note.o \
>  		      $(obj)/vdso32/system_call.o \
>  		      $(obj)/vdso32/sigreturn.o
> -	$(call if_changed,vdso)
> -	$(call if_changed,vdso_check)
> +	$(call if_changed,vdso_and_check)
>  
>  #
>  # The DSO images are built using a special linker script.
> @@ -184,6 +181,9 @@ VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \
>  	-Bsymbolic
>  GCOV_PROFILE := n
>  
> +quiet_cmd_vdso_and_check = VDSO    $@
> +      cmd_vdso_and_check = $(cmd_vdso); $(cmd_vdso_check)
> +
>  #
>  # Install the unstripped copies of vdso*.so.  If our toolchain supports
>  # build-id, install .build-id links as well.
> 

-- 
Regards,
Vincenzo

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

* Re: [PATCH v2 2/2] arm64/vdso: fix flip/flop vdso build bug
  2019-07-12 10:15 ` [PATCH v2 2/2] arm64/vdso: " Naohiro Aota
  2019-07-12 12:06   ` [PATCH] arm64: compat: Fix flip/flop vdso building bug Vincenzo Frascino
@ 2019-07-12 12:10   ` Vincenzo Frascino
  2019-07-12 14:55   ` Masahiro Yamada
  2019-07-12 15:37   ` Will Deacon
  3 siblings, 0 replies; 14+ messages in thread
From: Vincenzo Frascino @ 2019-07-12 12:10 UTC (permalink / raw)
  To: Naohiro Aota, linux-kernel
  Cc: x86, Masahiro Yamada, Andy Lutomirski, Thomas Gleixner,
	linux-arm-kernel, Catalin Marinas, Will Deacon,
	Peter Collingbourne

On 12/07/2019 11:15, Naohiro Aota wrote:
> Running "make" on an already compiled kernel tree will rebuild the kernel
> even without any modifications:
> 
> $ make ARCH=arm64 CROSS_COMPILE=/usr/bin/aarch64-unknown-linux-gnu-
> arch/arm64/Makefile:58: CROSS_COMPILE_COMPAT not defined or empty, the compat vDSO will not be built
>   CALL    scripts/checksyscalls.sh
>   CALL    scripts/atomic/check-atomics.sh
>   VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
>   VDSOSYM include/generated/vdso-offsets.h
>   CHK     include/generated/compile.h
>   CC      arch/arm64/kernel/signal.o
>   CC      arch/arm64/kernel/vdso.o
>   CC      arch/arm64/kernel/signal32.o
>   LD      arch/arm64/kernel/vdso/vdso.so.dbg
>   OBJCOPY arch/arm64/kernel/vdso/vdso.so
>   AS      arch/arm64/kernel/vdso/vdso.o
>   AR      arch/arm64/kernel/vdso/built-in.a
>   AR      arch/arm64/kernel/built-in.a
>   GEN     .version
>   CHK     include/generated/compile.h
>   UPD     include/generated/compile.h
>   CC      init/version.o
>   AR      init/built-in.a
>   LD      vmlinux.o
> 
> This is the same bug fixed in commit 92a4728608a8 ("x86/boot: Fix
> if_changed build flip/flop bug"). We cannot use two "if_changed" in one
> target. Fix this build bug by merging two commands into one function.
> 
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Fixes: 28b1a824a4f4 ("arm64: vdso: Substitute gettimeofday() with C implementation")
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>

Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>

> ---
>  arch/arm64/kernel/vdso/Makefile | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
> index 4ab863045188..068c614b1231 100644
> --- a/arch/arm64/kernel/vdso/Makefile
> +++ b/arch/arm64/kernel/vdso/Makefile
> @@ -57,8 +57,7 @@ $(obj)/vdso.o : $(obj)/vdso.so
>  
>  # Link rule for the .so file, .lds has to be first
>  $(obj)/vdso.so.dbg: $(obj)/vdso.lds $(obj-vdso) FORCE
> -	$(call if_changed,ld)
> -	$(call if_changed,vdso_check)
> +	$(call if_changed,ld_and_vdso_check)
>  
>  # Strip rule for the .so file
>  $(obj)/%.so: OBJCOPYFLAGS := -S
> @@ -77,6 +76,9 @@ include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE
>  quiet_cmd_vdsocc = VDSOCC   $@
>        cmd_vdsocc = $(CC) $(a_flags) $(c_flags) -c -o $@ $<
>  
> +quiet_cmd_ld_and_vdso_check = LD      $@
> +      cmd_ld_and_vdso_check = $(cmd_ld); $(cmd_vdso_check)
> +
>  # Install commands for the unstripped file
>  quiet_cmd_vdso_install = INSTALL $@
>        cmd_vdso_install = cp $(obj)/$@.dbg $(MODLIB)/vdso/$@
> 

-- 
Regards,
Vincenzo

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

* Re: [PATCH v2 1/2] x86/vdso: fix flip/flop vdso build bug
  2019-07-12 10:15 [PATCH v2 1/2] x86/vdso: fix flip/flop vdso build bug Naohiro Aota
  2019-07-12 10:15 ` [PATCH v2 2/2] arm64/vdso: " Naohiro Aota
  2019-07-12 12:09 ` [PATCH v2 1/2] x86/vdso: fix flip/flop vdso build bug Vincenzo Frascino
@ 2019-07-12 14:54 ` Masahiro Yamada
  2019-07-12 15:41 ` [tip:x86/urgent] x86/vdso: Fix " tip-bot for Naohiro Aota
  3 siblings, 0 replies; 14+ messages in thread
From: Masahiro Yamada @ 2019-07-12 14:54 UTC (permalink / raw)
  To: Naohiro Aota
  Cc: Vincenzo Frascino, Linux Kernel Mailing List, X86 ML,
	Andy Lutomirski, Thomas Gleixner, linux-arm-kernel,
	Catalin Marinas, Will Deacon, Peter Collingbourne

On Fri, Jul 12, 2019 at 7:16 PM Naohiro Aota <naohiro.aota@wdc.com> wrote:
>
> Two consecutive "make" on an already compiled kernel tree will show
> different behavior:
>
> $ make
>   CALL    scripts/checksyscalls.sh
>   CALL    scripts/atomic/check-atomics.sh
>   DESCEND  objtool
>   CHK     include/generated/compile.h
>   VDSOCHK arch/x86/entry/vdso/vdso64.so.dbg
>   VDSOCHK arch/x86/entry/vdso/vdso32.so.dbg
> Kernel: arch/x86/boot/bzImage is ready  (#3)
>   Building modules, stage 2.
>   MODPOST 12 modules
>
> $ make
> make
>   CALL    scripts/checksyscalls.sh
>   CALL    scripts/atomic/check-atomics.sh
>   DESCEND  objtool
>   CHK     include/generated/compile.h
>   VDSO    arch/x86/entry/vdso/vdso64.so.dbg
>   OBJCOPY arch/x86/entry/vdso/vdso64.so
>   VDSO2C  arch/x86/entry/vdso/vdso-image-64.c
>   CC      arch/x86/entry/vdso/vdso-image-64.o
>   VDSO    arch/x86/entry/vdso/vdso32.so.dbg
>   OBJCOPY arch/x86/entry/vdso/vdso32.so
>   VDSO2C  arch/x86/entry/vdso/vdso-image-32.c
>   CC      arch/x86/entry/vdso/vdso-image-32.o
>   AR      arch/x86/entry/vdso/built-in.a
>   AR      arch/x86/entry/built-in.a
>   AR      arch/x86/built-in.a
>   GEN     .version
>   CHK     include/generated/compile.h
>   UPD     include/generated/compile.h
>   CC      init/version.o
>   AR      init/built-in.a
>   LD      vmlinux.o
> <snip>
>
> This is causing "LD vmlinux" once every two times even without any
> modifications. This is the same bug fixed in commit 92a4728608a8
> ("x86/boot: Fix if_changed build flip/flop bug"). We cannot use two
> "if_changed" in one target. Fix this build bug by merging two commands into
> one function.
>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Fixes: 7ac870747988 ("x86/vdso: Switch to generic vDSO implementation")
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> ---

Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH v2 2/2] arm64/vdso: fix flip/flop vdso build bug
  2019-07-12 10:15 ` [PATCH v2 2/2] arm64/vdso: " Naohiro Aota
  2019-07-12 12:06   ` [PATCH] arm64: compat: Fix flip/flop vdso building bug Vincenzo Frascino
  2019-07-12 12:10   ` [PATCH v2 2/2] arm64/vdso: fix flip/flop vdso build bug Vincenzo Frascino
@ 2019-07-12 14:55   ` Masahiro Yamada
  2019-07-12 15:37   ` Will Deacon
  3 siblings, 0 replies; 14+ messages in thread
From: Masahiro Yamada @ 2019-07-12 14:55 UTC (permalink / raw)
  To: Naohiro Aota
  Cc: Vincenzo Frascino, Linux Kernel Mailing List, X86 ML,
	Andy Lutomirski, Thomas Gleixner, linux-arm-kernel,
	Catalin Marinas, Will Deacon, Peter Collingbourne

On Fri, Jul 12, 2019 at 7:16 PM Naohiro Aota <naohiro.aota@wdc.com> wrote:
>
> Running "make" on an already compiled kernel tree will rebuild the kernel
> even without any modifications:
>
> $ make ARCH=arm64 CROSS_COMPILE=/usr/bin/aarch64-unknown-linux-gnu-
> arch/arm64/Makefile:58: CROSS_COMPILE_COMPAT not defined or empty, the compat vDSO will not be built
>   CALL    scripts/checksyscalls.sh
>   CALL    scripts/atomic/check-atomics.sh
>   VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
>   VDSOSYM include/generated/vdso-offsets.h
>   CHK     include/generated/compile.h
>   CC      arch/arm64/kernel/signal.o
>   CC      arch/arm64/kernel/vdso.o
>   CC      arch/arm64/kernel/signal32.o
>   LD      arch/arm64/kernel/vdso/vdso.so.dbg
>   OBJCOPY arch/arm64/kernel/vdso/vdso.so
>   AS      arch/arm64/kernel/vdso/vdso.o
>   AR      arch/arm64/kernel/vdso/built-in.a
>   AR      arch/arm64/kernel/built-in.a
>   GEN     .version
>   CHK     include/generated/compile.h
>   UPD     include/generated/compile.h
>   CC      init/version.o
>   AR      init/built-in.a
>   LD      vmlinux.o
>
> This is the same bug fixed in commit 92a4728608a8 ("x86/boot: Fix
> if_changed build flip/flop bug"). We cannot use two "if_changed" in one
> target. Fix this build bug by merging two commands into one function.
>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Fixes: 28b1a824a4f4 ("arm64: vdso: Substitute gettimeofday() with C implementation")
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> ---

Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH v2 2/2] arm64/vdso: fix flip/flop vdso build bug
  2019-07-12 10:15 ` [PATCH v2 2/2] arm64/vdso: " Naohiro Aota
                     ` (2 preceding siblings ...)
  2019-07-12 14:55   ` Masahiro Yamada
@ 2019-07-12 15:37   ` Will Deacon
  2019-07-18 11:41     ` [PATCH] arm64: vdso: Cleanup Makefiles Vincenzo Frascino
  2019-07-19 10:10     ` [PATCH v2] " Vincenzo Frascino
  3 siblings, 2 replies; 14+ messages in thread
From: Will Deacon @ 2019-07-12 15:37 UTC (permalink / raw)
  To: Naohiro Aota
  Cc: Vincenzo Frascino, linux-kernel, x86, Masahiro Yamada,
	Andy Lutomirski, Thomas Gleixner, linux-arm-kernel,
	Catalin Marinas, Peter Collingbourne

On Fri, Jul 12, 2019 at 07:15:56PM +0900, Naohiro Aota wrote:
> Running "make" on an already compiled kernel tree will rebuild the kernel
> even without any modifications:
> 
> $ make ARCH=arm64 CROSS_COMPILE=/usr/bin/aarch64-unknown-linux-gnu-
> arch/arm64/Makefile:58: CROSS_COMPILE_COMPAT not defined or empty, the compat vDSO will not be built
>   CALL    scripts/checksyscalls.sh
>   CALL    scripts/atomic/check-atomics.sh
>   VDSOCHK arch/arm64/kernel/vdso/vdso.so.dbg
>   VDSOSYM include/generated/vdso-offsets.h
>   CHK     include/generated/compile.h
>   CC      arch/arm64/kernel/signal.o
>   CC      arch/arm64/kernel/vdso.o
>   CC      arch/arm64/kernel/signal32.o
>   LD      arch/arm64/kernel/vdso/vdso.so.dbg
>   OBJCOPY arch/arm64/kernel/vdso/vdso.so
>   AS      arch/arm64/kernel/vdso/vdso.o
>   AR      arch/arm64/kernel/vdso/built-in.a
>   AR      arch/arm64/kernel/built-in.a
>   GEN     .version
>   CHK     include/generated/compile.h
>   UPD     include/generated/compile.h
>   CC      init/version.o
>   AR      init/built-in.a
>   LD      vmlinux.o
> 
> This is the same bug fixed in commit 92a4728608a8 ("x86/boot: Fix
> if_changed build flip/flop bug"). We cannot use two "if_changed" in one
> target. Fix this build bug by merging two commands into one function.
> 
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> Fixes: 28b1a824a4f4 ("arm64: vdso: Substitute gettimeofday() with C implementation")
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> ---
>  arch/arm64/kernel/vdso/Makefile | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Thanks. I've merged in Vincenzo's compat change too, so I'll send this at
-rc1 for arm64.

Will

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

* [tip:x86/urgent] x86/vdso: Fix flip/flop vdso build bug
  2019-07-12 10:15 [PATCH v2 1/2] x86/vdso: fix flip/flop vdso build bug Naohiro Aota
                   ` (2 preceding siblings ...)
  2019-07-12 14:54 ` Masahiro Yamada
@ 2019-07-12 15:41 ` tip-bot for Naohiro Aota
  3 siblings, 0 replies; 14+ messages in thread
From: tip-bot for Naohiro Aota @ 2019-07-12 15:41 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: naohiro.aota, tglx, vincenzo.frascino, linux-kernel, mingo, hpa,
	yamada.masahiro

Commit-ID:  e9a1379f9219be439f47a0f063431a92dc529eda
Gitweb:     https://git.kernel.org/tip/e9a1379f9219be439f47a0f063431a92dc529eda
Author:     Naohiro Aota <naohiro.aota@wdc.com>
AuthorDate: Fri, 12 Jul 2019 19:15:55 +0900
Committer:  Thomas Gleixner <tglx@linutronix.de>
CommitDate: Fri, 12 Jul 2019 17:35:07 +0200

x86/vdso: Fix flip/flop vdso build bug

Two consecutive "make" on an already compiled kernel tree will show
different behavior:

$ make
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  DESCEND  objtool
  CHK     include/generated/compile.h
  VDSOCHK arch/x86/entry/vdso/vdso64.so.dbg
  VDSOCHK arch/x86/entry/vdso/vdso32.so.dbg
Kernel: arch/x86/boot/bzImage is ready  (#3)
  Building modules, stage 2.
  MODPOST 12 modules

$ make
make
  CALL    scripts/checksyscalls.sh
  CALL    scripts/atomic/check-atomics.sh
  DESCEND  objtool
  CHK     include/generated/compile.h
  VDSO    arch/x86/entry/vdso/vdso64.so.dbg
  OBJCOPY arch/x86/entry/vdso/vdso64.so
  VDSO2C  arch/x86/entry/vdso/vdso-image-64.c
  CC      arch/x86/entry/vdso/vdso-image-64.o
  VDSO    arch/x86/entry/vdso/vdso32.so.dbg
  OBJCOPY arch/x86/entry/vdso/vdso32.so
  VDSO2C  arch/x86/entry/vdso/vdso-image-32.c
  CC      arch/x86/entry/vdso/vdso-image-32.o
  AR      arch/x86/entry/vdso/built-in.a
  AR      arch/x86/entry/built-in.a
  AR      arch/x86/built-in.a
  GEN     .version
  CHK     include/generated/compile.h
  UPD     include/generated/compile.h
  CC      init/version.o
  AR      init/built-in.a
  LD      vmlinux.o
<snip>

This is causing "LD vmlinux" once every two times even without any
modifications. This is the same bug fixed in commit 92a4728608a8
("x86/boot: Fix if_changed build flip/flop bug"). Two "if_changed" cannot
be used in one target.

Fix this merging two commands into one function.

Fixes: 7ac870747988 ("x86/vdso: Switch to generic vDSO implementation")
Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
Reviewed-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Link: https://lkml.kernel.org/r/20190712101556.17833-1-naohiro.aota@wdc.com

---
 arch/x86/entry/vdso/Makefile | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index 39106111be86..34773395139a 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -56,8 +56,7 @@ VDSO_LDFLAGS_vdso.lds = -m elf_x86_64 -soname linux-vdso.so.1 --no-undefined \
 			-z max-page-size=4096
 
 $(obj)/vdso64.so.dbg: $(obj)/vdso.lds $(vobjs) FORCE
-	$(call if_changed,vdso)
-	$(call if_changed,vdso_check)
+	$(call if_changed,vdso_and_check)
 
 HOST_EXTRACFLAGS += -I$(srctree)/tools/include -I$(srctree)/include/uapi -I$(srctree)/arch/$(SUBARCH)/include/uapi
 hostprogs-y			+= vdso2c
@@ -127,8 +126,7 @@ $(obj)/%.so: $(obj)/%.so.dbg FORCE
 	$(call if_changed,objcopy)
 
 $(obj)/vdsox32.so.dbg: $(obj)/vdsox32.lds $(vobjx32s) FORCE
-	$(call if_changed,vdso)
-	$(call if_changed,vdso_check)
+	$(call if_changed,vdso_and_check)
 
 CPPFLAGS_vdso32.lds = $(CPPFLAGS_vdso.lds)
 VDSO_LDFLAGS_vdso32.lds = -m elf_i386 -soname linux-gate.so.1
@@ -167,8 +165,7 @@ $(obj)/vdso32.so.dbg: FORCE \
 		      $(obj)/vdso32/note.o \
 		      $(obj)/vdso32/system_call.o \
 		      $(obj)/vdso32/sigreturn.o
-	$(call if_changed,vdso)
-	$(call if_changed,vdso_check)
+	$(call if_changed,vdso_and_check)
 
 #
 # The DSO images are built using a special linker script.
@@ -184,6 +181,9 @@ VDSO_LDFLAGS = -shared $(call ld-option, --hash-style=both) \
 	-Bsymbolic
 GCOV_PROFILE := n
 
+quiet_cmd_vdso_and_check = VDSO    $@
+      cmd_vdso_and_check = $(cmd_vdso); $(cmd_vdso_check)
+
 #
 # Install the unstripped copies of vdso*.so.  If our toolchain supports
 # build-id, install .build-id links as well.

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

* [PATCH] arm64: vdso: Cleanup Makefiles.
  2019-07-12 15:37   ` Will Deacon
@ 2019-07-18 11:41     ` Vincenzo Frascino
  2019-07-19  8:04       ` Will Deacon
  2019-07-19 10:10     ` [PATCH v2] " Vincenzo Frascino
  1 sibling, 1 reply; 14+ messages in thread
From: Vincenzo Frascino @ 2019-07-18 11:41 UTC (permalink / raw)
  To: linux-arch, linux-arm-kernel, linux-kernel
  Cc: catalin.marinas, will.deacon, arnd, linux, daniel.lezcano, tglx,
	salyzyn, pcc, 0x7f454c46, linux, huw, sthotton, andre.przywara,
	luto, john.stultz, naohiro.aota, yamada.masahiro, Will Deacon

The recent changes to the vdso library for arm64 and the introduction of
the compat vdso library have generated some misalignment in the
Makefiles.

Cleanup the Makefiles for vdso and vdso32 libraries:
  * Removing unused rules.
  * Unifying the displayed compilation messages.
  * Simplifying the generic library inclusion path for
    arm64 vdso.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
 arch/arm64/kernel/vdso/Makefile   | 11 ++++-------
 arch/arm64/kernel/vdso32/Makefile | 10 +++++-----
 2 files changed, 9 insertions(+), 12 deletions(-)

diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
index 75d25679d879..aa5a12325a3c 100644
--- a/arch/arm64/kernel/vdso/Makefile
+++ b/arch/arm64/kernel/vdso/Makefile
@@ -32,10 +32,10 @@ UBSAN_SANITIZE			:= n
 OBJECT_FILES_NON_STANDARD	:= y
 KCOV_INSTRUMENT			:= n
 
-ifeq ($(c-gettimeofday-y),)
 CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny
-else
-CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -include $(c-gettimeofday-y)
+
+ifneq ($(c-gettimeofday-y),)
+  CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
 endif
 
 # Clang versions less than 8 do not support -mcmodel=tiny
@@ -73,10 +73,7 @@ include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE
 	$(call if_changed,vdsosym)
 
 # Actual build commands
-quiet_cmd_vdsocc = VDSOCC   $@
-      cmd_vdsocc = $(CC) $(a_flags) $(c_flags) -c -o $@ $<
-
-quiet_cmd_vdsold_and_vdso_check = LD      $@
+quiet_cmd_vdsold_and_vdso_check = VDSOLIB $@
       cmd_vdsold_and_vdso_check = $(cmd_ld); $(cmd_vdso_check)
 
 # Install commands for the unstripped file
diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
index 21009ed5a755..6c4e496309c4 100644
--- a/arch/arm64/kernel/vdso32/Makefile
+++ b/arch/arm64/kernel/vdso32/Makefile
@@ -155,17 +155,17 @@ $(asm-obj-vdso): %.o: %.S FORCE
 	$(call if_changed_dep,vdsoas)
 
 # Actual build commands
-quiet_cmd_vdsold_and_vdso_check = LD      $@
+quiet_cmd_vdsold_and_vdso_check = VDSOLIB $@
       cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check)
 
-quiet_cmd_vdsold = VDSOL   $@
+quiet_cmd_vdsold = VDSOLD  $@
       cmd_vdsold = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_LDFLAGS) \
                    -Wl,-T $(filter %.lds,$^) $(filter %.o,$^) -o $@
-quiet_cmd_vdsocc = VDSOC   $@
+quiet_cmd_vdsocc = CC      $@
       cmd_vdsocc = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_CFLAGS) -c -o $@ $<
-quiet_cmd_vdsocc_gettimeofday = VDSOC_GTD   $@
+quiet_cmd_vdsocc_gettimeofday = CC      $@
       cmd_vdsocc_gettimeofday = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_CFLAGS) $(VDSO_CFLAGS_gettimeofday_o) -c -o $@ $<
-quiet_cmd_vdsoas = VDSOA   $@
+quiet_cmd_vdsoas = AS      $@
       cmd_vdsoas = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_AFLAGS) -c -o $@ $<
 
 quiet_cmd_vdsomunge = MUNGE   $@
-- 
2.22.0


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

* Re: [PATCH] arm64: vdso: Cleanup Makefiles.
  2019-07-18 11:41     ` [PATCH] arm64: vdso: Cleanup Makefiles Vincenzo Frascino
@ 2019-07-19  8:04       ` Will Deacon
  2019-07-19  9:49         ` Vincenzo Frascino
  0 siblings, 1 reply; 14+ messages in thread
From: Will Deacon @ 2019-07-19  8:04 UTC (permalink / raw)
  To: Vincenzo Frascino
  Cc: linux-arch, linux-arm-kernel, linux-kernel, catalin.marinas,
	will.deacon, arnd, linux, daniel.lezcano, tglx, salyzyn, pcc,
	0x7f454c46, linux, huw, sthotton, andre.przywara, luto,
	john.stultz, naohiro.aota, yamada.masahiro

On Thu, Jul 18, 2019 at 12:41:21PM +0100, Vincenzo Frascino wrote:
> diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
> index 21009ed5a755..6c4e496309c4 100644
> --- a/arch/arm64/kernel/vdso32/Makefile
> +++ b/arch/arm64/kernel/vdso32/Makefile
> @@ -155,17 +155,17 @@ $(asm-obj-vdso): %.o: %.S FORCE
>  	$(call if_changed_dep,vdsoas)
>  
>  # Actual build commands
> -quiet_cmd_vdsold_and_vdso_check = LD      $@
> +quiet_cmd_vdsold_and_vdso_check = VDSOLIB $@
>        cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check)
>  
> -quiet_cmd_vdsold = VDSOL   $@
> +quiet_cmd_vdsold = VDSOLD  $@

I think we should be more consistent about whether or not we prefix things
with VDSO, so either go with "VDSOLD, VDSOCC and VDSOAS" or stick to "LD,
CC and AS" rather than mixing between them.

I think my suggestion would be something along the lines of CC, LD, AS for
the native vdso and CC32, LD32, AS32 for the compat vdso.

Will

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

* Re: [PATCH] arm64: vdso: Cleanup Makefiles.
  2019-07-19  8:04       ` Will Deacon
@ 2019-07-19  9:49         ` Vincenzo Frascino
  0 siblings, 0 replies; 14+ messages in thread
From: Vincenzo Frascino @ 2019-07-19  9:49 UTC (permalink / raw)
  To: Will Deacon
  Cc: linux-arch, linux-arm-kernel, linux-kernel, catalin.marinas,
	will.deacon, arnd, linux, daniel.lezcano, tglx, salyzyn, pcc,
	0x7f454c46, linux, huw, sthotton, andre.przywara, luto,
	john.stultz, naohiro.aota, yamada.masahiro

Hi Will,

On 19/07/2019 09:04, Will Deacon wrote:
> On Thu, Jul 18, 2019 at 12:41:21PM +0100, Vincenzo Frascino wrote:
>> diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
>> index 21009ed5a755..6c4e496309c4 100644
>> --- a/arch/arm64/kernel/vdso32/Makefile
>> +++ b/arch/arm64/kernel/vdso32/Makefile
>> @@ -155,17 +155,17 @@ $(asm-obj-vdso): %.o: %.S FORCE
>>  	$(call if_changed_dep,vdsoas)
>>  
>>  # Actual build commands
>> -quiet_cmd_vdsold_and_vdso_check = LD      $@
>> +quiet_cmd_vdsold_and_vdso_check = VDSOLIB $@
>>        cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check)
>>  
>> -quiet_cmd_vdsold = VDSOL   $@
>> +quiet_cmd_vdsold = VDSOLD  $@
> 
> I think we should be more consistent about whether or not we prefix things
> with VDSO, so either go with "VDSOLD, VDSOCC and VDSOAS" or stick to "LD,
> CC and AS" rather than mixing between them.
> 
> I think my suggestion would be something along the lines of CC, LD, AS for
> the native vdso and CC32, LD32, AS32 for the compat vdso.
> 

Sounds good. I will send v2 accordingly.

> Will
> 

-- 
Regards,
Vincenzo

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

* [PATCH v2] arm64: vdso: Cleanup Makefiles
  2019-07-12 15:37   ` Will Deacon
  2019-07-18 11:41     ` [PATCH] arm64: vdso: Cleanup Makefiles Vincenzo Frascino
@ 2019-07-19 10:10     ` Vincenzo Frascino
  2019-07-22  9:41       ` Will Deacon
  1 sibling, 1 reply; 14+ messages in thread
From: Vincenzo Frascino @ 2019-07-19 10:10 UTC (permalink / raw)
  To: linux-arch, linux-arm-kernel, linux-kernel
  Cc: catalin.marinas, will.deacon, arnd, linux, daniel.lezcano, tglx,
	salyzyn, pcc, 0x7f454c46, linux, huw, sthotton, andre.przywara,
	luto, john.stultz, naohiro.aota, yamada.masahiro, Will Deacon

The recent changes to the vdso library for arm64 and the introduction of
the compat vdso library have generated some misalignment in the
Makefiles.

Cleanup the Makefiles for vdso and vdso32 libraries:
  * Removing unused rules.
  * Unifying the displayed compilation messages.
  * Simplifying the generic library inclusion path for
    arm64 vdso.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
---
 arch/arm64/kernel/vdso/Makefile   |  9 +++------
 arch/arm64/kernel/vdso32/Makefile | 10 +++++-----
 2 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile
index 75d25679d879..dd2514bb1511 100644
--- a/arch/arm64/kernel/vdso/Makefile
+++ b/arch/arm64/kernel/vdso/Makefile
@@ -32,10 +32,10 @@ UBSAN_SANITIZE			:= n
 OBJECT_FILES_NON_STANDARD	:= y
 KCOV_INSTRUMENT			:= n
 
-ifeq ($(c-gettimeofday-y),)
 CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny
-else
-CFLAGS_vgettimeofday.o = -O2 -mcmodel=tiny -include $(c-gettimeofday-y)
+
+ifneq ($(c-gettimeofday-y),)
+  CFLAGS_vgettimeofday.o += -include $(c-gettimeofday-y)
 endif
 
 # Clang versions less than 8 do not support -mcmodel=tiny
@@ -73,9 +73,6 @@ include/generated/vdso-offsets.h: $(obj)/vdso.so.dbg FORCE
 	$(call if_changed,vdsosym)
 
 # Actual build commands
-quiet_cmd_vdsocc = VDSOCC   $@
-      cmd_vdsocc = $(CC) $(a_flags) $(c_flags) -c -o $@ $<
-
 quiet_cmd_vdsold_and_vdso_check = LD      $@
       cmd_vdsold_and_vdso_check = $(cmd_ld); $(cmd_vdso_check)
 
diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
index 21009ed5a755..154767d60001 100644
--- a/arch/arm64/kernel/vdso32/Makefile
+++ b/arch/arm64/kernel/vdso32/Makefile
@@ -155,17 +155,17 @@ $(asm-obj-vdso): %.o: %.S FORCE
 	$(call if_changed_dep,vdsoas)
 
 # Actual build commands
-quiet_cmd_vdsold_and_vdso_check = LD      $@
+quiet_cmd_vdsold_and_vdso_check = LD32    $@
       cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check)
 
-quiet_cmd_vdsold = VDSOL   $@
+quiet_cmd_vdsold = LD32    $@
       cmd_vdsold = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_LDFLAGS) \
                    -Wl,-T $(filter %.lds,$^) $(filter %.o,$^) -o $@
-quiet_cmd_vdsocc = VDSOC   $@
+quiet_cmd_vdsocc = CC32    $@
       cmd_vdsocc = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_CFLAGS) -c -o $@ $<
-quiet_cmd_vdsocc_gettimeofday = VDSOC_GTD   $@
+quiet_cmd_vdsocc_gettimeofday = CC32    $@
       cmd_vdsocc_gettimeofday = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_CFLAGS) $(VDSO_CFLAGS_gettimeofday_o) -c -o $@ $<
-quiet_cmd_vdsoas = VDSOA   $@
+quiet_cmd_vdsoas = AS32    $@
       cmd_vdsoas = $(COMPATCC) -Wp,-MD,$(depfile) $(VDSO_AFLAGS) -c -o $@ $<
 
 quiet_cmd_vdsomunge = MUNGE   $@
-- 
2.22.0


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

* Re: [PATCH v2] arm64: vdso: Cleanup Makefiles
  2019-07-19 10:10     ` [PATCH v2] " Vincenzo Frascino
@ 2019-07-22  9:41       ` Will Deacon
  0 siblings, 0 replies; 14+ messages in thread
From: Will Deacon @ 2019-07-22  9:41 UTC (permalink / raw)
  To: Vincenzo Frascino
  Cc: linux-arch, linux-arm-kernel, linux-kernel, catalin.marinas,
	will.deacon, arnd, linux, daniel.lezcano, tglx, salyzyn, pcc,
	0x7f454c46, linux, huw, sthotton, andre.przywara, luto,
	john.stultz, naohiro.aota, yamada.masahiro

On Fri, Jul 19, 2019 at 11:10:18AM +0100, Vincenzo Frascino wrote:
> The recent changes to the vdso library for arm64 and the introduction of
> the compat vdso library have generated some misalignment in the
> Makefiles.
> 
> Cleanup the Makefiles for vdso and vdso32 libraries:
>   * Removing unused rules.
>   * Unifying the displayed compilation messages.
>   * Simplifying the generic library inclusion path for
>     arm64 vdso.
> 
> Cc: Catalin Marinas <catalin.marinas@arm.com>
> Cc: Will Deacon <will@kernel.org>
> Signed-off-by: Vincenzo Frascino <vincenzo.frascino@arm.com>
> ---
>  arch/arm64/kernel/vdso/Makefile   |  9 +++------
>  arch/arm64/kernel/vdso32/Makefile | 10 +++++-----
>  2 files changed, 8 insertions(+), 11 deletions(-)

Thanks, I'll queue this for -rc2.

Will

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

end of thread, other threads:[~2019-07-22  9:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-12 10:15 [PATCH v2 1/2] x86/vdso: fix flip/flop vdso build bug Naohiro Aota
2019-07-12 10:15 ` [PATCH v2 2/2] arm64/vdso: " Naohiro Aota
2019-07-12 12:06   ` [PATCH] arm64: compat: Fix flip/flop vdso building bug Vincenzo Frascino
2019-07-12 12:10   ` [PATCH v2 2/2] arm64/vdso: fix flip/flop vdso build bug Vincenzo Frascino
2019-07-12 14:55   ` Masahiro Yamada
2019-07-12 15:37   ` Will Deacon
2019-07-18 11:41     ` [PATCH] arm64: vdso: Cleanup Makefiles Vincenzo Frascino
2019-07-19  8:04       ` Will Deacon
2019-07-19  9:49         ` Vincenzo Frascino
2019-07-19 10:10     ` [PATCH v2] " Vincenzo Frascino
2019-07-22  9:41       ` Will Deacon
2019-07-12 12:09 ` [PATCH v2 1/2] x86/vdso: fix flip/flop vdso build bug Vincenzo Frascino
2019-07-12 14:54 ` Masahiro Yamada
2019-07-12 15:41 ` [tip:x86/urgent] x86/vdso: Fix " tip-bot for Naohiro Aota

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