mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/4] x86: vdso: clean up vdso Makefile
@ 2023-11-21 23:56 Masahiro Yamada
  2023-11-21 23:56 ` [PATCH 1/4] x86: vdso: consolidate targets and clean-files Masahiro Yamada
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Masahiro Yamada @ 2023-11-21 23:56 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86
  Cc: Masahiro Yamada, Andy Lutomirski, H. Peter Anvin, linux-kernel




Masahiro Yamada (4):
  x86: vdso: consolidate targets and clean-files
  x86: vdso: simplify obj-y addition
  x86: vdso: use $(addprefix ) instead of $(foreach )
  x86: vdso: use CONFIG_COMPAT_32 to specify vdso32

 arch/x86/Makefile            |  3 +--
 arch/x86/entry/vdso/Makefile | 28 +++++++---------------------
 2 files changed, 8 insertions(+), 23 deletions(-)

-- 
2.40.1


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

* [PATCH 1/4] x86: vdso: consolidate targets and clean-files
  2023-11-21 23:56 [PATCH 0/4] x86: vdso: clean up vdso Makefile Masahiro Yamada
@ 2023-11-21 23:56 ` Masahiro Yamada
  2024-02-08 13:04   ` [tip: x86/vdso] x86/vdso: Consolidate " tip-bot2 for Masahiro Yamada
  2023-11-21 23:56 ` [PATCH 2/4] x86: vdso: simplify obj-y addition Masahiro Yamada
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2023-11-21 23:56 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86
  Cc: Masahiro Yamada, Andy Lutomirski, H. Peter Anvin, linux-kernel

'targets' and 'clean-files' do not need to list the same files because
the files listed in 'targets' are cleaned up.

Refactor the code.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index b1b8dd1608f7..2038d9c8e527 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -55,11 +55,8 @@ targets += vdso32/vdso32.lds $(vobjs32-y)
 
 # Build the vDSO image C files and link them in.
 vdso_img_objs := $(vdso_img-y:%=vdso-image-%.o)
-vdso_img_cfiles := $(vdso_img-y:%=vdso-image-%.c)
-vdso_img_sodbg := $(vdso_img-y:%=vdso%.so.dbg)
 obj-y += $(vdso_img_objs)
-targets += $(vdso_img_cfiles)
-targets += $(vdso_img_sodbg) $(vdso_img-y:%=vdso%.so)
+targets += $(foreach x, 64 x32 32, vdso-image-$(x).c vdso$(x).so vdso$(x).so.dbg)
 
 CPPFLAGS_vdso.lds += -P -C
 
@@ -190,5 +187,3 @@ GCOV_PROFILE := n
 
 quiet_cmd_vdso_and_check = VDSO    $@
       cmd_vdso_and_check = $(cmd_vdso); $(cmd_vdso_check)
-
-clean-files := vdso32.so vdso32.so.dbg vdso64* vdso-image-*.c vdsox32.so*
-- 
2.40.1


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

* [PATCH 2/4] x86: vdso: simplify obj-y addition
  2023-11-21 23:56 [PATCH 0/4] x86: vdso: clean up vdso Makefile Masahiro Yamada
  2023-11-21 23:56 ` [PATCH 1/4] x86: vdso: consolidate targets and clean-files Masahiro Yamada
@ 2023-11-21 23:56 ` Masahiro Yamada
  2024-02-08 13:04   ` [tip: x86/vdso] x86/vdso: Simplify " tip-bot2 for Masahiro Yamada
  2023-11-21 23:57 ` [PATCH 3/4] x86: vdso: use $(addprefix ) instead of $(foreach ) Masahiro Yamada
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2023-11-21 23:56 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86
  Cc: Masahiro Yamada, Andy Lutomirski, H. Peter Anvin, linux-kernel

Add objects to obj-y in a more straightforward way.

CONFIG_X86_32 and CONFIG_IA32_EMULATION are not enabled simultaneously,
but even if they are, Kbuild graciously deduplicates obj-y entries.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index 2038d9c8e527..cbfb5aab5e9c 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -18,11 +18,6 @@ OBJECT_FILES_NON_STANDARD	:= y
 # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
 KCOV_INSTRUMENT		:= n
 
-VDSO64-$(CONFIG_X86_64)		:= y
-VDSOX32-$(CONFIG_X86_X32_ABI)	:= y
-VDSO32-$(CONFIG_X86_32)		:= y
-VDSO32-$(CONFIG_IA32_EMULATION)	:= y
-
 # files to link into the vdso
 vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o
 vobjs32-y := vdso32/note.o vdso32/system_call.o vdso32/sigreturn.o
