From nobody Tue Apr 7 16:32:14 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 AAAB73B6365; Thu, 12 Mar 2026 11:25:28 +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=1773314729; cv=none; b=l+DZ03zW5REFGGwwPTJINtD08RemM1n8OceHqkES3g/NL6DldChckllMezbwwro0qttSMHk6K37ls79j59jlzlpdmiLXit5lXUdon++e206Vn8UDQA0cX+kWW8mBpCxrh781JwVf8y0od8aJMaQAeHubHyHzFc5alOyLlkXweqY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773314729; c=relaxed/simple; bh=mc02iWV3s97GN8MHKdL8TLAlF8vFl3SKIX0K5evVpfU=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=BTiTzPB1ZEE7dG53VwhOsx4kgOOYHWjVvq/eAEndLPwZ8nBQ9f+17TWxqDD+r1WTqIcbBt+xnx2H2LTSRGyWkaVSZ6S0VDtzXeWGdEOtX705YWCiRgbmFTouOAywgOEHyRrNwXML8g60Oqk3V1oqlyhpaAhxfxAYduh6OU/pkmM= 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=1ZC2Bsg0; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=7WrBUQEU; 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="1ZC2Bsg0"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="7WrBUQEU" Date: Thu, 12 Mar 2026 11:25:25 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1773314727; 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=SoHqqGi+7hRU7CvpxF7wivePQmUTQLfhdfJwPkwxMX4=; b=1ZC2Bsg0nQaTtwg+5PbbIILD0R7a4fXihhrC4UjmTWgQiVX5u4WGTqIG0xaEH6cE9e9v4t b6+aI/dznv/34fgwqThE4SUcFpLDECXmR8ejcpDgA45aT9Tu9axDGh1PxryK1wYoWCBTGk vXeX5YMD3sxY3dZBCZSFB9+94DKmQRz9BGakaX958fphLmriO/W7OVAkYutzexOOtWgcpS bjN7ShkwCydd1ng+P5iX3idAbP+QfHlV+mSXqtVoz7W8Wf8+bc06+/FMvYg++1hkPByTcy 3EZYzcbVp7gMlN5pN5Ik4ExMLGsvkgH0VAQQpLZCv1i4C9tGQ03EkWmuAzlu1A== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1773314727; 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=SoHqqGi+7hRU7CvpxF7wivePQmUTQLfhdfJwPkwxMX4=; b=7WrBUQEUiYQMEZzsCIBHVobKYYbX7si4Sfo2HPO9G0ayQXfpmbqT2zJEgENd+H88wxx3Yr vmAANDpmbtJBc0CA== From: "tip-bot2 for Thomas Gleixner" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/core] x86/tsc: Handle CLOCK_SOURCE_VALID_FOR_HRES correctly Cc: Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260123231521.790598171@kernel.org> References: <20260123231521.790598171@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <177331472579.1647592.2205813610153555469.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/core branch of tip: Commit-ID: 79ccb0693a99e1b91eba95c6bd32a3e02be156ae Gitweb: https://git.kernel.org/tip/79ccb0693a99e1b91eba95c6bd32a3e02= be156ae Author: Thomas Gleixner AuthorDate: Sat, 24 Jan 2026 00:17:55 +01:00 Committer: Thomas Gleixner CommitterDate: Thu, 12 Mar 2026 12:23:27 +01:00 x86/tsc: Handle CLOCK_SOURCE_VALID_FOR_HRES correctly Unconditionally setting the CLOCK_SOURCE_VALID_FOR_HRES for the real TSC clocksource is wrong as there is no guarantee that the early TSC was validated for high resolution mode. Set the flag only when the early TSC was validated as otherwise the clocksource selection might enable high resolution mode with a TSC of unknown quality and possibly no way to back out once it is discovered to be unsuitable. Signed-off-by: Thomas Gleixner Link: https://patch.msgid.link/20260123231521.790598171@kernel.org --- arch/x86/kernel/tsc.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index f31046f..9ccd58c 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -1200,7 +1200,6 @@ static struct clocksource clocksource_tsc =3D { .read =3D read_tsc, .mask =3D CLOCKSOURCE_MASK(64), .flags =3D CLOCK_SOURCE_IS_CONTINUOUS | - CLOCK_SOURCE_VALID_FOR_HRES | CLOCK_SOURCE_CAN_INLINE_READ | CLOCK_SOURCE_MUST_VERIFY | CLOCK_SOURCE_VERIFY_PERCPU | @@ -1411,6 +1410,15 @@ out: have_art =3D true; clocksource_tsc.base =3D &art_base_clk; } + + /* + * Transfer the valid for high resolution flag if it was set on the + * early TSC already. That guarantees that there is no intermediate + * clocksource selected once the early TSC is unregistered. + */ + if (clocksource_tsc_early.flags & CLOCK_SOURCE_VALID_FOR_HRES) + clocksource_tsc.flags |=3D CLOCK_SOURCE_VALID_FOR_HRES; + clocksource_register_khz(&clocksource_tsc, tsc_khz); unreg: clocksource_unregister(&clocksource_tsc_early);