From nobody Wed Dec 17 20:40:13 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 39669C61D98 for ; Tue, 21 Nov 2023 23:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234938AbjKUX5T (ORCPT ); Tue, 21 Nov 2023 18:57:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234703AbjKUX5O (ORCPT ); Tue, 21 Nov 2023 18:57:14 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA9B21A2 for ; Tue, 21 Nov 2023 15:57:10 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 044C8C433CB; Tue, 21 Nov 2023 23:57:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700611030; bh=YIz9IynczYR7U90yH62Boq0adsyZcqNtIbOqQHRnXxQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AECmMPUzvp8OXYGuSbkcsiIb34EBjISMOkmWB2e0PFYP0yRrPV111M7GOBfowZNN9 up76BEiuiYJqSAR34fIl/dpeV+M26AGqlNgIZ7weQvatRSoSNPHb3QmAgVL+NwA7V5 kbxf7LyKTuUlSZ2k1FnPL1qQlEpdpaICq0hfnIxKsk1srhCMPrZuW3Gs4wTfFhGaBk 1XdJ2mBbU8cpu56+aOe41iJTYfvsUDQQ7WyE/tpkmg0hE0B7635Pib6QFRcFp2APo6 9JLgWVBezkbY/5MKejlBvALX+U4PPadgpAjAyNoIGOLgl8yYOcCE0I2RDhYOzISAHP cBXqqqbqpFBjg== From: Masahiro Yamada To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: Masahiro Yamada , Andy Lutomirski , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: [PATCH 1/4] x86: vdso: consolidate targets and clean-files Date: Wed, 22 Nov 2023 08:56:58 +0900 Message-Id: <20231121235701.239606-2-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231121235701.239606-1-masahiroy@kernel.org> References: <20231121235701.239606-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" '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 --- 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 +=3D vdso32/vdso32.lds $(vobjs32-y) =20 # Build the vDSO image C files and link them in. vdso_img_objs :=3D $(vdso_img-y:%=3Dvdso-image-%.o) -vdso_img_cfiles :=3D $(vdso_img-y:%=3Dvdso-image-%.c) -vdso_img_sodbg :=3D $(vdso_img-y:%=3Dvdso%.so.dbg) obj-y +=3D $(vdso_img_objs) -targets +=3D $(vdso_img_cfiles) -targets +=3D $(vdso_img_sodbg) $(vdso_img-y:%=3Dvdso%.so) +targets +=3D $(foreach x, 64 x32 32, vdso-image-$(x).c vdso$(x).so vdso$(x= ).so.dbg) =20 CPPFLAGS_vdso.lds +=3D -P -C =20 @@ -190,5 +187,3 @@ GCOV_PROFILE :=3D n =20 quiet_cmd_vdso_and_check =3D VDSO $@ cmd_vdso_and_check =3D $(cmd_vdso); $(cmd_vdso_check) - -clean-files :=3D vdso32.so vdso32.so.dbg vdso64* vdso-image-*.c vdsox32.so* --=20 2.40.1 From nobody Wed Dec 17 20:40:13 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22AAEC61D85 for ; Tue, 21 Nov 2023 23:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234962AbjKUX5X (ORCPT ); Tue, 21 Nov 2023 18:57:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234933AbjKUX5Q (ORCPT ); Tue, 21 Nov 2023 18:57:16 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD40CE7 for ; Tue, 21 Nov 2023 15:57:12 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DA1C7C433C9; Tue, 21 Nov 2023 23:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700611032; bh=PgDod9JVK1SlTO6PB/we26pgwxZ6Hugtd6ddfhtvips=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=P5Oqx2adFYIoQ9k4t/Fy/+5td7AJw0Ktf33vV/fGcP8SzAfragsJVRdICPCn1rAiq DY+8pX8mR5/DxUtJobAPYiON00qCGoJvj2BP+5n2et1TWEtFdgFs7egce9cUf+jEoM QuJAxXvWLW5r0KMCYoemcPkKHSz6roL/PrJIA8KHkR+/mWH94Fs+p2YMq8QI05E6ou s/mPI0QIWI4BLxziJ6Est+vJPCMnCuC9lG/Og/BKs8zJ3RLi+amuJSo3nbUqiRZ5bi rhC+VekE2qEghO/hzfZWrvY282W1JlDo00ewShT6Eo4W3aeFl1AH+6vr3odn1i+x/i lKcGM2Gr47bOg== From: Masahiro Yamada To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: Masahiro Yamada , Andy Lutomirski , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: [PATCH 2/4] x86: vdso: simplify obj-y addition Date: Wed, 22 Nov 2023 08:56:59 +0900 Message-Id: <20231121235701.239606-3-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231121235701.239606-1-masahiroy@kernel.org> References: <20231121235701.239606-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 --- 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 :=3D y # Prevents link failures: __sanitizer_cov_trace_pc() is not linked in. KCOV_INSTRUMENT :=3D n =20 -VDSO64-$(CONFIG_X86_64) :=3D y -VDSOX32-$(CONFIG_X86_X32_ABI) :=3D y -VDSO32-$(CONFIG_X86_32) :=3D y -VDSO32-$(CONFIG_IA32_EMULATION) :=3D y - # files to link into the vdso vobjs-y :=3D vdso-note.o vclock_gettime.o vgetcpu.o vobjs32-y :=3D vdso32/note.o vdso32/system_call.o vdso32/sigreturn.o @@ -38,11 +33,11 @@ OBJECT_FILES_NON_STANDARD_vma.o :=3D n OBJECT_FILES_NON_STANDARD_extable.o :=3D n =20 # vDSO images to build -vdso_img-$(VDSO64-y) +=3D 64 -vdso_img-$(VDSOX32-y) +=3D x32 -vdso_img-$(VDSO32-y) +=3D 32 +obj-$(CONFIG_X86_64) +=3D vdso-image-64.o +obj-$(CONFIG_X86_X32_ABI) +=3D vdso-image-x32.o +obj-$(CONFIG_X86_32) +=3D vdso-image-32.o vdso32-setup.o +obj-$(CONFIG_IA32_EMULATION) +=3D vdso-image-32.o vdso32-setup.o =20 -obj-$(VDSO32-y) +=3D vdso32-setup.o OBJECT_FILES_NON_STANDARD_vdso32-setup.o :=3D n =20 vobjs :=3D $(foreach F,$(vobjs-y),$(obj)/$F) @@ -53,9 +48,6 @@ $(obj)/vdso.o: $(obj)/vdso.so targets +=3D vdso.lds $(vobjs-y) targets +=3D vdso32/vdso32.lds $(vobjs32-y) =20 -# Build the vDSO image C files and link them in. -vdso_img_objs :=3D $(vdso_img-y:%=3Dvdso-image-%.o) -obj-y +=3D $(vdso_img_objs) targets +=3D $(foreach x, 64 x32 32, vdso-image-$(x).c vdso$(x).so vdso$(x= ).so.dbg) =20 CPPFLAGS_vdso.lds +=3D -P -C --=20 2.40.1 From nobody Wed Dec 17 20:40:13 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A2E8C61D99 for ; Tue, 21 Nov 2023 23:57:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234977AbjKUX51 (ORCPT ); Tue, 21 Nov 2023 18:57:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234939AbjKUX5R (ORCPT ); Tue, 21 Nov 2023 18:57:17 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9F2D71A2 for ; Tue, 21 Nov 2023 15:57:14 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA97DC433C7; Tue, 21 Nov 2023 23:57:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700611034; bh=Fkwx/7dQoGPA1O843IBgRSOzjaXZ20gyiZMK5qWVDQA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=c01rYmA+0CI4XR/8U9hC++WrFzlDXyIYnsbGSyyfW036RN4nYUTUeme3vmska38aM wIWQ8k6/WfO+bitXUsyNMcN6vIGTHhpH/YOgqwx6LlQmo5RhvngfYtwMdv2Kd46Inb NCutzrvuFJoGA9kEGcWNj3T8PtFBh+LYPanD1qpaeKfuM31HKDDP5NFf0jpyyMbgAy +kYx4U9W1mge/911DdSElhawseIECJNwwTuW4/8U9yjkiF3IfJ1T3nsRj5oW2IKBWE B5ijq2DeQWWR3wrIgO3uHAYBaXZGhX5aZWMlgd38aM6TTlECz+onG4YbqCPJHaIIMN 6Brw+jm64NG4A== From: Masahiro Yamada To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: Masahiro Yamada , Andy Lutomirski , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: [PATCH 3/4] x86: vdso: use $(addprefix ) instead of $(foreach ) Date: Wed, 22 Nov 2023 08:57:00 +0900 Message-Id: <20231121235701.239606-4-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231121235701.239606-1-masahiroy@kernel.org> References: <20231121235701.239606-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" $(addprefix ) is slightly shorter and more intuitive. Signed-off-by: Masahiro Yamada --- 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) +=3D vdso-image-32.o vdso32-= setup.o =20 OBJECT_FILES_NON_STANDARD_vdso32-setup.o :=3D n =20 -vobjs :=3D $(foreach F,$(vobjs-y),$(obj)/$F) -vobjs32 :=3D $(foreach F,$(vobjs32-y),$(obj)/$F) +vobjs :=3D $(addprefix $(obj)/, $(vobjs-y)) +vobjs32 :=3D $(addprefix $(obj)/, $(vobjs32-y)) =20 $(obj)/vdso.o: $(obj)/vdso.so =20 @@ -112,7 +112,7 @@ VDSO_LDFLAGS_vdsox32.lds =3D -m elf32_x86_64 -soname li= nux-vdso.so.1 \ vobjx32s-y :=3D $(vobjs-y:.o=3D-x32.o) =20 # same thing, but in the output directory -vobjx32s :=3D $(foreach F,$(vobjx32s-y),$(obj)/$F) +vobjx32s :=3D $(addprefix $(obj)/, $(vobjx32s-y)) =20 # Convert 64bit object file to x32 for x32 vDSO. quiet_cmd_x32 =3D X32 $@ --=20 2.40.1 From nobody Wed Dec 17 20:40:13 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3DE31C61D98 for ; Tue, 21 Nov 2023 23:57:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234983AbjKUX5b (ORCPT ); Tue, 21 Nov 2023 18:57:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234947AbjKUX5U (ORCPT ); Tue, 21 Nov 2023 18:57:20 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0099C1A1 for ; Tue, 21 Nov 2023 15:57:16 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF890C433CC; Tue, 21 Nov 2023 23:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700611036; bh=Kbe8XGZbLDUllBFU/Mfn+D2rr3svacMDADLa8sIZMi8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XUNEFwrZo225RtXVaOe/hy+9Kvk/BDvCi0m0LK/GZN9DL8vPOWrhlAUEqW4o69p0e Rr6JSs06aPB9kL8BU3tnPfugX+oMtpUSGg6UZ2QaUUxgIhCEYfmUs2Xb8QKdknTF27 55Opvav/2/yfgE+9o35iaZGTGWOTzz4sKpKyCf3fqhWslI5tfiOfoSLExDrxPmyKJW 9+TwJ8ReL+/R77yKVO3CtZm9xUeE8dUXzEoCNJcC3XH/tBROytVwoUxHXeB+KdIt6k EXRmQtkK8vshbpVr6ISpOGV2wx6J5bXklopRc0DTPdzcCYHYlHMAXs/syv8/YBYCbB UvpzJntMow/ng== From: Masahiro Yamada To: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org Cc: Masahiro Yamada , Andy Lutomirski , "H. Peter Anvin" , linux-kernel@vger.kernel.org Subject: [PATCH 4/4] x86: vdso: use CONFIG_COMPAT_32 to specify vdso32 Date: Wed, 22 Nov 2023 08:57:01 +0900 Message-Id: <20231121235701.239606-5-masahiroy@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231121235701.239606-1-masahiroy@kernel.org> References: <20231121235701.239606-1-masahiroy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 --- 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: =20 vdso-install-$(CONFIG_X86_64) +=3D arch/x86/entry/vdso/vdso64.so.dbg vdso-install-$(CONFIG_X86_X32_ABI) +=3D arch/x86/entry/vdso/vdsox32.so.dbg -vdso-install-$(CONFIG_X86_32) +=3D arch/x86/entry/vdso/vdso32.so.dbg -vdso-install-$(CONFIG_IA32_EMULATION) +=3D arch/x86/entry/vdso/vdso32.so.d= bg +vdso-install-$(CONFIG_COMPAT_32) +=3D arch/x86/entry/vdso/vdso32.so.dbg =20 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 :=3D n # vDSO images to build obj-$(CONFIG_X86_64) +=3D vdso-image-64.o obj-$(CONFIG_X86_X32_ABI) +=3D vdso-image-x32.o -obj-$(CONFIG_X86_32) +=3D vdso-image-32.o vdso32-setup.o -obj-$(CONFIG_IA32_EMULATION) +=3D vdso-image-32.o vdso32-setup.o +obj-$(CONFIG_COMPAT_32) +=3D vdso-image-32.o vdso32-setup.o =20 OBJECT_FILES_NON_STANDARD_vdso32-setup.o :=3D n =20 --=20 2.40.1