@@ -38,11 +33,11 @@ OBJECT_FILES_NON_STANDARD_vma.o		:= n
 OBJECT_FILES_NON_STANDARD_extable.o	:= n
 
 # vDSO images to build
-vdso_img-$(VDSO64-y)		+= 64
-vdso_img-$(VDSOX32-y)		+= x32
-vdso_img-$(VDSO32-y)		+= 32
+obj-$(CONFIG_X86_64)		+= vdso-image-64.o
+obj-$(CONFIG_X86_X32_ABI)	+= vdso-image-x32.o
+obj-$(CONFIG_X86_32)		+= vdso-image-32.o vdso32-setup.o
+obj-$(CONFIG_IA32_EMULATION)	+= vdso-image-32.o vdso32-setup.o
 
-obj-$(VDSO32-y)				 += vdso32-setup.o
 OBJECT_FILES_NON_STANDARD_vdso32-setup.o := n
 
 vobjs := $(foreach F,$(vobjs-y),$(obj)/$F)
@@ -53,9 +48,6 @@ $(obj)/vdso.o: $(obj)/vdso.so
 targets += vdso.lds $(vobjs-y)
 targets += vdso32/vdso32.lds $(vobjs32-y)
 
-# Build the vDSO image C files and link them in.
-vdso_img_objs := $(vdso_img-y:%=vdso-image-%.o)
-obj-y += $(vdso_img_objs)
 targets += $(foreach x, 64 x32 32, vdso-image-$(x).c vdso$(x).so vdso$(x).so.dbg)
 
 CPPFLAGS_vdso.lds += -P -C
-- 
2.40.1


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

* [PATCH 3/4] x86: vdso: use $(addprefix ) instead of $(foreach )
  2023-11-21 23:56 [PATCH 0/4] x86: vdso: clean up vdso Makefile Masahiro Yamada
  2023-11-21 23:56 ` [PATCH 1/4] x86: vdso: consolidate targets and clean-files Masahiro Yamada
  2023-11-21 23:56 ` [PATCH 2/4] x86: vdso: simplify obj-y addition Masahiro Yamada
@ 2023-11-21 23:57 ` Masahiro Yamada
  2024-02-08 13:04   ` [tip: x86/vdso] x86/vdso: Use " tip-bot2 for Masahiro Yamada
  2023-11-21 23:57 ` [PATCH 4/4] x86: vdso: use CONFIG_COMPAT_32 to specify vdso32 Masahiro Yamada
  2024-02-02 15:56 ` [PATCH 0/4] x86: vdso: clean up vdso Makefile Masahiro Yamada
  4 siblings, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2023-11-21 23:57 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86
  Cc: Masahiro Yamada, Andy Lutomirski, H. Peter Anvin, linux-kernel

$(addprefix ) is slightly shorter and more intuitive.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

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

diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index cbfb5aab5e9c..439b52772e69 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -40,8 +40,8 @@ obj-$(CONFIG_IA32_EMULATION)	+= vdso-image-32.o vdso32-setup.o
 
 OBJECT_FILES_NON_STANDARD_vdso32-setup.o := n
 
-vobjs := $(foreach F,$(vobjs-y),$(obj)/$F)
-vobjs32 := $(foreach F,$(vobjs32-y),$(obj)/$F)
+vobjs := $(addprefix $(obj)/, $(vobjs-y))
+vobjs32 := $(addprefix $(obj)/, $(vobjs32-y))
 
 $(obj)/vdso.o: $(obj)/vdso.so
 
@@ -112,7 +112,7 @@ VDSO_LDFLAGS_vdsox32.lds = -m elf32_x86_64 -soname linux-vdso.so.1 \
 vobjx32s-y := $(vobjs-y:.o=-x32.o)
 
 # same thing, but in the output directory
-vobjx32s := $(foreach F,$(vobjx32s-y),$(obj)/$F)
+vobjx32s := $(addprefix $(obj)/, $(vobjx32s-y))
 
 # Convert 64bit object file to x32 for x32 vDSO.
 quiet_cmd_x32 = X32     $@
-- 
2.40.1


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

* [PATCH 4/4] x86: vdso: use CONFIG_COMPAT_32 to specify vdso32
  2023-11-21 23:56 [PATCH 0/4] x86: vdso: clean up vdso Makefile Masahiro Yamada
                   ` (2 preceding siblings ...)
  2023-11-21 23:57 ` [PATCH 3/4] x86: vdso: use $(addprefix ) instead of $(foreach ) Masahiro Yamada
