From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.28.146 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796120667; b=IWf4KY1B2vDvmYGXs56EnthdHvoebiX9RMANqn7WgMnlEIaKGiuOV4qvNNKxFYrlwEeS NnnWNVMvHJ2mF+adCzrmaCmALamS0KiBKTEqt9h2DF8uWXfdFMbnr+77LfedFblHXaJ1Q /60rRXEtRooMLWLOAoSTSfCWuPaVTIXKl2McknvVgZwf62aEU/eOi1dmQSGJFvMnaNqsd LArhdKNqkUx3bW8EVmo7dtrDBxTYom5r6oZTArTAkrIe3ImBiqddyPtODn+HIcn4l7FmO QTz23utl/uOkI1YUykYTgyFXVRIyourvNygmlUgL5ATMJ6ia6F3N2n8Ts+FsMmMD5qA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796120667; h=DMARC-Filter:DKIM-Signature:X-Alimail-AntiSpam:Received:From:To:Cc: Subject:Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=oRr17aZFJDdvI/QjhV9DTkDxEi3REY6p+Rp/I9yV2aE=; b=f6l25XTMnU/IKhBJSrxT6IU/2ws7qg3BzDlp/bVnF/SnOXTTXYELBeUFKRhxGYn+aEFo w3t3ti5ZKruHTIpV80dDsMgVEmlN4yNgak6VCQ7ryo4WuvWf5iwXrZCxVgnGnbhvcmKDo 0oPFfufaCNpxlbIYmo134HrogCUy0vWGlWBkEG8eG1zZIxYRDfb8VM7e2U6XWizd7fTZb qtvIHshLXvBt7x1wX+S9xEh+wEWvMmwLP20bd1lHJZhvgpG3CUsSD8SofIUeomKPZBt/P g501zxY3mtGntVUIEyqegNV1tszlhwkzdvU5mSi7cJGonYi4jYXpBva4Zcjj+SmmqRA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=xiaopeng.com; spf=pass smtp.mailfrom=xiaopeng.com; dkim=pass header.d=xiaopeng.com header.i=@xiaopeng.com header.a=rsa-sha256 header.s=default header.b=JLdFzHSx; arc=none smtp.remote-ip=115.124.28.146 Received: from out28-146.mail.aliyun.com (out28-146.mail.aliyun.com [115.124.28.146]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 723D0606A33C; Tue, 1 Dec 2026 10:24:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 723D0606A33C Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=xiaopeng.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xiaopeng.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xiaopeng.com header.i=@xiaopeng.com header.a=rsa-sha256 header.s=default header.b=JLdFzHSx DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=xiaopeng.com; s=default; t=1796120657; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=oRr17aZFJDdvI/QjhV9DTkDxEi3REY6p+Rp/I9yV2aE=; b=JLdFzHSxDQ3/lIZIbyIlHPkHxDZq062AryKoLYP5W7d2pgFlafAtkICPoJKj8ZK3kakGoPj/4YiFnIfQNlF26rYCRqn6/oeNQuVssw6dMWvxitRYtaDpp7GFOWjAa8r5m7u6vwqgyVVEK/pPuEvHeDLeHum2qbY09XD0KrEnTWo= X-Alimail-AntiSpam:AC=CONTINUE;BC=0.04593988|-1;CH=green;DM=|CONTINUE|false|;DS=CONTINUE|ham_system_inform|0.017189-0.00105674-0.981754;FP=3227547530761424334|0|0|0|0|-1|-1|-1;HT=maildocker-contentspam033037034254;MF=fangxy@xiaopeng.com;NM=1;PH=DS;RN=19;RT=19;SR=0;TI=SMTPD_---.kE4ydDa_1796120654; Received: from localhost.localdomain(mailfrom:fangxy@xiaopeng.com fp:SMTPD_---.kE4ydDa_1796120654 cluster:ay29) by smtp.aliyun-inc.com; Tue, 01 Dec 2026 18:24:15 +0800 From: Fang Xieyan To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , x86@kernel.org Cc: Ingo Molnar , Borislav Petkov , Dave Hansen , Arnd Bergmann , =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= , Huacai Chen , WANG Xuerui , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , linux-arch@vger.kernel.org, linux-riscv@lists.infradead.org, loongarch@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [RFC PATCH 2/5] x86/vdso: Drop redundant kernel header includes Date: Tue, 1 Dec 2026 18:24:07 +0800 Message-ID: <20261201102410.44071-3-fangxy@xiaopeng.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20261201102410.44071-1-fangxy@xiaopeng.com> References: <20261201102410.44071-1-fangxy@xiaopeng.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Preparation for switching the sanctioned include/vdso headers over to a self-contained . The x86 vDSO sources include , and even though everything they need comes from the vdso headers they also include. Drop those redundant includes. in vgetcpu.c was not purely redundant: the it also includes uses X86_FEATURE_RDPID in vdso_read_cpunode() and relies on its includer to provide , so replace it with that header there. Likewise drop the redundant includes from vgtod.h and asm/vdso/gettimeofday.h: the clock IDs are already provided via vdso/datapage.h and the includes that follow them. One include had to be made explicit rather than dropped: on 32-bit builds asm/div64.h provides an mul_u32_u32() implementation that must take precedence over the generic fallback in vdso/math64.h. Previously pulled asm/div64.h in before lib/vdso/gettimeofday.c reaches vdso/math64.h, so the x86 implementation won. Include directly in vclock_gettime.c to keep that ordering instead of relying on the kernel header chain. No functional change intended. Signed-off-by: Fang Xieyan --- Build-tested on x86_64 defconfig (CONFIG_IA32_EMULATION=y, with CONFIG_X86_X32_ABI) and native i386 defconfig at this commit: bzImage builds with 0 errors, keeping the series bisectable. On i386, the resulting vdso32 vclock_gettime.o is size-identical to the unpatched baseline with matching per-function sizes, and the -E -dD dump of the translation unit shows the mul_u32_u32() macro being defined right at the asm/div64.h implementation, confirming the x86 one is in effect. arch/x86/entry/vdso/common/vclock_gettime.c | 10 +++++++--- arch/x86/entry/vdso/common/vgetcpu.c | 2 +- arch/x86/entry/vdso/vdso64/vgetrandom.c | 2 -- arch/x86/include/asm/vdso/gettimeofday.h | 1 - arch/x86/include/asm/vgtod.h | 2 -- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/arch/x86/entry/vdso/common/vclock_gettime.c b/arch/x86/entry/vdso/common/vclock_gettime.c index 304dbd1f9db4..edef05f26d59 100644 --- a/arch/x86/entry/vdso/common/vclock_gettime.c +++ b/arch/x86/entry/vdso/common/vclock_gettime.c @@ -8,10 +8,14 @@ * 32 Bit compat layer by Stefani Seibold * sponsored by Rohde & Schwarz GmbH & Co. KG Munich/Germany */ -#include -#include -#include #include +/* + * Include asm/div64.h before the generic mul_u32_u32() fallback that + * vdso/math64.h provides on 32-bit builds, so the x86 implementation + * keeps taking effect; dropping used to lose that + * include ordering. + */ +#include #include "lib/vdso/gettimeofday.c" diff --git a/arch/x86/entry/vdso/common/vgetcpu.c b/arch/x86/entry/vdso/common/vgetcpu.c index 6381b472b7c5..6990491e0e48 100644 --- a/arch/x86/entry/vdso/common/vgetcpu.c +++ b/arch/x86/entry/vdso/common/vgetcpu.c @@ -5,7 +5,7 @@ * Fast user context implementation of getcpu() */ -#include +#include #include #include diff --git a/arch/x86/entry/vdso/vdso64/vgetrandom.c b/arch/x86/entry/vdso/vdso64/vgetrandom.c index 6a95d36b12d9..b7154e1b7c60 100644 --- a/arch/x86/entry/vdso/vdso64/vgetrandom.c +++ b/arch/x86/entry/vdso/vdso64/vgetrandom.c @@ -2,8 +2,6 @@ /* * Copyright (C) 2022-2024 Jason A. Donenfeld . All Rights Reserved. */ -#include - #include "lib/vdso/getrandom.c" ssize_t __vdso_getrandom(void *buffer, size_t len, unsigned int flags, void *opaque_state, size_t opaque_len) diff --git a/arch/x86/include/asm/vdso/gettimeofday.h b/arch/x86/include/asm/vdso/gettimeofday.h index 3cf214cc4a75..73794aecefdc 100644 --- a/arch/x86/include/asm/vdso/gettimeofday.h +++ b/arch/x86/include/asm/vdso/gettimeofday.h @@ -12,7 +12,6 @@ #ifndef __ASSEMBLER__ -#include #include #include #include diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h index a0ce291abcae..5db3e1bc8b76 100644 --- a/arch/x86/include/asm/vgtod.h +++ b/arch/x86/include/asm/vgtod.h @@ -12,8 +12,6 @@ #include #include -#include - #endif /* CONFIG_GENERIC_GETTIMEOFDAY */ #endif /* _ASM_X86_VGTOD_H */ -- 2.50.1