mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fang Xieyan <fangxy@xiaopeng.com>
To: Andy Lutomirski <luto@kernel.org>,
	Thomas Gleixner <tglx@kernel.org>,
	Vincenzo Frascino <vincenzo.frascino@arm.com>,
	x86@kernel.org
Cc: "Ingo Molnar" <mingo@redhat.com>,
	"Borislav Petkov" <bp@alien8.de>,
	"Dave Hansen" <dave.hansen@linux.intel.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Thomas Weißschuh" <linux@weissschuh.net>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"WANG Xuerui" <kernel@xen0n.name>,
	"Paul Walmsley" <pjw@kernel.org>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Albert Ou" <aou@eecs.berkeley.edu>,
	"Alexandre Ghiti" <alex@ghiti.fr>,
	linux-arch@vger.kernel.org, linux-riscv@lists.infradead.org,
	loongarch@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [RFC PATCH 3/5] vdso: Switch the sanctioned headers to vdso/types.h
Date: Tue,  1 Dec 2026 18:24:08 +0800	[thread overview]
Message-ID: <20261201102410.44071-4-fangxy@xiaopeng.com> (raw)
In-Reply-To: <20261201102410.44071-1-fangxy@xiaopeng.com>

Now that <vdso/types.h> provides the sanitized UAPI type subset and the
x86 side no longer carries redundant includes that would clash, convert
the sanctioned include/vdso headers to take their types from it:

  datapage.h:  <linux/types.h>  -> <vdso/types.h>, drop <uapi/linux/time.h>
  gettime.h:   <linux/types.h>  -> <vdso/types.h>
  getrandom.h: <linux/types.h>  -> <vdso/types.h>
  time.h:      <uapi/linux/types.h> -> <vdso/types.h>
  auxclock.h:  <uapi/linux/time.h>, <uapi/linux/types.h> -> <vdso/types.h>

This removes the direct dependency of the sanctioned headers on
kernel-internal and UAPI type headers, so vDSO code compiled against
them no longer reaches include/asm-generic/bitsperlong.h through the
type headers.

Note the vDSO build still reaches <linux/types.h> indirectly through
unrelated kernel-header paths (e.g. asm/msr.h -> linux/percpu.h ->
linux/time64.h on x86); breaking those remaining chains is left for
follow-up work.

Signed-off-by: Fang Xieyan <fangxy@xiaopeng.com>
---
Build-tested at this commit: x86_64 defconfig (CONFIG_IA32_EMULATION=y,
CONFIG_X86_X32_ABI=y) builds bzImage with 0 errors producing
vdso32.so.dbg, vdso64.so.dbg and vdsox32.so.dbg, and the arm64
defconfig cross-build (aarch64-linux-gnu-gcc) builds Image with 0
errors producing vdso.so/vdso.so.dbg.  arm, riscv, loongarch and s390
also build cleanly with the full series; the mips and powerpc vDSO
objects build cleanly too (their full-tree failures reproduce
identically on the unpatched baseline with the same clang toolchain
limitations).

A compiler -H trace confirms include/vdso/types.h is self-contained and
that the sanctioned headers no longer include <linux/types.h> or the
UAPI time headers directly. The remaining linux/types.h / asm-generic/
bitsperlong.h inclusions reach the vDSO build through unrelated
kernel-header paths (e.g. asm/msr.h -> linux/percpu.h -> linux/time64.h)
and are left for follow-up work, as noted above.

Series based on v7.4-rc5 (fe6ff8d5d675).  The per-commit build results
above were collected on v7.4-rc4; none of the fifteen files this series
touches changed between the two tags, and rebuilding the x86 vDSO on
this base yields byte-identical vdso64, vdsox32 and vdso32 objects.

 include/vdso/auxclock.h  | 3 +--
 include/vdso/datapage.h  | 3 +--
 include/vdso/getrandom.h | 2 +-
 include/vdso/gettime.h   | 2 +-
 include/vdso/time.h      | 2 +-
 5 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/include/vdso/auxclock.h b/include/vdso/auxclock.h