@ 2023-11-21 23:57 ` Masahiro Yamada
  2024-02-08 13:04   ` [tip: x86/vdso] x86/vdso: Use " tip-bot2 for Masahiro Yamada
  2024-02-02 15:56 ` [PATCH 0/4] x86: vdso: clean up vdso Makefile Masahiro Yamada
  4 siblings, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2023-11-21 23:57 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86
  Cc: Masahiro Yamada, Andy Lutomirski, H. Peter Anvin, linux-kernel

In arch/x86/Kconfig, COMPAT_32 is defined as (IA32_EMULATION || X86_32).
Use it to eliminate redundancy in Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 arch/x86/Makefile            | 3 +--
 arch/x86/entry/vdso/Makefile | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 1a068de12a56..0899e71ddcc6 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -296,8 +296,7 @@ install:
 
 vdso-install-$(CONFIG_X86_64)		+= arch/x86/entry/vdso/vdso64.so.dbg
 vdso-install-$(CONFIG_X86_X32_ABI)	+= arch/x86/entry/vdso/vdsox32.so.dbg
-vdso-install-$(CONFIG_X86_32)		+= arch/x86/entry/vdso/vdso32.so.dbg
-vdso-install-$(CONFIG_IA32_EMULATION)	+= arch/x86/entry/vdso/vdso32.so.dbg
+vdso-install-$(CONFIG_COMPAT_32)	+= arch/x86/entry/vdso/vdso32.so.dbg
 
 archprepare: checkbin
 checkbin:
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index 439b52772e69..7a97b17f28b7 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -35,8 +35,7 @@ OBJECT_FILES_NON_STANDARD_extable.o	:= n
 # vDSO images to build
 obj-$(CONFIG_X86_64)		+= vdso-image-64.o
 obj-$(CONFIG_X86_X32_ABI)	+= vdso-image-x32.o
-obj-$(CONFIG_X86_32)		+= vdso-image-32.o vdso32-setup.o
-obj-$(CONFIG_IA32_EMULATION)	+= vdso-image-32.o vdso32-setup.o
+obj-$(CONFIG_COMPAT_32)		+= vdso-image-32.o vdso32-setup.o
 
 OBJECT_FILES_NON_STANDARD_vdso32-setup.o := n
 
-- 
2.40.1


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

* Re: [PATCH 0/4] x86: vdso: clean up vdso Makefile
  2023-11-21 23:56 [PATCH 0/4] x86: vdso: clean up vdso Makefile Masahiro Yamada
                   ` (3 preceding siblings ...)
  2023-11-21 23:57 ` [PATCH 4/4] x86: vdso: use CONFIG_COMPAT_32 to specify vdso32 Masahiro Yamada
@ 2024-02-02 15:56 ` Masahiro Yamada
  2024-02-07  8:24   ` Borislav Petkov
  4 siblings, 1 reply; 11+ messages in thread
From: Masahiro Yamada @ 2024-02-02 15:56 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, Dave Hansen, x86
  Cc: Andy Lutomirski, H. Peter Anvin, linux-kernel

Hi x86 maintainers,


Gentle ping.

It has been more than 2 months since the submission.



On Wed, Nov 22, 2023 at 8:57 AM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
>
>
>
> Masahiro Yamada (4):
>   x86: vdso: consolidate targets and clean-files
>   x86: vdso: simplify obj-y addition
>   x86: vdso: use $(addprefix ) instead of $(foreach )
>   x86: vdso: use CONFIG_COMPAT_32 to specify vdso32
>
>  arch/x86/Makefile            |  3 +--
>  arch/x86/entry/vdso/Makefile | 28 +++++++---------------------
>  2 files changed, 8 insertions(+), 23 deletions(-)
>
> --
> 2.40.1
>


-- 
Best Regards
Masahiro Yamada

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

* Re: [PATCH 0/4] x86: vdso: clean up vdso Makefile
  2024-02-02 15:56 ` [PATCH 0/4] x86: vdso: clean up vdso Makefile Masahiro Yamada
