From mboxrd@z Thu Jan 1 00:00:00 1970 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 80B5136A366; Tue, 30 Jun 2026 07:38:40 +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=1782805121; cv=none; b=uD0ecSFWSDf14F5WBKCbAgSMcJcmAL0DLdGFXP6wcsAXAfsP8K8WGeVuq7O/PIK/ftk4i1Wfm3AVzt4lTzJyKE3q3S1jBmTMuL6xOyDdzuRIBkCyqK3+j075IEFo9g+CS/kQrHk23j+9mEuYxN0zHg6JETKbqIItKDdw5QnB+9E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782805121; c=relaxed/simple; bh=5A3ufT/BlAl4IMY/Ptlcs79bMJADg0kjD64uZGVIocg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=FrfYsQ1Ix75cXwCoSwK8XxOPmWI9Ncu8TZIDc1WhjNVloffD97sXJ9l6i0pses3W+uNxUw6ACCch2kXK9d59KzMAhYhme+cb3ebuh844qbIqJ/9HvMrMlZzp1sExigGpooXpyB1v7d189TZZdNNnRUXBYVQ8GjkW4XsfMFbVSKg= 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=h+IH3bIb; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=F9dovyTg; 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="h+IH3bIb"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="F9dovyTg" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1782805119; 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=WgU1XNPY0vIUYdQ/FaYaRLqUo4Ff/LB/v3f+zOEPBiQ=; b=h+IH3bIb4hWPAsWvZ9L+T8/HyGFJ0+d2m1BDfA9jlQQqd7hcgQaruHtYDaXdtqMVXigWW1 9P6ghnGQNfIi9lg1IbgL2IPYfthldRToINTF0IQbuhnP26EZtQOuaD2c3LLwNWSWgjgP11 QvG0SJ5Pb9tOXQj90FzhQQa9fNqa3P25ETnLRbVEJ/f5D894D+zlmc3lXSc1PcSWbsYY5y yai7jrcbn6iRKfSCtixhTz+LejYbyNQX3Vjo3mcKZ5pCUDDLbj+NFGzAVRjNC1UhdYxQDV hdkzd/OyQpC7nfwW/+UnxBb7t5JrRy5/QlV1kG/2xLN9H9AlQPLk/p7fV6MvTw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1782805119; 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=WgU1XNPY0vIUYdQ/FaYaRLqUo4Ff/LB/v3f+zOEPBiQ=; b=F9dovyTgsQ94qzEBBtODBH6sasghBtq0x8pMwb559L+KL31pipNar8eEoVI8R8PXToRPCD iH5xgFeGgMybUQBw== Date: Tue, 30 Jun 2026 09:38:32 +0200 Subject: [PATCH v2 3/9] x86/vdso: Respect COMPAT_32BIT_TIME Precedence: bulk X-Mailing-List: linux-api@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit Message-Id: <20260630-vdso-compat_32bit_time-v2-3-520d194640dd@linutronix.de> References: <20260630-vdso-compat_32bit_time-v2-0-520d194640dd@linutronix.de> In-Reply-To: <20260630-vdso-compat_32bit_time-v2-0-520d194640dd@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 , John Stultz , Stephen Boyd , "David S. Miller" , Andreas Larsson Cc: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-mips@vger.kernel.org, Arnd Bergmann , linux-api@vger.kernel.org, sparclinux@vger.kernel.org X-Developer-Signature: v=1; a=ed25519-sha256; t=1782805116; l=3352; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=5A3ufT/BlAl4IMY/Ptlcs79bMJADg0kjD64uZGVIocg=; b=PzY+KudQ5YnvlX0RMo1JjTVOXOGayc171Vg7wV3AE9FjYs8epGJlmnq56c01HywzI2H8jpNZ9 fSfaOYKxkeiDOtUbZXvBhCoJb+KXXreeoSjmohCrORyvtYjO9ZiZAoM 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ßschuh --- arch/x86/entry/vdso/common/vclock_gettime.c | 20 ++++++++++++-------- arch/x86/entry/vdso/vdso32/vdso32.lds.S | 2 ++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/arch/x86/entry/vdso/common/vclock_gettime.c b/arch/x86/entry/vdso/common/vclock_gettime.c index 57066f346b3f..304dbd1f9db4 100644 --- a/arch/x86/entry/vdso/common/vclock_gettime.c +++ b/arch/x86/entry/vdso/common/vclock_gettime.c @@ -15,6 +15,7 @@ #include "lib/vdso/gettimeofday.c" +#if defined(__x86_64__) || defined(CONFIG_COMPAT_32BIT_TIME) int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz) { return __cvdso_gettimeofday(tv, tz); @@ -29,6 +30,7 @@ __kernel_old_time_t __vdso_time(__kernel_old_time_t *t) } __kernel_old_time_t time(__kernel_old_time_t *t) __attribute__((weak, alias("__vdso_time"))); +#endif /* CONFIG_COMPAT_32BIT_TIME */ #if defined(CONFIG_X86_64) && !defined(BUILD_VDSO32_64) @@ -51,6 +53,7 @@ int clock_getres(clockid_t, struct __kernel_timespec *) #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_timespec32 *ts) int clock_gettime(clockid_t, struct old_timespec32 *) __attribute__((weak, alias("__vdso_clock_gettime"))); -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_timespec32 *res) 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"))); 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 cee8f7f9fe80..00629192db56 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_clock_gettime64; __vdso_clock_getres_time64; __vdso_getcpu; -- 2.55.0