From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-002e3701.pphosted.com (mx0b-002e3701.pphosted.com [148.163.143.35]) (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 1033C3D9048 for ; Thu, 21 May 2026 13:23:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.143.35 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779369829; cv=none; b=YC7p6xAaUIPvPVqBR9y80zu60r3KWCJT/nmOiCJZVyvfNCtYuwpPcf5cRDOL4wpC9ZIMikofyvI8IWAIO/McaBDmtOfjvIWydbkAHmuAIyzU88fBk7j21owIF6ly1xDUkw2nFhjTfqXDRG0HVjwnMTx8QjLH6MCh1q/k1bCb7Xg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779369829; c=relaxed/simple; bh=0lesF5d/UlnX+2HsKiYyNz119GkKkTxpthhkK3a8PDY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oUpi5aJB+jmLOqIygTWWA9wq4ruxb4c0DpzigB1InsmtzzVp77wEPs5tSE/U1jAyoq+wwRP0lW0e+XjVnjfHWM+CoDIh04PV2ffz4fJQehvaqFqJM7azF1bodjcpfDTfEUJreYRuHJ5j8dQdYSwt2WNjPmW5WflyN59AYvWE1bU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=hpe.com; spf=pass smtp.mailfrom=hpe.com; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b=Mn3emNLW; arc=none smtp.client-ip=148.163.143.35 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=hpe.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hpe.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hpe.com header.i=@hpe.com header.b="Mn3emNLW" Received: from pps.filterd (m0150244.ppops.net [127.0.0.1]) by mx0b-002e3701.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64LCIKV41717033; Thu, 21 May 2026 13:23:23 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hpe.com; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=pps0720; bh=RIJopH2732lncqnFqEYjjFls7s dN2b1KUYHOIPTLubg=; b=Mn3emNLWLRRh+Fg7zZCyaTvB4F3ysKgVu0CXf+FQ76 ZQBVRaftOX6FcJ0DqC/mAOmidN6DTH7R4M34RLyxmOZmIowVSs9eNp17VySu2r4Y 7ROl4y4Iu4YOZ8HVMZuY7u5ay3D+BWEv/DuMMMd63/vsoJk+bTXV60qhVTaSUHRB BTLyqTkP7KibmhI8Bl7xCaTeMm22URbY/iM96WiO+IehJwph5KEtNPJQ83V1u/Tn Q8hXqixYgLwdJKDCDZhxigFj4JntDe8PvXdc8+2aunMlHFPBJJ9Fu14wd702QxF2 jtmW8drodBlOZLpVVsiDH1lARFLz0dspP8AuEegta5HQ== Received: from p1lg14879.it.hpe.com (p1lg14879.it.hpe.com [16.230.97.200]) by mx0b-002e3701.pphosted.com (PPS) with ESMTPS id 4e9xuy3g3y-1 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 21 May 2026 13:23:23 +0000 (GMT) Received: from p1lg14885.dc01.its.hpecorp.net (unknown [10.119.18.236]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by p1lg14879.it.hpe.com (Postfix) with ESMTPS id C4306130E0; Thu, 21 May 2026 13:23:22 +0000 (UTC) Received: from hpe.com (unknown [16.231.227.36]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by p1lg14885.dc01.its.hpecorp.net (Postfix) with ESMTPS id D80EF8078C8; Thu, 21 May 2026 13:23:20 +0000 (UTC) Date: Thu, 21 May 2026 08:23:18 -0500 From: Dimitri Sivanich To: Linux Kernel Mailing List Cc: Jiri Wiesner , Steve Wahl , Justin Ernst , Kyle Meyer , Russ Anderson , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , "Peter Zijlstra (Intel)" , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Marco Elver , "Guilherme G. Piccoli" , Nikunj A Dadhania , "Xin Li (Intel)" , Dimitri Sivanich Subject: [PATCH v4 2/2] x86/tsc: Disable clocksource watchdog checking on recent and future UV platforms. Message-ID: References: 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=us-ascii Content-Disposition: inline In-Reply-To: X-Proofpoint-GUID: Dl-4OZdVHaj-1QsnNu4rvlGUe4UAuGyC X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIxMDEzMyBTYWx0ZWRfX7EzQrxoiDYYe bPczVfep6xieRuEUC3EqikO7eUOO2I/TuHMHvClQGX34BCAVhNtCg+MIg9kctssnTcnqU8Plqqf +ealL/gpkbUbaA+C7A5NBwpcWCRGnJscR587lxoxpULO4ZBT7YVcHLaeNfZPXjCs47SMkR84P1V ryp8Fq/AxBZKPptSf8xgH2tnNKhD7MDF3gF06PyK8A+wboMQX9IqyHCPRcVLBtts0VJXi8K5SnJ F0hmwP58R78YdckPIXJOlHz7GGLUYynjm2113mlL6GMzrurhXPzQNcioUSgBcSJop0w9HpQ42Q1 O9FskhBuYbXGdK78RnasZomnv/AKYyv9+rwYiEYR1sfAODvzz5WctGWV4nfHiGQXPKPBB3gewQ1 8YfZu7p/OU6OeoI10IJ5vNdy/XRNAe/MmuoklyZiKnylQDrZbrWNMKeCPC0vcif+y8xOnG9DKdw ZNyzaJkhGCQshvK0nDg== X-Proofpoint-ORIG-GUID: Dl-4OZdVHaj-1QsnNu4rvlGUe4UAuGyC X-Authority-Analysis: v=2.4 cv=C9fZDwP+ c=1 sm=1 tr=0 ts=6a0f074b cx=c_pps a=5jkVtQsCUlC8zk5UhkBgHg==:117 a=5jkVtQsCUlC8zk5UhkBgHg==:17 a=kj9zAlcOel0A:10 a=NGcC8JguVDcA:10 a=VkNPw1HP01LnGYTKEx00:22 a=gQcMVamqm3wCPoSYhaRC:22 a=k7r4yCLl9DVLXMiQTbtC:22 a=MvuuwTCpAAAA:8 a=bAHrbcG_lhn49Krd6U8A:9 a=CjuIK1q_8ugA:10 X-HPE-SCL: -1 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-21_02,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 clxscore=1015 malwarescore=0 impostorscore=0 adultscore=0 suspectscore=0 phishscore=0 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605210133 HPE UV hardware and firmware is designed to ensure a reliable and synchronized TSC mechanism. Comparing the TSC against secondary clocksources can result in false positives due to variable access latency caused by system traffic. The best course of action against these false positives has been found to simply disable watchdog checking of the TSC. Commits [1] and [2] were introduced to avoid an issue where the TSC is falsely declared unstable by exempting qualified platforms of up to 4-sockets from TSC clocksource watchdog checking. Extend that exemption to include recent and future UV platforms. [1] 'commit b50db7095fe0 ("x86/tsc: Disable clocksource watchdog for TSC on qualified platorms")' [2] 'commit 233756a640be ("x86/tsc: Extend watchdog check exemption to 4-Sockets platform")' Signed-off-by: Dimitri Sivanich --- arch/x86/kernel/tsc.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index c5110eb554bc..08e8e5511749 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include @@ -1228,6 +1229,20 @@ static void __init tsc_disable_clocksource_watchdog(void) clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY; } +static bool __init platform_is_exempt_from_watchdog(void) +{ + /* Platforms with no more than 4 packages are exempt */ + if (topology_max_packages() <= 4) + return true; + +#ifdef CONFIG_X86_64 + /* Recent UV systems are exempt */ + if (is_uvy_hub()) + return true; +#endif + return false; +} + static void __init check_system_tsc_reliable(void) { #if defined(CONFIG_MGEODEGX1) || defined(CONFIG_MGEODE_LX) || defined(CONFIG_X86_GENERIC) @@ -1246,17 +1261,17 @@ static void __init check_system_tsc_reliable(void) tsc_clocksource_reliable = 1; /* - * Disable the clocksource watchdog when the system has: - * - TSC running at constant frequency - * - TSC which does not stop in C-States - * - the TSC_ADJUST register which allows to detect even minimal + * Disable the clocksource watchdog when the system: + * - has TSC running at constant frequency + * - has TSC which does not stop in C-States + * - has the TSC_ADJUST register which allows to detect even minimal * modifications - * - not more than four packages + * - is exempt from running the clocksource watchdog */ if (boot_cpu_has(X86_FEATURE_CONSTANT_TSC) && boot_cpu_has(X86_FEATURE_NONSTOP_TSC) && boot_cpu_has(X86_FEATURE_TSC_ADJUST) && - topology_max_packages() <= 4) + platform_is_exempt_from_watchdog()) tsc_disable_clocksource_watchdog(); } -- 2.43.0