From nobody Thu Sep 24 19:24:27 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 C212044E67D; Mon, 21 Sep 2026 09:54:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789984454; cv=none; b=X75b5ZWN/Ftcj0FAnTYJlqylg0r8J40tm6nZcvVDExO3iVDyRUQErqFac5T8KEFD084k+xKF+aM4WGypU3cRnKMzQlVaq52ACZOnE6Iq3lGKzp4OXOyvd70pyluWdqCny4EcfM1dX8tSDpWcDAKGd42HsWnXf0XRh/bLlSvm2T4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789984454; c=relaxed/simple; bh=u8+Wo5bVYCOs/gBbJ4eQuBX3XO9EzF3ApSswvDpbuw8=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Y0ByaITkCKjsZPVyFmURdlb70RXnCgGVCbjZS1jkI78bgZYen3Cn8SrG7GwBHZtoiZtFnQjfexy67CshSl+4T7Z4QMM2BWXHW8+G98Qd0sWrKvf07ODIfyu1ivaZTOVDOSemnom1UrzOuu7qe3ebC3/uXgyniVUBtYim+OWDsAg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=UVOXXIs4; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="UVOXXIs4" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1789984449; bh=u8+Wo5bVYCOs/gBbJ4eQuBX3XO9EzF3ApSswvDpbuw8=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=UVOXXIs4k5R4biXZkn11H8JoGD4HiJ9Nc+zSDWjjiA7adTQy3H5a/raE2+v5jvpiu iAj1pb2zMSN0Nn+1zwMuacSXIJnFGyHX6X5WuQLatxXWJ0uJel1IIDQV1r45Q6qJzh utEbitAtVxny8DFwhIgAPFgO2Y1v2dH+B7KN/4HQ= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 21 Sep 2026 11:54:00 +0200 Subject: [PATCH 1/3] selftests: vDSO: vdso_test_abi: Also test ALARM clocks 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: <20260921-vdso-alarm-clocks-v1-1-617abb5271c7@weissschuh.net> References: <20260921-vdso-alarm-clocks-v1-0-617abb5271c7@weissschuh.net> In-Reply-To: <20260921-vdso-alarm-clocks-v1-0-617abb5271c7@weissschuh.net> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789984448; l=1232; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=u8+Wo5bVYCOs/gBbJ4eQuBX3XO9EzF3ApSswvDpbuw8=; b=dMUbh9vGJ0Gd1F3Ajq6S04iwC0EIkWY4MpDKxCoFnaJvxgUxdXrnmuGDT+AiNliYLIRLRam1v 1eVgBc0o9BSBXi9TVB2nmDqyHR26p+1g4EEvMxx+tyxj5NdVA4MLOKL X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= Extend the tests to also handle CLOCK_REALTIME_ALARM and CLOCK_BOOTTIME_ALARM. These are currently not handled by the vDSO, so will fall through to the system call and succeed. The tests will become useful when the vDSO will start handling these clocks in later patches. --- tools/testing/selftests/vDSO/vdso_test_abi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/vDSO/vdso_test_abi.c b/tools/testing/s= elftests/vDSO/vdso_test_abi.c index b162a4ba9c4f..4f538928e1d4 100644 --- a/tools/testing/selftests/vDSO/vdso_test_abi.c +++ b/tools/testing/selftests/vDSO/vdso_test_abi.c @@ -261,7 +261,7 @@ static inline void vdso_test_clock(clockid_t clock_id) vdso_test_clock_getres_time64(clock_id); } =20 -#define VDSO_TEST_PLAN 38 +#define VDSO_TEST_PLAN 46 =20 int main(int argc, char **argv) { @@ -284,7 +284,9 @@ int main(int argc, char **argv) vdso_test_gettimeofday(); =20 vdso_test_clock(CLOCK_REALTIME); + vdso_test_clock(CLOCK_REALTIME_ALARM); vdso_test_clock(CLOCK_BOOTTIME); + vdso_test_clock(CLOCK_BOOTTIME_ALARM); vdso_test_clock(CLOCK_TAI); vdso_test_clock(CLOCK_REALTIME_COARSE); vdso_test_clock(CLOCK_MONOTONIC); --=20 2.55.0 From nobody Thu Sep 24 19:24:27 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 C410746D2DC; Mon, 21 Sep 2026 09:54:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789984453; cv=none; b=NJ/AwHFJinViWRkG2X7wlru5IAw3uDhLLiREFDbHjYEOzA46i5hGaBZU4EeJIP0iT3KB02NweT1k8XlygGOd3FDMOtw9A/DL5S3vZl+OYb/VoRSYJVzikxmsNhek/n6TEfEnmjgzbjmYoTBka1dqFvv7/BuXdruKETSNUFXzvG4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789984453; c=relaxed/simple; bh=ZqQ9OsQlu40OI7oeLvjaumExphHJKVJMBJBKRLMleoE=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ITuTeVNknWgMA3f0Vm1mMsb3ipEU8ubzlGdSYfzi/wfWy7nhbIRxF5XmUKHqDg/XLCDxNFO+Y++1kjKjVF/LWlS+N7cLBWiBFKMnRBKe66QH/dL3kwiXY+Lag2F1XFUbC04rTO0pSHyhsZJwTNkJXQ5ldRoJFfO2L52EZFe1Om0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=GtFZY7kC; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="GtFZY7kC" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1789984449; bh=ZqQ9OsQlu40OI7oeLvjaumExphHJKVJMBJBKRLMleoE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=GtFZY7kC6aW1Jat4qL/x9ZrF0qCIFc5f9KSwGyOcjTlXd/OaN4d7umPkNJkAMdWz3 DVVCzTta7B6ifKZP7E1Iqvc5WeTiCWIhn3Nh2Me4xXOG4KSa+xV3z1x9j73uJHrgPd zt+jIY5+qFpOk1XhGXksWk9Ap8MTl1PCPUDLKtL0= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 21 Sep 2026 11:54:01 +0200 Subject: [PATCH 2/3] vdso/gettimeofday: Add support for CLOCK_BOOTTIME_ALARM 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: <20260921-vdso-alarm-clocks-v1-2-617abb5271c7@weissschuh.net> References: <20260921-vdso-alarm-clocks-v1-0-617abb5271c7@weissschuh.net> In-Reply-To: <20260921-vdso-alarm-clocks-v1-0-617abb5271c7@weissschuh.net> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789984448; l=1549; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=ZqQ9OsQlu40OI7oeLvjaumExphHJKVJMBJBKRLMleoE=; b=EOzUsGrBDTD6hx0RJYhu6oB9t+DkM5CpYuE/hDgVJCPmK4P+JudERogYbzT515Comp+41JIVN yTslyS2YQIABWUusxxDLvhmpDeKxT0d+9shi4WhXQ2/VdrTHhc1cLOq X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= CLOCK_BOOTTIME_ALARM behaves exactly as CLOCK_BOOTTIME as far as the vDSO is concerned. The vDSO library can handle it automatically correctly. Only the basetime needs to be maintained during the tick. The namespace offset is already set correctly, although it was not used before. Reuse the CLOCK_BOOTTIME basetime for CLOCK_BOOTTIME_ALARM and update the userspace hres clock mask to include CLOCK_BOOTTIME_ALARM. --- include/vdso/datapage.h | 1 + kernel/time/vsyscall.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h index 09897f76ae07..33297b5e2521 100644 --- a/include/vdso/datapage.h +++ b/include/vdso/datapage.h @@ -35,6 +35,7 @@ struct vdso_arch_data { #define VDSO_HRES (BIT(CLOCK_REALTIME) | \ BIT(CLOCK_MONOTONIC) | \ BIT(CLOCK_BOOTTIME) | \ + BIT(CLOCK_BOOTTIME_ALARM) | \ BIT(CLOCK_TAI)) #define VDSO_COARSE (BIT(CLOCK_REALTIME_COARSE) | \ BIT(CLOCK_MONOTONIC_COARSE)) diff --git a/kernel/time/vsyscall.c b/kernel/time/vsyscall.c index aa59919b8f2c..24082b9d7869 100644 --- a/kernel/time/vsyscall.c +++ b/kernel/time/vsyscall.c @@ -63,6 +63,9 @@ static inline void update_vdso_time_data(struct vdso_time= _data *vdata, struct ti } vdso_ts->nsec =3D nsec; =20 + /* CLOCK_BOOTTIME_ALARM, copy of CLOCK_BOOTIME */ + vc[CS_HRES_COARSE].basetime[CLOCK_BOOTTIME_ALARM] =3D *vdso_ts; + /* CLOCK_MONOTONIC_RAW */ vdso_ts =3D &vc[CS_RAW].basetime[CLOCK_MONOTONIC_RAW]; vdso_ts->sec =3D tk->raw_sec; --=20 2.55.0 From nobody Thu Sep 24 19:24:27 2026 Received: from todd.t-8ch.de (todd.t-8ch.de [159.69.126.157]) (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 D9CF346E01A; Mon, 21 Sep 2026 09:54:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=159.69.126.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789984453; cv=none; b=GIex9tBKFBui/qmQ0jfygqB1CdDgkkRBIWPRWCGmgH8beTw86GKsmJ5xZLjQy1ymSfj/QAG7zZ5Kw/KE1Euu2PwbIXWhp5V06me+ta0VK52MKwcb0mqK69VP9V+OJvMUTOV4No1Ert+036aTyAL7y7jKnNXLqg6mLffkQx+KT9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789984453; c=relaxed/simple; bh=HI4VPXrmlX1durqmX0VCRg379rFhRaIdAtjE4Lwyjmw=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Kfa/MGJ7If5NLkaZM0S2d8IKaZmnpyS3O+sYZY/8fO3P6hW70PBUU9I/onF2TyuS8EGvGpxvKFTIMB0F/e1OSlXuAooTPMpYn+Mqb/y82jCgULeBuVSyhpN6f/K55nSBbwMOgVN5ZWlL/MBivzCUoMKzMbzczu7XBXVFjIOZlTI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net; spf=pass smtp.mailfrom=weissschuh.net; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b=Rlj5toD3; arc=none smtp.client-ip=159.69.126.157 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=weissschuh.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=weissschuh.net header.i=@weissschuh.net header.b="Rlj5toD3" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=weissschuh.net; s=mail; t=1789984449; bh=HI4VPXrmlX1durqmX0VCRg379rFhRaIdAtjE4Lwyjmw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Rlj5toD3LYoRSNF/Z5yy4KDGwmXhBahOy9lHZptT8RA5Ivq0AF+BuWmhKTNtg5ic+ OKBZDdswsAhQvciAkaJpi8njljEdIka5cgHDmWSEXP3bYlzxX2xAyzXLmoGDx5E33N EW6v8f8/jDOjavtW95k3pOSh2h44oMF065IGichc= From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= Date: Mon, 21 Sep 2026 11:54:02 +0200 Subject: [PATCH 3/3] vdso/gettimeofday: Add support for CLOCK_REALTIME_ALARM 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: <20260921-vdso-alarm-clocks-v1-3-617abb5271c7@weissschuh.net> References: <20260921-vdso-alarm-clocks-v1-0-617abb5271c7@weissschuh.net> In-Reply-To: <20260921-vdso-alarm-clocks-v1-0-617abb5271c7@weissschuh.net> To: Andy Lutomirski , Thomas Gleixner , Vincenzo Frascino , Shuah Khan Cc: linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1789984448; l=1573; i=linux@weissschuh.net; s=20221212; h=from:subject:message-id; bh=HI4VPXrmlX1durqmX0VCRg379rFhRaIdAtjE4Lwyjmw=; b=LrHPJJitOO4Eppm4WO0LExhYu+npbD65YSKsW3Tzrm0QuPkvr5Bwk6Y4SiJ2sXByLBFOLKJ5u YDDMjTLzivHDORK3HIXwDcaIiXJOzsjQhDKL7VIuaQbRjAvvFcWyhP5 X-Developer-Key: i=linux@weissschuh.net; a=ed25519; pk=KcycQgFPX2wGR5azS7RhpBqedglOZVgRPfdFSPB1LNw= CLOCK_REALTIME_ALARM behaves exactly as CLOCK_REALTIME as far as the vDSO is concerned. The vDSO library can handle it automatically correctly. Only the basetime needs to be maintained during the tick. Reuse the CLOCK_REALTIME basetime for CLOCK_REALTIME_ALARM and update the userspace hres clock mask to include CLOCK_REALTIME_ALARM. --- include/vdso/datapage.h | 1 + kernel/time/vsyscall.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/include/vdso/datapage.h b/include/vdso/datapage.h index 33297b5e2521..0aa28a484dcd 100644 --- a/include/vdso/datapage.h +++ b/include/vdso/datapage.h @@ -33,6 +33,7 @@ struct vdso_arch_data { #define VDSO_BASES (CLOCK_TAI + 1) #define VDSO_BASE_AUX 0 #define VDSO_HRES (BIT(CLOCK_REALTIME) | \ + BIT(CLOCK_REALTIME_ALARM) | \ BIT(CLOCK_MONOTONIC) | \ BIT(CLOCK_BOOTTIME) | \ BIT(CLOCK_BOOTTIME_ALARM) | \ diff --git a/kernel/time/vsyscall.c b/kernel/time/vsyscall.c index 24082b9d7869..b32bfded7d53 100644 --- a/kernel/time/vsyscall.c +++ b/kernel/time/vsyscall.c @@ -75,6 +75,10 @@ static inline void update_vdso_time_data(struct vdso_tim= e_data *vdata, struct ti vdso_ts =3D &vc[CS_HRES_COARSE].basetime[CLOCK_TAI]; vdso_ts->sec =3D tk->xtime_sec + (s64)tk->tai_offset; vdso_ts->nsec =3D tk->tkr_mono.xtime_nsec; + + /* CLOCK_REALTIME_ALARM, copy of CLOCK_REALTIME */ + vdso_ts =3D &vc[CS_HRES_COARSE].basetime[CLOCK_REALTIME_ALARM]; + *vdso_ts =3D vc[CS_HRES_COARSE].basetime[CLOCK_REALTIME]; } =20 void update_vsyscall(struct timekeeper *tk) --=20 2.55.0