From nobody Thu Apr 9 12:09:30 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 83940346FC8; Fri, 27 Feb 2026 06:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175469; cv=none; b=IxD0zOpT43Ix/XQalQ4K80Xh79zkmUBY9KPmOPXgE/4XmeVGJzDda5r3BLSEpdLahl1d8W0QhwecFROXQP3IOlGDrboKvUO/ITOxL+ngBZEkAK2cyBM7UjJ9NmEIxO/g/KpTy7CoCmjKN5nRbWVOMNZDFsra8rVHuZV89W2OyNo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175469; c=relaxed/simple; bh=FgFyWd9y9Cpt46MJBsKjGyDO3WVy4aSq91RM5Jo19RQ=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=up4qusfMC1HVnzlOAtgQr0Y+7kaGK6ZeGcgzwhjSJk0C7fHBbN0Sit7orz9Rni/K3BjdkIpyZyV2e77iVth713be1acfjaSpbgyx+viiJXpsx/WnfJrO0RCkhsUcbzvARDVzEIG1I9vmthUS+2o23XqizTADlf+4Cz24bHhpb8c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=s5/+gkjV; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=qjio/8IU; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="s5/+gkjV"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="qjio/8IU" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772175467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uI4rN+o786Yb4YBX5SDM0UB57RWA9Fv/jfoGfsX/yrs=; b=s5/+gkjVizzktnhsVUSZyYkMCeXZFhoXA9JLcMQMMjYaTItjo0gt9yZShXndYz2zS1c5yb st1utoLXbotlVRmlUEhbuLn7cB0pzeQ10ufkIqD/iCzF/ueHheLj5bw3FwgG8aQPoMhU+q lnCZwLhp/qNfzvn3N47xpeLiaFDxXWzbDrPF3dbSvu5oy6r5K0040dMvkNeCgf9iAkFOGF vX0iZ7X2124HP75OZqNN8CYV/lO6V0yqRyeXINslN8+3ty+ztvTWniFvhiP+lchzamqyu1 T3hEfzbddrTJaNbapUeZ3d71U5RGICjAMQVg8t1ldUGkkPoAuBzxKtkgFg2m7w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772175467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uI4rN+o786Yb4YBX5SDM0UB57RWA9Fv/jfoGfsX/yrs=; b=qjio/8IUUpLhARF1kZco1eI0ng8AuORSKJbIuzqR6n7s6WQlR6mg6syc/dKCYqM7g1+A+w tx4tz/96oWShraDQ== Date: Fri, 27 Feb 2026 07:57:40 +0100 Subject: [PATCH 1/7] x86/vdso: Respect COMPAT_32BIT_TIME Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260227-vdso-compat_32bit_time-v1-1-3f0286a7bac3@linutronix.de> References: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> In-Reply-To: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Russell King , Catalin Marinas , Will Deacon , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Thomas Bogendoerfer , Vincenzo Frascino Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, Arnd Bergmann , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1772175466; l=3434; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=FgFyWd9y9Cpt46MJBsKjGyDO3WVy4aSq91RM5Jo19RQ=; b=TaGXpZc+bPtJpYJ/U1xX+5+0VES/56W0ad9REZpJpoQOimP7CjrTUkTvuxgkdnd6mO41YjydS Xp46ggLdry/Bzyoe8v5oTynBdH8ekzwdnYcBGvPPKqeNNYGxWpzSxJn X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= If CONFIG_COMPAT_32BIT_TIME is disabled then the vDSO should not provide any 32-bit time related functionality. This is the intended effect of the kconfig option and also the fallback system calls would also not be implemented. Currently the kconfig option does not affect the gettimeofday() syscall, so also keep that in the vDSO. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/x86/entry/vdso/common/vclock_gettime.c | 20 ++++++++++++-------- arch/x86/entry/vdso/vdso32/vdso32.lds.S | 4 +++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/arch/x86/entry/vdso/common/vclock_gettime.c b/arch/x86/entry/v= dso/common/vclock_gettime.c index 027b7e88d753..664d91437f45 100644 --- a/arch/x86/entry/vdso/common/vclock_gettime.c +++ b/arch/x86/entry/vdso/common/vclock_gettime.c @@ -23,12 +23,14 @@ int __vdso_gettimeofday(struct __kernel_old_timeval *tv= , struct timezone *tz) int gettimeofday(struct __kernel_old_timeval *, struct timezone *) __attribute__((weak, alias("__vdso_gettimeofday"))); =20 +#if defined(__x86_64__) || defined(CONFIG_COMPAT_32BIT_TIME) __kernel_old_time_t __vdso_time(__kernel_old_time_t *t) { return __cvdso_time(t); } =20 __kernel_old_time_t time(__kernel_old_time_t *t) __attribute__((weak, alia= s("__vdso_time"))); +#endif /* CONFIG_COMPAT_32BIT_TIME */ =20 =20 #if defined(CONFIG_X86_64) && !defined(BUILD_VDSO32_64) @@ -51,6 +53,7 @@ int clock_getres(clockid_t, struct __kernel_timespec *) =20 #else /* i386 only */ +#ifdef CONFIG_COMPAT_32BIT_TIME int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts) { return __cvdso_clock_gettime32(clock, ts); @@ -59,14 +62,6 @@ int __vdso_clock_gettime(clockid_t clock, struct old_tim= espec32 *ts) int clock_gettime(clockid_t, struct old_timespec32 *) __attribute__((weak, alias("__vdso_clock_gettime"))); =20 -int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts) -{ - return __cvdso_clock_gettime(clock, ts); -} - -int clock_gettime64(clockid_t, struct __kernel_timespec *) - __attribute__((weak, alias("__vdso_clock_gettime64"))); - int __vdso_clock_getres(clockid_t clock, struct old_timespec32 *res) { return __cvdso_clock_getres_time32(clock, res); @@ -74,6 +69,15 @@ int __vdso_clock_getres(clockid_t clock, struct old_time= spec32 *res) =20 int clock_getres(clockid_t, struct old_timespec32 *) __attribute__((weak, alias("__vdso_clock_getres"))); +#endif /* CONFIG_COMPAT_32BIT_TIME */ + +int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts) +{ + return __cvdso_clock_gettime(clock, ts); +} + +int clock_gettime64(clockid_t, struct __kernel_timespec *) + __attribute__((weak, alias("__vdso_clock_gettime64"))); =20 int __vdso_clock_getres_time64(clockid_t clock, struct __kernel_timespec *= ts) { diff --git a/arch/x86/entry/vdso/vdso32/vdso32.lds.S b/arch/x86/entry/vdso/= vdso32/vdso32.lds.S index 55554f80d930..012bc3a62aca 100644 --- a/arch/x86/entry/vdso/vdso32/vdso32.lds.S +++ b/arch/x86/entry/vdso/vdso32/vdso32.lds.S @@ -23,10 +23,12 @@ VERSION { LINUX_2.6 { global: +#ifdef CONFIG_COMPAT_32BIT_TIME __vdso_clock_gettime; - __vdso_gettimeofday; __vdso_time; __vdso_clock_getres; +#endif /* CONFIG_COMPAT_32BIT_TIME */ + __vdso_gettimeofday; __vdso_clock_gettime64; __vdso_clock_getres_time64; __vdso_getcpu; --=20 2.53.0 From nobody Thu Apr 9 12:09:30 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6760D38A718; Fri, 27 Feb 2026 06:57:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175470; cv=none; b=mgQx/U/2PWNraJfrggPgPSjx1mLWIBzKh5xSHUMsppKjR8TLaqC6UAqiFadKC/emPjyohEowLoMdDG9CGJhp1QDOehtCOly25HYiBxfBQ5rfsLPFHc8kelZkyxVYrxGv4hzAosbMhxQfH7x5Ck9l8rCrx62H5mxwm0YQLlET2ec= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175470; c=relaxed/simple; bh=JKP7Wzpv+BQAhD2mx0Ezvftbepun/bCnQO02h8+Mf/U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=sFQFDZEzTPbnR5zaOi39hjsXKNKnn+OxGFqUgQeo1CeLn3FuGGTriBUIIVX5xso314nJPjKOSXZvEKjWa7H2WNdTO7ESg9sJljDYiwKJ1EI4B9XUQSe+DfX+G5fueSPx44oaiJDK4N6C0Gzl4eyXUAPhtcNdfhG8lXUhddN3j2Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=aXlbJ/p9; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=P+yurFpS; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="aXlbJ/p9"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="P+yurFpS" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772175467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KXdJGc4nT9NOOKX+UZdPuq+ndE9REXVmbUjc0fDDCMI=; b=aXlbJ/p94I8vyOXRf4fwSomLr3yWPo8GZFeu6OrlP5IMBVGJUEf5fEwOED8eIkjOuiE8om akxR7tbHwLZziv+IZkREeUJuRcdQW2b8W1X/SAnX3csxcytBmcMa/TIoEE5XP/ZWcevTro dIQJJIOkIJsTCPnXWN2qOaAT5JqpVRc2EWx0gjIZuS5B/lzVQBq98vXVjgyDfIti0DzW1h cXtNOU0D0wGVbSYj1QqtYfquKGUHKLpmYLpCr/1AYfDD4AZjwJw3uxMDuS57szAquUZXaA WDNCcSzabajTyWFOje9cg2J/EwuMKnkp3IEW4jKk1e/YsMKuHGfFwbku6IMQ3g== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772175467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=KXdJGc4nT9NOOKX+UZdPuq+ndE9REXVmbUjc0fDDCMI=; b=P+yurFpSuVj8ak8+qsSSmyIxRmwYTP5FGrYkiAWDOqmH31s02Njiz+IUO1sS/ia5UFGb8S Okc3qETrJbJuUZDA== Date: Fri, 27 Feb 2026 07:57:41 +0100 Subject: [PATCH 2/7] ARM: VDSO: Respect COMPAT_32BIT_TIME Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260227-vdso-compat_32bit_time-v1-2-3f0286a7bac3@linutronix.de> References: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> In-Reply-To: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Russell King , Catalin Marinas , Will Deacon , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Thomas Bogendoerfer , Vincenzo Frascino Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, Arnd Bergmann , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1772175466; l=2370; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=JKP7Wzpv+BQAhD2mx0Ezvftbepun/bCnQO02h8+Mf/U=; b=6sVnm5WpE3/hhnKxB+rbIhSWVt0/eDVaHudV3chXN806w8ViXp2xoJGa/NWrh2YQ0UA4id8fC Q00LvueQZP0CIimPd0uVUn9R8HEtw/qNzxzOvXX1wgJmvPiDiJaWtD8 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= If CONFIG_COMPAT_32BIT_TIME is disabled then the vDSO should not provide any 32-bit time related functionality. This is the intended effect of the kconfig option and also the fallback system calls would also not be implemented. Currently the kconfig option does not affect the gettimeofday() syscall, so also keep that in the vDSO. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/arm/vdso/vdso.lds.S | 4 +++- arch/arm/vdso/vgettimeofday.c | 14 ++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/arch/arm/vdso/vdso.lds.S b/arch/arm/vdso/vdso.lds.S index 74d8d8bc8a40..766aa632e16c 100644 --- a/arch/arm/vdso/vdso.lds.S +++ b/arch/arm/vdso/vdso.lds.S @@ -70,9 +70,11 @@ VERSION { LINUX_2.6 { global: +#ifdef CONFIG_COMPAT_32BIT_TIME __vdso_clock_gettime; - __vdso_gettimeofday; __vdso_clock_getres; +#endif /* CONFIG_COMPAT_32BIT_TIME */ + __vdso_gettimeofday; __vdso_clock_gettime64; __vdso_clock_getres_time64; local: *; diff --git a/arch/arm/vdso/vgettimeofday.c b/arch/arm/vdso/vgettimeofday.c index f7a2f5dc2fdc..31702f2f0547 100644 --- a/arch/arm/vdso/vgettimeofday.c +++ b/arch/arm/vdso/vgettimeofday.c @@ -10,17 +10,19 @@ #include #include =20 +#ifdef CONFIG_COMPAT_32BIT_TIME int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts) { return __cvdso_clock_gettime32(clock, ts); } =20 -int __vdso_clock_gettime64(clockid_t clock, - struct __kernel_timespec *ts) +int __vdso_clock_getres(clockid_t clock_id, + struct old_timespec32 *res) { - return __cvdso_clock_gettime(clock, ts); + return __cvdso_clock_getres_time32(clock_id, res); } +#endif /* CONFIG_COMPAT_32BIT_TIME */ =20 int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) @@ -28,10 +30,10 @@ int __vdso_gettimeofday(struct __kernel_old_timeval *tv, return __cvdso_gettimeofday(tv, tz); } =20 -int __vdso_clock_getres(clockid_t clock_id, - struct old_timespec32 *res) +int __vdso_clock_gettime64(clockid_t clock, + struct __kernel_timespec *ts) { - return __cvdso_clock_getres_time32(clock_id, res); + return __cvdso_clock_gettime(clock, ts); } =20 int __vdso_clock_getres_time64(clockid_t clock_id, struct __kernel_timespe= c *res) --=20 2.53.0 From nobody Thu Apr 9 12:09:30 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C905B38B7A0; Fri, 27 Feb 2026 06:57:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175471; cv=none; b=p04Mg5lvdOSc0VfuFgFoHtg/88yusAUhT0yNuxaeoT35vtBFWIy+xy0H7zl8kRRQyOlEFZGzZgzpV52SrTPLjHEq3wjuOCtm8rwxlAwp0ZP4+nJW15tjHafG+T2yXY3VYJAv+TiwEtVnyyE2SlVM0MhBhPP+nk/HzxEnG9yFJFk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175471; c=relaxed/simple; bh=NxZxxvxiknln+O5AAR7jwJEyH6TfY0mjdJ+DVcxHm4E=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=dduNKoaqXqu6j7gjrk7saM3nN7vQkJsx5iJVmByTXjCl29IVYGDdYSNfX916kPrP8ghidWFGY16cUFkOgnGFeEIrWeBrVzewJ/IpbDkcI6JsQ21ntdWjhE/v3eGG4i+yzzg515QPKwfIKo3X0xJH7+uLfT4AFjg+lS/HsFv2zaM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=2hLvWsco; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=0ZlHKqjk; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2hLvWsco"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="0ZlHKqjk" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772175468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8H789/lOZNe2DBEbx0PYSnCH5b5GM/X09GORIs8o1ck=; b=2hLvWscoYx/z3rmISbCR6SGLUmJD2CT+HiHSwh6cvAdJsI5wWmOK/QnnlPjqVz+P6Nuzza iFx75X5AL60Yc+23Y8NZKPnh/b0C97LhmsiJk3rG+RydghLY+4hpeH4EE3N8YnPU7W49F/ lIOBREnMSqv525bgZ+qt/GH0IfEFBiEr2StxhGhDEeIWD1+2UfIlRNRTbQMRjmVFLjw7I4 NkIzsFutaS667exloFgT5TxE1KrR8O3eYx2sgXx8gcuTjm0PXnw3Z5fw453LlfEVwLykfh vUafW0hRJacZ2YbjAO5PDbAb59LdP9VTNg/o2sPUFztVpMDDMFXkPssAr203DQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772175468; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=8H789/lOZNe2DBEbx0PYSnCH5b5GM/X09GORIs8o1ck=; b=0ZlHKqjkUN43o0euq4qsmyDpIBZTImGj+YQ1LVe044iCwfLcleWlGJAeXQLVHwZ5iYS1V/ j/VxGLJ4K6BZ66DA== Date: Fri, 27 Feb 2026 07:57:42 +0100 Subject: [PATCH 3/7] arm64: vdso32: Respect COMPAT_32BIT_TIME Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260227-vdso-compat_32bit_time-v1-3-3f0286a7bac3@linutronix.de> References: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> In-Reply-To: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Russell King , Catalin Marinas , Will Deacon , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Thomas Bogendoerfer , Vincenzo Frascino Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, Arnd Bergmann , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1772175466; l=2478; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=NxZxxvxiknln+O5AAR7jwJEyH6TfY0mjdJ+DVcxHm4E=; b=hFAV704d5xiuNwcSxD6X0a/NpOiptEPqEUD4Bjw9ctleEz0bheoLEoYZIZju4M43J/YIzd0vN 7VgYl3TLaaMA34Cxd9JgQY2Q6uygWTcFTufs9+PMQY/Hi3CEl61gZih X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= If CONFIG_COMPAT_32BIT_TIME is disabled then the vDSO should not provide any 32-bit time related functionality. This is the intended effect of the kconfig option and also the fallback system calls would also not be implemented. Currently the kconfig option does not affect the gettimeofday() syscall, so also keep that in the vDSO. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/arm64/kernel/vdso32/vdso.lds.S | 4 +++- arch/arm64/kernel/vdso32/vgettimeofday.c | 14 ++++++++------ 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/arch/arm64/kernel/vdso32/vdso.lds.S b/arch/arm64/kernel/vdso32= /vdso.lds.S index c374fb0146f3..ea67f2dba431 100644 --- a/arch/arm64/kernel/vdso32/vdso.lds.S +++ b/arch/arm64/kernel/vdso32/vdso.lds.S @@ -82,9 +82,11 @@ VERSION { LINUX_2.6 { global: +#ifdef CONFIG_COMPAT_32BIT_TIME __vdso_clock_gettime; - __vdso_gettimeofday; __vdso_clock_getres; +#endif /* CONFIG_COMPAT_32BIT_TIME */ + __vdso_gettimeofday; __vdso_clock_gettime64; __vdso_clock_getres_time64; local: *; diff --git a/arch/arm64/kernel/vdso32/vgettimeofday.c b/arch/arm64/kernel/v= dso32/vgettimeofday.c index 0c6998ebe491..2e389c0a74df 100644 --- a/arch/arm64/kernel/vdso32/vgettimeofday.c +++ b/arch/arm64/kernel/vdso32/vgettimeofday.c @@ -8,17 +8,19 @@ #define BUILD_VDSO32_64 #include =20 +#ifdef CONFIG_COMPAT_32BIT_TIME int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts) { return __cvdso_clock_gettime32(clock, ts); } =20 -int __vdso_clock_gettime64(clockid_t clock, - struct __kernel_timespec *ts) +int __vdso_clock_getres(clockid_t clock_id, + struct old_timespec32 *res) { - return __cvdso_clock_gettime(clock, ts); + return __cvdso_clock_getres_time32(clock_id, res); } +#endif /* CONFIG_COMPAT_32BIT_TIME */ =20 int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) @@ -26,10 +28,10 @@ int __vdso_gettimeofday(struct __kernel_old_timeval *tv, return __cvdso_gettimeofday(tv, tz); } =20 -int __vdso_clock_getres(clockid_t clock_id, - struct old_timespec32 *res) +int __vdso_clock_gettime64(clockid_t clock, + struct __kernel_timespec *ts) { - return __cvdso_clock_getres_time32(clock_id, res); + return __cvdso_clock_gettime(clock, ts); } =20 int __vdso_clock_getres_time64(clockid_t clock_id, struct __kernel_timespe= c *res) --=20 2.53.0 From nobody Thu Apr 9 12:09:30 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6956A3D903C; Fri, 27 Feb 2026 06:57:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175472; cv=none; b=nDLX4xEpJp7PhKBRmDkP45IgtyJJD0teufKK1cjxW7wp9uO2IeDSfZGZUmSMoV+E8Z65+ioG7NcRpEULVZIpo5S9tPhUaeH4TgOZH8kG5H48SsoHXVzHJIxOVX8o7+5OnKz+da6EKZKpES0HHjxksq7yNKJx59S9dvy6y0zUGUo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175472; c=relaxed/simple; bh=Xv3eH/9VHgNpvqglSUhIiLYYyy1PpoIoaT4yuSsTW5M=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=tZYYRuoPCLzjNryHeHw2MZCPsRqYbBR8v9BaFCLGsDmU9KtP+j3k7o7g+QmYqXn3Bi6rVcuxJVmORAW1+C2rirxg7V4nvZq5gZAEPLo4ekOPAhEisTdIwjzJ4RPS3molMe5sFv8v+oZYGuQ9H3S5Gn7Qrbr8+xMhuf30QwudNvc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=w0103LqB; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=dwQQbZwa; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="w0103LqB"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="dwQQbZwa" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772175469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tB8OLfzV0yLcpSZIz+yX61nKI7piyON1S04PRpwPwsA=; b=w0103LqBgb+JA2hk7slblHRyqhjUgMxbAPY1uaHto4KknOa65o5qZhZJlSzj8WaWXUL5rJ KLQwaABcEs70WKppllRY1NLTTt2BT0xHaV0kBtAvE7bFTL2FPzPjEa4GOXFIYJ/jmoGkhr UUvlfEzXcdEgDcn1zS4TirH4v9LMx/IHqPQmd/W+N1tbZaRayrZUWQ6d6bti51du61LToX NJXofMLo0aDmkuXFlmANrlPNT8nqVo9yLDssTkhF5+JJH6ARgWCCEwM1DB/H7/ZtUuOvRc CoXCN/nr3ixC4OrC+cVsh8RWFkHdVUgZUcfm0zezs16N1YdLY0FvPLFXdILOFg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772175469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tB8OLfzV0yLcpSZIz+yX61nKI7piyON1S04PRpwPwsA=; b=dwQQbZwa0iNY4Z2tCRDuTF0yTx5tJzYwPhL58hNbssVKjkzYmrS56sigv0jtjlcjwdR3qc sBdobaHcn+xe0xAA== Date: Fri, 27 Feb 2026 07:57:43 +0100 Subject: [PATCH 4/7] powerpc/vdso: Respect COMPAT_32BIT_TIME Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260227-vdso-compat_32bit_time-v1-4-3f0286a7bac3@linutronix.de> References: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> In-Reply-To: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Russell King , Catalin Marinas , Will Deacon , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Thomas Bogendoerfer , Vincenzo Frascino Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, Arnd Bergmann , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1772175466; l=4469; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Xv3eH/9VHgNpvqglSUhIiLYYyy1PpoIoaT4yuSsTW5M=; b=MdmjO5KPhmsMXEd+ePjxhegLEWrjviduid5rr6rky5WJ94+NBzZC0pKA3jwyXKw3kLi1cCcfS /XYsS38ugRTB2pvIoZOiDkb7YT3sStIbRvJA37ZRPZfVvanqzK6DEU9 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= If CONFIG_COMPAT_32BIT_TIME is disabled then the vDSO should not provide any 32-bit time related functionality. This is the intended effect of the kconfig option and also the fallback system calls would also not be implemented. Currently the kconfig option does not affect the gettimeofday() syscall, so also keep that in the vDSO. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/powerpc/kernel/vdso/gettimeofday.S | 6 ++++++ arch/powerpc/kernel/vdso/vdso32.lds.S | 10 ++++++---- arch/powerpc/kernel/vdso/vgettimeofday.c | 16 ++++++++++------ 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/arch/powerpc/kernel/vdso/gettimeofday.S b/arch/powerpc/kernel/= vdso/gettimeofday.S index 1c8e51691bf8..c8fda56ac520 100644 --- a/arch/powerpc/kernel/vdso/gettimeofday.S +++ b/arch/powerpc/kernel/vdso/gettimeofday.S @@ -77,9 +77,11 @@ V_FUNCTION_END(__kernel_gettimeofday) * int __kernel_clock_gettime(clockid_t clock_id, struct timespec *tp); * */ +#if defined(__powerpc64__) || defined(CONFIG_COMPAT_32BIT_TIME) V_FUNCTION_BEGIN(__kernel_clock_gettime) cvdso_call __c_kernel_clock_gettime V_FUNCTION_END(__kernel_clock_gettime) +#endif =20 /* * Exact prototype of clock_gettime64() @@ -99,9 +101,11 @@ V_FUNCTION_END(__kernel_clock_gettime64) * int __kernel_clock_getres(clockid_t clock_id, struct timespec *res); * */ +#if defined(__powerpc64__) || defined(CONFIG_COMPAT_32BIT_TIME) V_FUNCTION_BEGIN(__kernel_clock_getres) cvdso_call __c_kernel_clock_getres V_FUNCTION_END(__kernel_clock_getres) +#endif =20 /* * Exact prototype of clock_getres_time64() @@ -122,6 +126,8 @@ V_FUNCTION_END(__kernel_clock_getres_time64) * time_t time(time *t); * */ +#if defined(__powerpc64__) || defined(CONFIG_COMPAT_32BIT_TIME) V_FUNCTION_BEGIN(__kernel_time) cvdso_call __c_kernel_time call_time=3D1 V_FUNCTION_END(__kernel_time) +#endif diff --git a/arch/powerpc/kernel/vdso/vdso32.lds.S b/arch/powerpc/kernel/vd= so/vdso32.lds.S index 3f384a2526ae..53fe3796a571 100644 --- a/arch/powerpc/kernel/vdso/vdso32.lds.S +++ b/arch/powerpc/kernel/vdso/vdso32.lds.S @@ -119,13 +119,15 @@ VERSION { VDSO_VERSION_STRING { global: - __kernel_get_syscall_map; - __kernel_gettimeofday; +#ifdef CONFIG_COMPAT_32BIT_TIME __kernel_clock_gettime; - __kernel_clock_gettime64; __kernel_clock_getres; - __kernel_clock_getres_time64; __kernel_time; +#endif /* CONFIG_COMPAT_32BIT_TIME */ + __kernel_gettimeofday; + __kernel_get_syscall_map; + __kernel_clock_gettime64; + __kernel_clock_getres_time64; __kernel_get_tbfreq; __kernel_sync_dicache; __kernel_sigtramp32; diff --git a/arch/powerpc/kernel/vdso/vgettimeofday.c b/arch/powerpc/kernel= /vdso/vgettimeofday.c index 3c194e1ab562..dfefd13a19e1 100644 --- a/arch/powerpc/kernel/vdso/vgettimeofday.c +++ b/arch/powerpc/kernel/vdso/vgettimeofday.c @@ -18,23 +18,25 @@ int __c_kernel_clock_getres(clockid_t clock_id, struct = __kernel_timespec *res, return __cvdso_clock_getres_data(vd, clock_id, res); } #else +#ifdef CONFIG_COMPAT_32BIT_TIME int __c_kernel_clock_gettime(clockid_t clock, struct old_timespec32 *ts, const struct vdso_time_data *vd) { return __cvdso_clock_gettime32_data(vd, clock, ts); } =20 -int __c_kernel_clock_gettime64(clockid_t clock, struct __kernel_timespec *= ts, - const struct vdso_time_data *vd) -{ - return __cvdso_clock_gettime_data(vd, clock, ts); -} - int __c_kernel_clock_getres(clockid_t clock_id, struct old_timespec32 *res, const struct vdso_time_data *vd) { return __cvdso_clock_getres_time32_data(vd, clock_id, res); } +#endif /* CONFIG_COMPAT_32BIT_TIME */ + +int __c_kernel_clock_gettime64(clockid_t clock, struct __kernel_timespec *= ts, + const struct vdso_time_data *vd) +{ + return __cvdso_clock_gettime_data(vd, clock, ts); +} =20 int __c_kernel_clock_getres_time64(clockid_t clock_id, struct __kernel_tim= espec *res, const struct vdso_time_data *vd) @@ -49,7 +51,9 @@ int __c_kernel_gettimeofday(struct __kernel_old_timeval *= tv, struct timezone *tz return __cvdso_gettimeofday_data(vd, tv, tz); } =20 +#if defined(__powerpc64__) || defined(CONFIG_COMPAT_32BIT_TIME) __kernel_old_time_t __c_kernel_time(__kernel_old_time_t *time, const struc= t vdso_time_data *vd) { return __cvdso_time_data(vd, time); } +#endif --=20 2.53.0 From nobody Thu Apr 9 12:09:30 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EB7AC3E9F80; Fri, 27 Feb 2026 06:57:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175472; cv=none; b=Of6egeUo/tAb0SVehmjlp56ws210OGP2intlmpn9qjiwAG/i2Jcx6qURFhIPiBRdNGHtr1zVnd+vf9d9lanLdQ/u+lhL7oRYpb8yqZZYvf3bc4QfkUnJxsCrNwZ7mmviqfpNPXsGlsyYfu0QGV8HhPNuhm5rYj+wIvNfGWZReZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175472; c=relaxed/simple; bh=oahUDDzRXbGFMlkc0RC1a89GUCrIJez2IL5R9Ep+PBo=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TzR0dxm7SEUKTKijiiA2H2gYUaF8F+gLVOzKwJIOXFObQ40hsHxgAKEB8SmQf3ffkhaQwJZ1ZXI0emZ76biGqPm9hA77Xyc6efN48KRkRErNhAPCcZdlLfvXIPRueXvMuYm/ZKA8GsKwTdZsf6ApjdrFqQYtnMqsaktyWmG0vBk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=jz3sFWXh; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=mNoDAPoh; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="jz3sFWXh"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="mNoDAPoh" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772175469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PMoWoELWXhUvJ+5dGoSFr0fxre5mWeKbDwq8tLK0U1w=; b=jz3sFWXhcbKGJDvHLemZ34PNAxwppfUXe+wTPhRtV3gLeHLzKe7G/sOWhp432nGhXwdSHn MgPHL/ieh4CRL+Sj/V0VrSdeXNrJJWdNoAnA+kUYdLhaxe5hRqxfwTSIVQqT/n2JRu11Db 54GUiQ3Ep2UOkUDN0lDHYCt1mgYt3lWckWML/nc21HoopTL0vjWSaXA5qYRwVq0Bz0oILh Mywz5yZTC95dNZKv+8lxx7sqRgP0XM9ESwO9geQDyk0s6GnuSbY0G6jK3tLh/1UPre0lm2 maFHxd31Y+gGwZf3eZw3N0MbkkfM5ZYX34hb3FOHezAsDQlFPn+cURluRusTEg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772175469; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PMoWoELWXhUvJ+5dGoSFr0fxre5mWeKbDwq8tLK0U1w=; b=mNoDAPohU52TI7Xd8JWlXSfQ8jNjk3ZTMwand/oL+vE8eWgqiq+6XegH6AjkjIti8lIJxM gQC7dMc48YTxE5AQ== Date: Fri, 27 Feb 2026 07:57:44 +0100 Subject: [PATCH 5/7] MIPS: VDSO: Drop kconfig MIPS_CLOCK_VSYSCALL Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260227-vdso-compat_32bit_time-v1-5-3f0286a7bac3@linutronix.de> References: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> In-Reply-To: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Russell King , Catalin Marinas , Will Deacon , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Thomas Bogendoerfer , Vincenzo Frascino Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, Arnd Bergmann , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1772175466; l=3146; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=oahUDDzRXbGFMlkc0RC1a89GUCrIJez2IL5R9Ep+PBo=; b=04Iyq9XCQR4S4Ii1jZ1CW+E0jOmqmZS2e+vnTE9U0dCmMRBUvfyhPR94yWmPUG9n2pIN7c9iT 6C8JYr4OYX/DVncCggJaRcX5U23VD83H+KnRI5WnFMgp2MAlxM6D477 X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= This configuration option exists so "that we don't provide the symbol when there's no possibility of there being a usable clocksource". However it only covers __vdso_gettimeofday() and none of the other vDSO functions which should be affected by the same circumstances. As these are more widely used than gettimeofday() and nobody seems to have had an issue with them so far, drop MIPS_CLOCK_VSYSCALL completely. The removal of the ifdeffery will also make some upcomming changes easier to read. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/mips/Kconfig | 3 --- arch/mips/vdso/vdso.lds.S | 2 -- arch/mips/vdso/vgettimeofday.c | 20 -------------------- 3 files changed, 25 deletions(-) diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index e48b62b4dc48..4c8592fd1556 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig @@ -1137,9 +1137,6 @@ config CSRC_R4K config CSRC_SB1250 bool =20 -config MIPS_CLOCK_VSYSCALL - def_bool CSRC_R4K || CLKSRC_MIPS_GIC - config GPIO_TXX9 select GPIOLIB bool diff --git a/arch/mips/vdso/vdso.lds.S b/arch/mips/vdso/vdso.lds.S index 5d08be3a6b85..76b6ad898288 100644 --- a/arch/mips/vdso/vdso.lds.S +++ b/arch/mips/vdso/vdso.lds.S @@ -97,9 +97,7 @@ VERSION #ifndef CONFIG_MIPS_DISABLE_VDSO global: __vdso_clock_gettime; -#ifdef CONFIG_MIPS_CLOCK_VSYSCALL __vdso_gettimeofday; -#endif __vdso_clock_getres; #if _MIPS_SIM !=3D _MIPS_SIM_ABI64 __vdso_clock_gettime64; diff --git a/arch/mips/vdso/vgettimeofday.c b/arch/mips/vdso/vgettimeofday.c index 1d236215e8f6..00f9fcfc327e 100644 --- a/arch/mips/vdso/vgettimeofday.c +++ b/arch/mips/vdso/vgettimeofday.c @@ -18,22 +18,12 @@ int __vdso_clock_gettime(clockid_t clock, return __cvdso_clock_gettime32(clock, ts); } =20 -#ifdef CONFIG_MIPS_CLOCK_VSYSCALL - -/* - * This is behind the ifdef so that we don't provide the symbol when there= 's no - * possibility of there being a usable clocksource, because there's nothin= g we - * can do without it. When libc fails the symbol lookup it should fall bac= k on - * the standard syscall path. - */ int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) { return __cvdso_gettimeofday(tv, tz); } =20 -#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */ - int __vdso_clock_getres(clockid_t clock_id, struct old_timespec32 *res) { @@ -59,22 +49,12 @@ int __vdso_clock_gettime(clockid_t clock, return __cvdso_clock_gettime(clock, ts); } =20 -#ifdef CONFIG_MIPS_CLOCK_VSYSCALL - -/* - * This is behind the ifdef so that we don't provide the symbol when there= 's no - * possibility of there being a usable clocksource, because there's nothin= g we - * can do without it. When libc fails the symbol lookup it should fall bac= k on - * the standard syscall path. - */ int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) { return __cvdso_gettimeofday(tv, tz); } =20 -#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */ - int __vdso_clock_getres(clockid_t clock_id, struct __kernel_timespec *res) { --=20 2.53.0 From nobody Thu Apr 9 12:09:30 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 807093EBF10; Fri, 27 Feb 2026 06:57:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175473; cv=none; b=nkrCL18fMk8zOixWQqqI2LeGIT95z3WgNEiSPauPRojmTmU/e7tyOUICXO3SEx4M+lfgJHKIB+o6/7O8/lXY2qu8A2h3yrtmn96z1vKzoIGIBRkywj2HTPIRl4bSDuf6JHTbObGz3rRnZl3Wim/6mYbAj9WruxW3nBnsZFHlw4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175473; c=relaxed/simple; bh=Km0PgJMXkFkzEVtC7VNNPJ/W6hZE0rb4fibkO3N6l5U=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=bE0rYHOSjN5L+BX8h5o+BTwOJhElHWxSL9uaZ4yQjCUf5i2P8q9ig7+s7grvCAiG391yNw1cvqHLJYP+IEuYwMRq1cF7ok0nhfO4XP1OlFAdekcfnSddkOrmch58tjhuF5T9kIDxRDno9YbdcJEtjrtJKmavszuNiuICWQ+sq+A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=hmx4hWjt; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=3LXrXDPJ; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="hmx4hWjt"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="3LXrXDPJ" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772175470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t1GJvcgWkbz8wTHp/DjmlS8V2g07Rf5DUkQm/V/ZPYs=; b=hmx4hWjthmw4yD0X7aYS6rU4XqnqGZtbL9w/8yXzstmtCHvt007ttxhUaUDDzR0D2xLZNg 4ojeOmkO9HdfkPr/qwXEzOkpfKDD5T9DLaL6IAtSmI3TR18axTzy0SAtUE2ID2Eo+FhgAM NSsUQdkp1wZxsj10MxkYvm1XLJo4snCU4teJRCmASq73V0Ir8gZZOpCxnwUgeSH/lVKbW7 +he9Da1Sd9D4hM/fEX37Aan4WzwNIKltwHJsKEKuHljR9+NMBbCPW06EXSD1MKVOti2ouI F5CBZHRRi63SHmlXWbLmg8xQzQ0kQRJ5sthkwy0jp6kuu21BD3Sgv9JscMhwDg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772175470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=t1GJvcgWkbz8wTHp/DjmlS8V2g07Rf5DUkQm/V/ZPYs=; b=3LXrXDPJ0FuljL985vAPBauSlRHKHVsGJGs/AOnf5ySt4fkv9uSLkMuFFWko+ymIdBic8f 0T1WfZ54uPl5DZAA== Date: Fri, 27 Feb 2026 07:57:45 +0100 Subject: [PATCH 6/7] MIPS: VDSO: Respect COMPAT_32BIT_TIME Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260227-vdso-compat_32bit_time-v1-6-3f0286a7bac3@linutronix.de> References: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> In-Reply-To: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Russell King , Catalin Marinas , Will Deacon , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Thomas Bogendoerfer , Vincenzo Frascino Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, Arnd Bergmann , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1772175466; l=2116; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Km0PgJMXkFkzEVtC7VNNPJ/W6hZE0rb4fibkO3N6l5U=; b=iQZaEpF1Kp9cd9x/h4MaRGMO4/Ol0pvyrtHjVbAwfLjrsOI2BlP6jSY/FK8nHGf5AseFnQ7ik sV1FFBfU0WPDhwSf6+JchfdnU7Ez9AgnqLjUu0Db71Kwz8A+bdyy8EY X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= If CONFIG_COMPAT_32BIT_TIME is disabled then the vDSO should not provide any 32-bit time related functionality. This is the intended effect of the kconfig option and also the fallback system calls would also not be implemented. Currently the kconfig option does not affect the gettimeofday() syscall, so also keep that in the vDSO. Signed-off-by: Thomas Wei=C3=9Fschuh --- arch/mips/vdso/vdso.lds.S | 4 +++- arch/mips/vdso/vgettimeofday.c | 15 +++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/arch/mips/vdso/vdso.lds.S b/arch/mips/vdso/vdso.lds.S index 76b6ad898288..f60d66bb677d 100644 --- a/arch/mips/vdso/vdso.lds.S +++ b/arch/mips/vdso/vdso.lds.S @@ -96,9 +96,11 @@ VERSION LINUX_2.6 { #ifndef CONFIG_MIPS_DISABLE_VDSO global: - __vdso_clock_gettime; __vdso_gettimeofday; +#if _MIPS_SIM =3D=3D _MIPS_SIM_ABI64 || defined(CONFIG_COMPAT_32BIT_TIME) + __vdso_clock_gettime; __vdso_clock_getres; +#endif #if _MIPS_SIM !=3D _MIPS_SIM_ABI64 __vdso_clock_gettime64; __vdso_clock_getres_time64; diff --git a/arch/mips/vdso/vgettimeofday.c b/arch/mips/vdso/vgettimeofday.c index 00f9fcfc327e..39bc7e55fec4 100644 --- a/arch/mips/vdso/vgettimeofday.c +++ b/arch/mips/vdso/vgettimeofday.c @@ -12,23 +12,26 @@ #include =20 #if _MIPS_SIM !=3D _MIPS_SIM_ABI64 + +#ifdef CONFIG_COMPAT_32BIT_TIME int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts) { return __cvdso_clock_gettime32(clock, ts); } =20 -int __vdso_gettimeofday(struct __kernel_old_timeval *tv, - struct timezone *tz) -{ - return __cvdso_gettimeofday(tv, tz); -} - int __vdso_clock_getres(clockid_t clock_id, struct old_timespec32 *res) { return __cvdso_clock_getres_time32(clock_id, res); } +#endif /* CONFIG_COMPAT_32BIT_TIME */ + +int __vdso_gettimeofday(struct __kernel_old_timeval *tv, + struct timezone *tz) +{ + return __cvdso_gettimeofday(tv, tz); +} =20 int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts) --=20 2.53.0 From nobody Thu Apr 9 12:09:30 2026 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D88433ECBD2; Fri, 27 Feb 2026 06:57:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175473; cv=none; b=npLaoErjgLMaGk/Mlx95OAqdDVCJWOHHTon5layk8fz9/VCzrTxTjQ+clsxXQdpGsihumtPimbd1U1FOex//OKK0HEEICO7e29jvV1KbRK8DzkbGtJKCSsAthAqsTDYyGI5w8qhjx2tmJ2LfEXn4v80iVtdTvhMAWcFcrLROQoA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772175473; c=relaxed/simple; bh=cLipKDdg+OqB2lTcsId3exf9QOD1Z347Ahh8ryEqWfA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=DusfzcwtnjRQQOYGRR6CScmEqsuT/mm2m9hXq1SehZQ+McOKEpWV2bSx8cUXNhQUoPhZCAtCaqBoca5cblQXlEA/cFcgqEKFD5iGNezoW6gBc2Q1k76Bl7peVf9IJd0Pjgenh1o+yFbaZxfb4bZX1N+Mjkt0JEKj9CwwSLwRoHY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=WM9sl9D4; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=97LPGIJ+; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="WM9sl9D4"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="97LPGIJ+" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1772175470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VxVvigSVkiA0ULS8sVET9zTxBqGaaQQOZYasgU53BKI=; b=WM9sl9D45G4EhBesYUN6X9bIzF4n7UWbfaWPLcczKr48l/eUKEn1PBHanrMc2xX9qALzHb oWc4oZFtQMPFhMkDNuPPX4obMLby73fs3uSz8CytLuQqxeAJwo/99arRzwuwDwb/qPXkup cplvt7DNdlg8oqDICn1/Re3b5SdHMhnDFLwzexrVMztfajKYA4pjFe0WgvFTMJA/lq/caI e++XWrqL6s+rRoW+XnrVAuqTObPMyz+nECA6+JwZcnuQTMJy8IQhbOSD7Z7XF4/AZH9d9K MJKlDPtA78I4V+o4QIX+mCO06mmdFyyurx8iWRuYyjxTgISGekzmX+cKedZZmw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1772175470; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VxVvigSVkiA0ULS8sVET9zTxBqGaaQQOZYasgU53BKI=; b=97LPGIJ+SqRO5BCoiDwvuNzmWSD2Y2OZLcd5lia8oyY2WW1Hodb9e+KfCWyZzqdpsstEAH F6q5plVa/e4KTiCQ== Date: Fri, 27 Feb 2026 07:57:46 +0100 Subject: [PATCH 7/7] vdso/gettimeofday: Verify COMPAT_32BIT_TIME interactions Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260227-vdso-compat_32bit_time-v1-7-3f0286a7bac3@linutronix.de> References: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> In-Reply-To: <20260227-vdso-compat_32bit_time-v1-0-3f0286a7bac3@linutronix.de> To: Andy Lutomirski , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Russell King , Catalin Marinas , Will Deacon , Madhavan Srinivasan , Michael Ellerman , Nicholas Piggin , "Christophe Leroy (CS GROUP)" , Thomas Bogendoerfer , Vincenzo Frascino Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, Arnd Bergmann , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1772175466; l=1692; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=cLipKDdg+OqB2lTcsId3exf9QOD1Z347Ahh8ryEqWfA=; b=E0vFBA+/8oxx+AiNSHHAbbL7OvIOo5Bn43vLxk0Bffm871HZFCm5mLjBLyPrKxdS2L+JikbEJ cnxOS5CW/3RA4cT6ZydiAjCUkTSMTDsFk6efPCwkKSdYgQIZ0a6ECwN X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= If CONFIG_COMPAT_32BIT_TIME is disabled then the vDSO should not provide any 32-bit time related functionality. Add some build-time validations to make sure the architecture-specific glue satisfies this requirement. Signed-off-by: Thomas Wei=C3=9Fschuh --- lib/vdso/gettimeofday.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c index 4399e143d43a..0d134ac3dd84 100644 --- a/lib/vdso/gettimeofday.c +++ b/lib/vdso/gettimeofday.c @@ -6,6 +6,8 @@ #include #include =20 +#include + /* Bring in default accessors */ #include =20 @@ -340,6 +342,8 @@ __cvdso_clock_gettime32_data(const struct vdso_time_dat= a *vd, clockid_t clock, struct __kernel_timespec ts; bool ok; =20 + BUILD_BUG_ON(!IS_ENABLED(CONFIG_COMPAT_32BIT_TIME)); + ok =3D __cvdso_clock_gettime_common(vd, clock, &ts); =20 if (unlikely(!ok)) @@ -400,6 +404,8 @@ __cvdso_time_data(const struct vdso_time_data *vd, __ke= rnel_old_time_t *time) const struct vdso_clock *vc =3D vd->clock_data; __kernel_old_time_t t; =20 + BUILD_BUG_ON(sizeof(*time) !=3D 8 && !IS_ENABLED(CONFIG_COMPAT_32BIT_TIME= )); + if (IS_ENABLED(CONFIG_TIME_NS) && vc->clock_mode =3D=3D VDSO_CLOCKMODE_TIMENS) { vd =3D __arch_get_vdso_u_timens_data(vd); @@ -491,6 +497,8 @@ __cvdso_clock_getres_time32_data(const struct vdso_time= _data *vd, clockid_t cloc struct __kernel_timespec ts; bool ok; =20 + BUILD_BUG_ON(!IS_ENABLED(CONFIG_COMPAT_32BIT_TIME)); + ok =3D __cvdso_clock_getres_common(vd, clock, &ts); =20 if (unlikely(!ok)) --=20 2.53.0