@ 2024-02-07  8:24   ` Borislav Petkov
  0 siblings, 0 replies; 11+ messages in thread
From: Borislav Petkov @ 2024-02-07  8:24 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: Thomas Gleixner, Ingo Molnar, Dave Hansen, x86, Andy Lutomirski,
	H. Peter Anvin, linux-kernel

On Sat, Feb 03, 2024 at 12:56:22AM +0900, Masahiro Yamada wrote:
> Hi x86 maintainers,
> 
> 
> Gentle ping.
> 
> It has been more than 2 months since the submission.

Lemme have a look.

-- 
Regards/Gruss,
    Boris.

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

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

* [tip: x86/vdso] x86/vdso: Use CONFIG_COMPAT_32 to specify vdso32
  2023-11-21 23:57 ` [PATCH 4/4] x86: vdso: use CONFIG_COMPAT_32 to specify vdso32 Masahiro Yamada
@ 2024-02-08 13:04   ` tip-bot2 for Masahiro Yamada
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot2 for Masahiro Yamada @ 2024-02-08 13:04 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Masahiro Yamada, Borislav Petkov (AMD), x86, linux-kernel

The following commit has been merged into the x86/vdso branch of tip:

Commit-ID:     289d0a475c3e5be42315376d08e0457350fb8e9c
Gitweb:        https://git.kernel.org/tip/289d0a475c3e5be42315376d08e0457350fb8e9c
Author:        Masahiro Yamada <masahiroy@kernel.org>
AuthorDate:    Wed, 22 Nov 2023 08:57:01 +09:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Thu, 08 Feb 2024 13:23:14 +01:00

x86/vdso: Use CONFIG_COMPAT_32 to specify vdso32

In arch/x86/Kconfig, COMPAT_32 is defined as (IA32_EMULATION || X86_32).
Use it to eliminate redundancy in Makefile.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20231121235701.239606-5-masahiroy@kernel.org
---
 arch/x86/Makefile            | 3 +--
 arch/x86/entry/vdso/Makefile | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 2264db1..f2260ac 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -296,8 +296,7 @@ install:
 
 vdso-install-$(CONFIG_X86_64)		+= arch/x86/entry/vdso/vdso64.so.dbg
 vdso-install-$(CONFIG_X86_X32_ABI)	+= arch/x86/entry/vdso/vdsox32.so.dbg
-vdso-install-$(CONFIG_X86_32)		+= arch/x86/entry/vdso/vdso32.so.dbg
-vdso-install-$(CONFIG_IA32_EMULATION)	+= arch/x86/entry/vdso/vdso32.so.dbg
+vdso-install-$(CONFIG_COMPAT_32)	+= arch/x86/entry/vdso/vdso32.so.dbg
 
 archprepare: checkbin
 checkbin:
diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index 439b527..7a97b17 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -35,8 +35,7 @@ OBJECT_FILES_NON_STANDARD_extable.o	:= n
 # vDSO images to build
 obj-$(CONFIG_X86_64)		+= vdso-image-64.o
 obj-$(CONFIG_X86_X32_ABI)	+= vdso-image-x32.o
-obj-$(CONFIG_X86_32)		+= vdso-image-32.o vdso32-setup.o
-obj-$(CONFIG_IA32_EMULATION)	+= vdso-image-32.o vdso32-setup.o
+obj-$(CONFIG_COMPAT_32)		+= vdso-image-32.o vdso32-setup.o
 
 OBJECT_FILES_NON_STANDARD_vdso32-setup.o := n
 

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

* [tip: x86/vdso] x86/vdso: Use $(addprefix ) instead of $(foreach )
  2023-11-21 23:57 ` [PATCH 3/4] x86: vdso: use $(addprefix ) instead of $(foreach ) Masahiro Yamada
