From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=115.124.28.221 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796126140; b=uuC7xhQji/F/06p9zuxn5I2c10YtgmZrg+djpp0PkRDB4S4Y+LGApoj+db1YtplM/erc b3f4qm77PfccFid0WpgcHr7gIgRjdPIQCdEmnJ0HKrBG4ZgqPGLHOex6uPH1om9OmgGC1 ga3VnXzpXpGgw9Pcyfnomq8JJCYhm8c5zHjJKnOReatQad0jIyaQyiBBSwjkJSgfKYAO0 7mL2gNKAdub05UXd6q5PqgNWXrVlDEGG6/TJANrh2v1ZOL5CbIDWEY9A2qscy1+vL9+0/ mKVKvQwU8cf/nEu+sRk3u8dGI8i+D9bWUQbF2MVtmQyBd4lVlc7l78gycXQilvn43+A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796126140; 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=iMxVdI/ZM8NATDyvq7nhVRIO2nKuMUrCWEPAJf7N8IdnCIHTUXWKobjOngPg/py6pHrK NSSCQIqOwpnaK53oBzawASl5EauhBTwJ9z3c+yjTXjvhnDj4FIdjel+9SunVUG8uwy/xR pkn8zFpnlPyx6WPeygODFNWB89Mv1Yg5TChocmcGIDLkouI3rYVNEu+BRwik5r95FtAxV Lvj7ed4Bu8I7839X8KRoZwg8QGaSw6bfP9B+rcyna5WLyFxV3prfhFcFhQ5OKZNp+SGZy V8X4o58WMBFLK3DKIFfC7yRcWwErEueOZIteqnkz/7tgSVUB8CEaPQA8CAKG1WZEtxg== 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=NGTq56Od; arc=none smtp.remote-ip=115.124.28.221 Received: from out28-221.mail.aliyun.com (out28-221.mail.aliyun.com [115.124.28.221]) (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 CAB69606A338; Tue, 1 Dec 2026 11:55:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org CAB69606A338 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=NGTq56Od DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=xiaopeng.com; s=default; t=1796126130; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=oRr17aZFJDdvI/QjhV9DTkDxEi3REY6p+Rp/I9yV2aE=; b=NGTq56OdV+F/Hcw7KpYUeEIRhzh/BnFUAVW5+kuJ2as7SYzwSmNOn66HOgPOd0YEZyag2BmXO+XfJIXZAmdm3FrgB06dXYpR3OPz9EUPtoLeO0zdeU939ghyL9u/NiUECEGSlPnzlaSjOgt4TIK036wnwM+qu9DVcpEiEiurVag= 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|9|3|19|0|-1|-1|-1;HT=maildocker-contentspam033024148021;MF=fangxy@xiaopeng.com;NM=1;PH=DS;RN=19;RT=19;SR=0;TI=SMTPD_---.kEK1TjM_1796126127; Received: from localhost.localdomain(mailfrom:fangxy@xiaopeng.com fp:SMTPD_---.kEK1TjM_1796126127 cluster:ay29) by smtp.aliyun-inc.com; Tue, 01 Dec 2026 19:55:28 +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 19:55:20 +0800 Message-ID: <20261201115523.75606-3-fangxy@xiaopeng.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20261201115523.75606-1-fangxy@xiaopeng.com> References: <20261201115523.75606-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