From nobody Thu Apr 9 03:30:03 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 B20D43CA4A3; Wed, 11 Mar 2026 09:31:33 +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=1773221495; cv=none; b=Y7tJnglMmzfFWcafmt3LhPyVcOmodtSs+eYW4C+QoNMBB0c4XuZiUSyP5Mf48Lu9+dwmEaQxUoG4tXMV3YfQYp0YkP49WMATRDH3PlCln21YdSRwEB1LdvapRgrExZRx4L6rQuE9wyKHgGzO5DRCo5FL0MzBmXMSUUDwt0kvbDQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773221495; c=relaxed/simple; bh=/6a2+qS3URoJcmr4kQlPXsJp5fD3Ci6kK71OU1l9O2s=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=oPfEmY6dLuWSuroeFA88/3Y5gqmpZ1AkA7258SumqJaPZu+1DUBufEan6l6vPJT6mhxedToh/yHm/nz5lbIVdfjfAQ+yp2386ApxAU4hmBbVV4qMfPzEnNuNWYTU7lylguyrYgh9qAXrEnRc7Pp6kdM0CkvHZhJmQw+iK0pits8= 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=DVvECwjx; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=NQdYJ1ds; 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="DVvECwjx"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="NQdYJ1ds" Date: Wed, 11 Mar 2026 09:31:30 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773221492; 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=yMRf2S5ykmu8OfnBQJgc7NyaRwVrCkJ5cadqU5HNaUU=; b=DVvECwjxnTvutGwwATNgkqRAAttxtDhaWfuUbPxQ5HzJLH86Hu4XJj5QuGQyaRUoUqe4Vl qgFLrS7dYlp+hiRK5+ZLpXcUWCsEq3EVubNU9UL7WEyIyUUyKbU1Nrxw3Pj0CWNEm+G34w x9F4my/6lOFWuUEvzBXq3H1Ibu0NdjwjlPwQUTqwl0LvVdyOZ4ojV9m1XTpDohq7Li7mdm QC3Y254S/qxXBA939DH25gp5unGSHCJnT+6pbqNa9fFwkjGPxIQeMB0HJRsJQfLIEgKZC6 PKUAU5dj1lCmD7x3LzZg3hS8fqtULg6j6D7Y5D5flLwJCMPMZZ+rGAzOCXq5FA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773221492; 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=yMRf2S5ykmu8OfnBQJgc7NyaRwVrCkJ5cadqU5HNaUU=; b=NQdYJ1dsnx9k+5xrtP/cBgfxIJ5Q8URQu4t8WH4fmRx+tVzfjA0xoUmNXZK4c9gjI0YhDG KQPlFJQEEgXtMACg== 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] vdso/gettimeofday: Add a helper to test if a clock is namespaced Cc: thomas.weissschuh@linutronix.de, Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260227-vdso-cleanups-v1-3-c848b4bc4850@linutronix.de> References: <20260227-vdso-cleanups-v1-3-c848b4bc4850@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177322149097.1647592.13132025733936859981.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: daa2b92d33a4038123598aff55240ae3c54f870c Gitweb: https://git.kernel.org/tip/daa2b92d33a4038123598aff55240ae3c= 54f870c Author: Thomas Wei=C3=9Fschuh AuthorDate: Fri, 27 Feb 2026 07:43:22 +01:00 Committer: Thomas Gleixner CommitterDate: Wed, 11 Mar 2026 10:27:35 +01:00 vdso/gettimeofday: Add a helper to test if a clock is namespaced Currently this logic is duplicate multiple times. Add a helper for it to make the code more readable. Signed-off-by: Thomas Wei=C3=9Fschuh Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20260227-vdso-cleanups-v1-3-c848b4bc4850@lin= utronix.de --- include/vdso/helpers.h | 7 ++++++- lib/vdso/gettimeofday.c | 9 +++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/include/vdso/helpers.h b/include/vdso/helpers.h index 9ccf6b5..a776554 100644 --- a/include/vdso/helpers.h +++ b/include/vdso/helpers.h @@ -7,6 +7,11 @@ #include #include =20 +static __always_inline bool vdso_is_timens_clock(const struct vdso_clock *= vc) +{ + return IS_ENABLED(CONFIG_TIME_NS) && vc->clock_mode =3D=3D VDSO_CLOCKMODE= _TIMENS; +} + static __always_inline u32 vdso_read_begin(const struct vdso_clock *vc) { u32 seq; @@ -31,7 +36,7 @@ static __always_inline u32 vdso_read_begin(const struct v= dso_clock *vc) static __always_inline bool vdso_read_begin_timens(const struct vdso_clock= *vc, u32 *seq) { while (unlikely((*seq =3D READ_ONCE(vc->seq)) & 1)) { - if (IS_ENABLED(CONFIG_TIME_NS) && vc->clock_mode =3D=3D VDSO_CLOCKMODE_T= IMENS) + if (vdso_is_timens_clock(vc)) return true; cpu_relax(); } diff --git a/lib/vdso/gettimeofday.c b/lib/vdso/gettimeofday.c index e493696..2faed78 100644 --- a/lib/vdso/gettimeofday.c +++ b/lib/vdso/gettimeofday.c @@ -343,8 +343,7 @@ __cvdso_gettimeofday_data(const struct vdso_time_data *= vd, } =20 if (unlikely(tz !=3D NULL)) { - if (IS_ENABLED(CONFIG_TIME_NS) && - vc->clock_mode =3D=3D VDSO_CLOCKMODE_TIMENS) + if (vdso_is_timens_clock(vc)) vd =3D __arch_get_vdso_u_timens_data(vd); =20 tz->tz_minuteswest =3D vd[CS_HRES_COARSE].tz_minuteswest; @@ -367,8 +366,7 @@ __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 - if (IS_ENABLED(CONFIG_TIME_NS) && - vc->clock_mode =3D=3D VDSO_CLOCKMODE_TIMENS) { + if (vdso_is_timens_clock(vc)) { vd =3D __arch_get_vdso_u_timens_data(vd); vc =3D vd->clock_data; } @@ -399,8 +397,7 @@ bool __cvdso_clock_getres_common(const struct vdso_time= _data *vd, clockid_t cloc if (!vdso_clockid_valid(clock)) return false; =20 - if (IS_ENABLED(CONFIG_TIME_NS) && - vc->clock_mode =3D=3D VDSO_CLOCKMODE_TIMENS) + if (vdso_is_timens_clock(vc)) vd =3D __arch_get_vdso_u_timens_data(vd); =20 /*