@ 2024-02-08 13:04   ` tip-bot2 for Masahiro Yamada
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot2 for Masahiro Yamada @ 2024-02-08 13:04 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Masahiro Yamada, Borislav Petkov (AMD), x86, linux-kernel

The following commit has been merged into the x86/vdso branch of tip:

Commit-ID:     ac9275b3b4dd11a1c825071b9dbaf7614a399c89
Gitweb:        https://git.kernel.org/tip/ac9275b3b4dd11a1c825071b9dbaf7614a399c89
Author:        Masahiro Yamada <masahiroy@kernel.org>
AuthorDate:    Wed, 22 Nov 2023 08:57:00 +09:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Thu, 08 Feb 2024 13:23:01 +01:00

x86/vdso: Use $(addprefix ) instead of $(foreach )

$(addprefix ) is slightly shorter and more intuitive.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20231121235701.239606-4-masahiroy@kernel.org
---
 arch/x86/entry/vdso/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index cbfb5aa..439b527 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -40,8 +40,8 @@ obj-$(CONFIG_IA32_EMULATION)	+= vdso-image-32.o vdso32-setup.o
 
 OBJECT_FILES_NON_STANDARD_vdso32-setup.o := n
 
-vobjs := $(foreach F,$(vobjs-y),$(obj)/$F)
-vobjs32 := $(foreach F,$(vobjs32-y),$(obj)/$F)
+vobjs := $(addprefix $(obj)/, $(vobjs-y))
+vobjs32 := $(addprefix $(obj)/, $(vobjs32-y))
 
 $(obj)/vdso.o: $(obj)/vdso.so
 
@@ -112,7 +112,7 @@ VDSO_LDFLAGS_vdsox32.lds = -m elf32_x86_64 -soname linux-vdso.so.1 \
 vobjx32s-y := $(vobjs-y:.o=-x32.o)
 
 # same thing, but in the output directory
-vobjx32s := $(foreach F,$(vobjx32s-y),$(obj)/$F)
+vobjx32s := $(addprefix $(obj)/, $(vobjx32s-y))
 
 # Convert 64bit object file to x32 for x32 vDSO.
 quiet_cmd_x32 = X32     $@

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

* [tip: x86/vdso] x86/vdso: Simplify obj-y addition
  2023-11-21 23:56 ` [PATCH 2/4] x86: vdso: simplify obj-y addition Masahiro Yamada
@ 2024-02-08 13:04   ` tip-bot2 for Masahiro Yamada
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot2 for Masahiro Yamada @ 2024-02-08 13:04 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Masahiro Yamada, Borislav Petkov (AMD), x86, linux-kernel

The following commit has been merged into the x86/vdso branch of tip:

Commit-ID:     329b77b59f83440e98d792800501e5a398806860
Gitweb:        https://git.kernel.org/tip/329b77b59f83440e98d792800501e5a398806860
Author:        Masahiro Yamada <masahiroy@kernel.org>
AuthorDate:    Wed, 22 Nov 2023 08:56:59 +09:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Thu, 08 Feb 2024 13:22:08 +01:00

x86/vdso: Simplify obj-y addition

Add objects to obj-y in a more straightforward way.

CONFIG_X86_32 and CONFIG_IA32_EMULATION are not enabled simultaneously,
but even if they are, Kbuild graciously deduplicates obj-y entries.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20231121235701.239606-3-masahiroy@kernel.org
---
 arch/x86/entry/vdso/Makefile | 16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index 2038d9c..cbfb5aa 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -18,11 +18,6 @@ OBJECT_FILES_NON_STANDARD	:= y
 # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in.
 KCOV_INSTRUMENT		:= n
 
-VDSO64-$(CONFIG_X86_64)		:= y
-VDSOX32-$(CONFIG_X86_X32_ABI)	:= y
-VDSO32-$(CONFIG_X86_32)		:= y
-VDSO32-$(CONFIG_IA32_EMULATION)	:= y
-
 # files to link into the vdso
 vobjs-y := vdso-note.o vclock_gettime.o vgetcpu.o
 vobjs32-y := vdso32/note.o vdso32/system_call.o vdso32/sigreturn.o
@@ -38,11 +33,11 @@ OBJECT_FILES_NON_STANDARD_vma.o		:= n
 OBJECT_FILES_NON_STANDARD_extable.o	:= n
 
 # vDSO images to build
-vdso_img-$(VDSO64-y)		+= 64
-vdso_img-$(VDSOX32-y)		+= x32
-vdso_img-$(VDSO32-y)		+= 32
+obj-$(CONFIG_X86_64)		+= vdso-image-64.o
+obj-$(CONFIG_X86_X32_ABI)	+= vdso-image-x32.o
+obj-$(CONFIG_X86_32)		+= vdso-image-32.o vdso32-setup.o
+obj-$(CONFIG_IA32_EMULATION)	+= vdso-image-32.o vdso32-setup.o
 
-obj-$(VDSO32-y)				 += vdso32-setup.o
 OBJECT_FILES_NON_STANDARD_vdso32-setup.o := n
 
 vobjs := $(foreach F,$(vobjs-y),$(obj)/$F)
@@ -53,9 +48,6 @@ $(obj)/vdso.o: $(obj)/vdso.so
 targets += vdso.lds $(vobjs-y)
 targets += vdso32/vdso32.lds $(vobjs32-y)
 
-# Build the vDSO image C files and link them in.
-vdso_img_objs := $(vdso_img-y:%=vdso-image-%.o)
-obj-y += $(vdso_img_objs)
 targets += $(foreach x, 64 x32 32, vdso-image-$(x).c vdso$(x).so vdso$(x).so.dbg)
 
 CPPFLAGS_vdso.lds += -P -C

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

* [tip: x86/vdso] x86/vdso: Consolidate targets and clean-files
  2023-11-21 23:56 ` [PATCH 1/4] x86: vdso: consolidate targets and clean-files Masahiro Yamada
