From nobody Tue Apr 7 23:43:43 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 C8F3A3EDAB5; Wed, 11 Mar 2026 09:31:43 +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=1773221505; cv=none; b=ErGB5ztXQRGZ3HQCKXblBXePXKLsNnn7RrgptRiMd4PYRISmY4jnTaCWBA5RHl3PTy0WHwhyp9WqdID2Af/F0ALUeYVDNpoFWTKmarkwqHgQrbVEQ/dJBL/2FJg22JK6zDs5rc4K+We+wQQg67Curj7Xhvhjo6Q/5lLhPuR/UHs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773221505; c=relaxed/simple; bh=9e4Lb11LzGCWdMnd1HXSiAYuqzAVvxo/4qnAINzsIjA=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=Ntje0k6cHkKWToTI2BSKIAHoLTpjSXCoO97KCfsm52nl1Rz/LRkVMbF9C5Tw+CC4Bjwqm0nH5NSd0ukXSZwisBg2Wba6F7lCtpBxclFm/AAGalI4ZAISHnejojVaNdbj0aGV/epfpo7AQj6z80b3/cCzaUBV6m4fJ2d3Z3QGvP8= 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=oBB7V1PE; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=1ALv0/Oo; 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="oBB7V1PE"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="1ALv0/Oo" Date: Wed, 11 Mar 2026 09:31:40 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773221502; h=from:from:sender:sender:reply-to: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=AJxqW5r3mtvJ20TBb8/20cqwW4KFrwtwV+Mh+mqn7ro=; b=oBB7V1PENSKBKxw/DV6e7HqneM4sIGBnfiEWNESEna3LsmCTCYWMmIxaoV2POnSZb7NSoS gc+Ia4gfyPDbL7rhlrYAx8vBZGlJgPrVeMyiOP+Dj28m3Kqq59J8A5fwUAlK2Q40bCwOcc 0rSLqHqu5rfsX99wRYYKbJqvtkQdYpmcAgZqZ4U9lPS2BHOfI3Q6wnjsxMm+NaJVU90ufD twTvddqtaS/qngWovWuDSDt3gEfzX0JYm0p6vbJBNYwSDJK3laQvMcvSXVlSZktTt40VJx qJzea37j+rGSa+uR1UbQ/wgsWoqbLpm77dgOde0ZsqnX0ihipma5M6fxYlZFug== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773221502; h=from:from:sender:sender:reply-to: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=AJxqW5r3mtvJ20TBb8/20cqwW4KFrwtwV+Mh+mqn7ro=; b=1ALv0/OoW2wC/ksxJ3vMsQI8sMSI867Jvd1KV0bMEGbPTIm9yVujrHN/ELOQGuwAKQywZ0 KxYbdQZ7Doxs3gDA== From: tip-bot2 for Thomas =?utf-8?q?Wei=C3=9Fschuh?= Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/vdso] sparc64: vdso: Move syscall fallbacks into header Cc: thomas.weissschuh@linutronix.de, Thomas Gleixner , Andreas Larsson , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260304-vdso-sparc64-generic-2-v6-8-d8eb3b0e1410@linutronix.de> References: <20260304-vdso-sparc64-generic-2-v6-8-d8eb3b0e1410@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177322150096.1647592.5742647453189981184.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the timers/vdso branch of tip: Commit-ID: d60c682bce3dce963d6cf8208ed60d586004ce49 Gitweb: https://git.kernel.org/tip/d60c682bce3dce963d6cf8208ed60d586= 004ce49 Author: Thomas Wei=C3=9Fschuh AuthorDate: Wed, 04 Mar 2026 08:49:05 +01:00 Committer: Thomas Gleixner CommitterDate: Wed, 11 Mar 2026 10:18:32 +01:00 sparc64: vdso: Move syscall fallbacks into header The generic vDSO libraries expected the syscall fallbacks in asm/vdso/gettimeofday.h. To prepare the adoption of the generic library, move the existing functions there. While at it, rename them so they match what the generic library expects. Signed-off-by: Thomas Wei=C3=9Fschuh Signed-off-by: Thomas Gleixner Tested-by: Andreas Larsson Reviewed-by: Andreas Larsson Acked-by: Andreas Larsson Link: https://patch.msgid.link/20260304-vdso-sparc64-generic-2-v6-8-d8eb3b0= e1410@linutronix.de --- arch/sparc/include/asm/vdso/gettimeofday.h | 50 +++++++++++++++++++++- arch/sparc/vdso/vclock_gettime.c | 51 +--------------------- 2 files changed, 52 insertions(+), 49 deletions(-) diff --git a/arch/sparc/include/asm/vdso/gettimeofday.h b/arch/sparc/includ= e/asm/vdso/gettimeofday.h index 31f6505..429dc08 100644 --- a/arch/sparc/include/asm/vdso/gettimeofday.h +++ b/arch/sparc/include/asm/vdso/gettimeofday.h @@ -6,6 +6,9 @@ #ifndef _ASM_SPARC_VDSO_GETTIMEOFDAY_H #define _ASM_SPARC_VDSO_GETTIMEOFDAY_H =20 +#include +#include + #include #include =20 @@ -75,4 +78,51 @@ static __always_inline u64 __arch_get_hw_counter(struct = vvar_data *vvar) return vread_tick(); } =20 +#ifdef CONFIG_SPARC64 +#define SYSCALL_STRING \ + "ta 0x6d;" \ + "bcs,a 1f;" \ + " sub %%g0, %%o0, %%o0;" \ + "1:" +#else +#define SYSCALL_STRING \ + "ta 0x10;" \ + "bcs,a 1f;" \ + " sub %%g0, %%o0, %%o0;" \ + "1:" +#endif + +#define SYSCALL_CLOBBERS \ + "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ + "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ + "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ + "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ + "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46", \ + "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", \ + "cc", "memory" + +static __always_inline +long clock_gettime_fallback(clockid_t clock, struct __kernel_old_timespec = *ts) +{ + register long num __asm__("g1") =3D __NR_clock_gettime; + register long o0 __asm__("o0") =3D clock; + register long o1 __asm__("o1") =3D (long) ts; + + __asm__ __volatile__(SYSCALL_STRING : "=3Dr" (o0) : "r" (num), + "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); + return o0; +} + +static __always_inline +long gettimeofday_fallback(struct __kernel_old_timeval *tv, struct timezon= e *tz) +{ + register long num __asm__("g1") =3D __NR_gettimeofday; + register long o0 __asm__("o0") =3D (long) tv; + register long o1 __asm__("o1") =3D (long) tz; + + __asm__ __volatile__(SYSCALL_STRING : "=3Dr" (o0) : "r" (num), + "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); + return o0; +} + #endif /* _ASM_SPARC_VDSO_GETTIMEOFDAY_H */ diff --git a/arch/sparc/vdso/vclock_gettime.c b/arch/sparc/vdso/vclock_gett= ime.c index 16ac809..e768c0b 100644 --- a/arch/sparc/vdso/vclock_gettime.c +++ b/arch/sparc/vdso/vclock_gettime.c @@ -13,38 +13,13 @@ */ =20 #include -#include #include #include -#include #include #include #include #include =20 -#ifdef CONFIG_SPARC64 -#define SYSCALL_STRING \ - "ta 0x6d;" \ - "bcs,a 1f;" \ - " sub %%g0, %%o0, %%o0;" \ - "1:" -#else -#define SYSCALL_STRING \ - "ta 0x10;" \ - "bcs,a 1f;" \ - " sub %%g0, %%o0, %%o0;" \ - "1:" -#endif - -#define SYSCALL_CLOBBERS \ - "f0", "f1", "f2", "f3", "f4", "f5", "f6", "f7", \ - "f8", "f9", "f10", "f11", "f12", "f13", "f14", "f15", \ - "f16", "f17", "f18", "f19", "f20", "f21", "f22", "f23", \ - "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31", \ - "f32", "f34", "f36", "f38", "f40", "f42", "f44", "f46", \ - "f48", "f50", "f52", "f54", "f56", "f58", "f60", "f62", \ - "cc", "memory" - /* * Compute the vvar page's address in the process address space, and retur= n it * as a pointer to the vvar_data. @@ -64,28 +39,6 @@ notrace static __always_inline struct vvar_data *get_vva= r_data(void) return (struct vvar_data *) ret; } =20 -notrace static long vdso_fallback_gettime(long clock, struct __kernel_old_= timespec *ts) -{ - register long num __asm__("g1") =3D __NR_clock_gettime; - register long o0 __asm__("o0") =3D clock; - register long o1 __asm__("o1") =3D (long) ts; - - __asm__ __volatile__(SYSCALL_STRING : "=3Dr" (o0) : "r" (num), - "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); - return o0; -} - -notrace static long vdso_fallback_gettimeofday(struct __kernel_old_timeval= *tv, struct timezone *tz) -{ - register long num __asm__("g1") =3D __NR_gettimeofday; - register long o0 __asm__("o0") =3D (long) tv; - register long o1 __asm__("o1") =3D (long) tz; - - __asm__ __volatile__(SYSCALL_STRING : "=3Dr" (o0) : "r" (num), - "0" (o0), "r" (o1) : SYSCALL_CLOBBERS); - return o0; -} - notrace static __always_inline u64 vgetsns(struct vvar_data *vvar) { u64 v; @@ -184,7 +137,7 @@ __vdso_clock_gettime(clockid_t clock, struct __kernel_o= ld_timespec *ts) /* * Unknown clock ID ? Fall back to the syscall. */ - return vdso_fallback_gettime(clock, ts); + return clock_gettime_fallback(clock, ts); } int clock_gettime(clockid_t, struct __kernel_old_timespec *) @@ -220,7 +173,7 @@ __vdso_gettimeofday(struct __kernel_old_timeval *tv, st= ruct timezone *tz) } return 0; } - return vdso_fallback_gettimeofday(tv, tz); + return gettimeofday_fallback(tv, tz); } int gettimeofday(struct __kernel_old_timeval *, struct timezone *)