index 6d6e74cbc400..82b675c207dd 100644
--- a/include/vdso/auxclock.h
+++ b/include/vdso/auxclock.h
@@ -2,8 +2,7 @@
 #ifndef _VDSO_AUXCLOCK_H
 #define _VDSO_AUXCLOCK_H
 
-#include <uapi/linux/time.h>
-#include <uapi/linux/types.h>
+#include <vdso/types.h>
 
 static __always_inline u64 aux_clock_resolution_ns(void)
 {
diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h
index 09897f76ae07..286f625659b3 100644
--- a/include/vdso/datapage.h
+++ b/include/vdso/datapage.h
@@ -4,10 +4,9 @@
 
 #ifndef __ASSEMBLER__
 
-#include <linux/types.h>
+#include <vdso/types.h>
 
 #include <uapi/linux/bits.h>
-#include <uapi/linux/time.h>
 
 #include <vdso/align.h>
 #include <vdso/bits.h>
diff --git a/include/vdso/getrandom.h b/include/vdso/getrandom.h
index 1d9dbd4d76c1..f766cf913d74 100644
--- a/include/vdso/getrandom.h
+++ b/include/vdso/getrandom.h
@@ -6,7 +6,7 @@
 #ifndef _VDSO_GETRANDOM_H
 #define _VDSO_GETRANDOM_H
 
-#include <linux/types.h>
+#include <vdso/types.h>
 
 #define CHACHA_KEY_SIZE         32
 #define CHACHA_BLOCK_SIZE       64
diff --git a/include/vdso/gettime.h b/include/vdso/gettime.h
index 16a0a0556b86..17e08fa5936b 100644
--- a/include/vdso/gettime.h
+++ b/include/vdso/gettime.h
@@ -2,7 +2,7 @@
 #ifndef _VDSO_GETTIME_H
 #define _VDSO_GETTIME_H
 
-#include <linux/types.h>
+#include <vdso/types.h>
 
 struct __kernel_timespec;
 struct __kernel_old_timeval;
diff --git a/include/vdso/time.h b/include/vdso/time.h
index 739f53cd2949..da417a347824 100644
--- a/include/vdso/time.h
+++ b/include/vdso/time.h
@@ -2,7 +2,7 @@
 #ifndef __VDSO_TIME_H
 #define __VDSO_TIME_H
 
-#include <uapi/linux/types.h>
+#include <vdso/types.h>
 
 struct timens_offset {
 	s64	sec;
-- 
2.50.1


  parent reply	other threads:[~2026-12-01 10:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 10:24 [RFC PATCH 0/5] vdso: Provide a sanitized subset of UAPI types for vDSO code Fang Xieyan
2026-12-01 10:24 ` [RFC PATCH 1/5] vdso: Provide a sanitized subset of UAPI types Fang Xieyan
2026-12-01 11:28   ` Thomas Weißschuh
2026-12-01 10:24 ` [RFC PATCH 2/5] x86/vdso: Drop redundant kernel header includes Fang Xieyan
2026-12-01 10:24 ` Fang Xieyan [this message]
2026-12-01 10:24 ` [RFC PATCH 4/5] riscv: Drop redundant internal header includes from the vDSO sources Fang Xieyan
2026-12-01 10:24 ` [RFC PATCH 5/5] loongarch: " Fang Xieyan
2026-12-01 11:55 [RFC PATCH 0/5] vdso: Provide a sanitized subset of UAPI types for vDSO code Fang Xieyan
2026-12-01 11:55 ` [RFC PATCH 3/5] vdso: Switch the sanctioned headers to vdso/types.h Fang Xieyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261201102410.44071-4-fangxy@xiaopeng.com \
    --to=fangxy@xiaopeng.com \
    --cc=alex@ghiti.fr \
    --cc=aou@eecs.berkeley.edu \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=chenhuacai@kernel.org \
    --cc=dave.hansen@linux.intel.com \
    --cc=kernel@xen0n.name \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=linux@weissschuh.net \
    --cc=loongarch@lists.linux.dev \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=palmer@dabbelt.com \
    --cc=pjw@kernel.org \
    --cc=tglx@kernel.org \
    --cc=vincenzo.frascino@arm.com \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®