@ 2024-02-08 13:04   ` tip-bot2 for Masahiro Yamada
  0 siblings, 0 replies; 11+ messages in thread
From: tip-bot2 for Masahiro Yamada @ 2024-02-08 13:04 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Masahiro Yamada, Borislav Petkov (AMD), x86, linux-kernel

The following commit has been merged into the x86/vdso branch of tip:

Commit-ID:     31a4ebee0d16a141b18730977963d0e7290b9bd2
Gitweb:        https://git.kernel.org/tip/31a4ebee0d16a141b18730977963d0e7290b9bd2
Author:        Masahiro Yamada <masahiroy@kernel.org>
AuthorDate:    Wed, 22 Nov 2023 08:56:58 +09:00
Committer:     Borislav Petkov (AMD) <bp@alien8.de>
CommitterDate: Thu, 08 Feb 2024 13:15:41 +01:00

x86/vdso: Consolidate targets and clean-files

'targets' and 'clean-files' do not need to list the same files because
the files listed in 'targets' are cleaned up.

Refactor the code.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/r/20231121235701.239606-2-masahiroy@kernel.org
---
 arch/x86/entry/vdso/Makefile | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/arch/x86/entry/vdso/Makefile b/arch/x86/entry/vdso/Makefile
index b1b8dd1..2038d9c 100644
--- a/arch/x86/entry/vdso/Makefile
+++ b/arch/x86/entry/vdso/Makefile
@@ -55,11 +55,8 @@ targets += vdso32/vdso32.lds $(vobjs32-y)
 
 # Build the vDSO image C files and link them in.
 vdso_img_objs := $(vdso_img-y:%=vdso-image-%.o)
-vdso_img_cfiles := $(vdso_img-y:%=vdso-image-%.c)
-vdso_img_sodbg := $(vdso_img-y:%=vdso%.so.dbg)
 obj-y += $(vdso_img_objs)
-targets += $(vdso_img_cfiles)
-targets += $(vdso_img_sodbg) $(vdso_img-y:%=vdso%.so)
+targets += $(foreach x, 64 x32 32, vdso-image-$(x).c vdso$(x).so vdso$(x).so.dbg)
 
 CPPFLAGS_vdso.lds += -P -C
 
@@ -190,5 +187,3 @@ GCOV_PROFILE := n
 
 quiet_cmd_vdso_and_check = VDSO    $@
       cmd_vdso_and_check = $(cmd_vdso); $(cmd_vdso_check)
-
-clean-files := vdso32.so vdso32.so.dbg vdso64* vdso-image-*.c vdsox32.so*

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

end of thread, other threads:[~2024-02-08 13:04 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21 23:56 [PATCH 0/4] x86: vdso: clean up vdso Makefile Masahiro Yamada
2023-11-21 23:56 ` [PATCH 1/4] x86: vdso: consolidate targets and clean-files Masahiro Yamada
2024-02-08 13:04   ` [tip: x86/vdso] x86/vdso: Consolidate " tip-bot2 for Masahiro Yamada
2023-11-21 23:56 ` [PATCH 2/4] x86: vdso: simplify obj-y addition Masahiro Yamada
2024-02-08 13:04   ` [tip: x86/vdso] x86/vdso: Simplify " tip-bot2 for Masahiro Yamada
2023-11-21 23:57 ` [PATCH 3/4] x86: vdso: use $(addprefix ) instead of $(foreach ) Masahiro Yamada
2024-02-08 13:04   ` [tip: x86/vdso] x86/vdso: Use " tip-bot2 for Masahiro Yamada
2023-11-21 23:57 ` [PATCH 4/4] x86: vdso: use CONFIG_COMPAT_32 to specify vdso32 Masahiro Yamada
2024-02-08 13:04   ` [tip: x86/vdso] x86/vdso: Use " tip-bot2 for Masahiro Yamada
2024-02-02 15:56 ` [PATCH 0/4] x86: vdso: clean up vdso Makefile Masahiro Yamada
2024-02-07  8:24   ` Borislav Petkov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®