[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] x86: Add Kconfig option to use a 32bit TLB clock on debug
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
- Date: Mon, 12 Jan 2026 15:08:44 +0100
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=E3pxIqWYN/jIUsRS+Yl3k11oyQPxieIYHxnURhwQgLs=; b=u/ifNzNDWp3Q3nGEcLEoLGDtfAEOWgU5rJl+6r0Bgjz5C4FwIHwbS8Ve8Y0WC1D1lI0//oh9yb2+ZLpTbUkA+mnM8flcQJsV5Vc+r/beD26Z5pw6qSRDZObwQaXjxbZSnB9WuJEPX/+4saGKRmkfijNdpXuzZ2zmlR5nwDGsFICaLC9PufiZ0/BdgPxGczbbHUbpjk+B6vVgfmRL4rfRswSRyrc89TldjcAlIQx77mK1aTRhNnr5VLuuk64+GdMrqNEcY4lt/uKrtSsnyZcpg1JuO3u/9hokaplYOzquH/+w8kp+Sm3ipXvKVZP/wMcw26xYa/4k37Z03sQZKNa8MA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=lg5o7Hqbux9j/KCvQ5kgjekaDgyi709z8o9SBGAJyEADr+uElrQcZ12NtbNFYR/19JDmTGJydyjtxkuuj0gWUI/VXGHOVNSMCfDHFa/5OqzFVwywbpSVJZyLITAGwfUwNvndJS8pMFxZenm0sThxb75iTWV37Gx7cyNdKAqGOJkUJKb1wpZCLEv8Ae0GlT+I0ZhA5RFWyBXMG3tKvtHS/PZKQ+frdk0HUFhcHRRVfBx2Ni3y1r+Jljc3/B1eQmONFY2GSBR81eCJfkzRhf7MEFCbpEEnQObVB3zz3fx2SXoRg9bQGeEkp/Yyvh6uAlEeBEnIN+m9TQ9US5VSNxi/hQ==
- Cc: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, "Stefano Stabellini" <sstabellini@xxxxxxxxxx>
- Delivery-date: Mon, 12 Jan 2026 14:09:14 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
Debug builds stress the wrapping logic of the TLB clock by narrowing it
down to 10 bits. This is inconvenient to test real time workloads on
such builds.
Add Kconfig option to be able to selectively use the non-stressed
behaviour on debug.
Signed-off-by: Alejandro Vallejo <alejandro.garciavallejo@xxxxxxx>
---
xen/arch/x86/Kconfig.debug | 8 ++++++++
xen/arch/x86/flushtlb.c | 6 +-----
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/xen/arch/x86/Kconfig.debug b/xen/arch/x86/Kconfig.debug
index e69de29bb2..ecf5aa4336 100644
--- a/xen/arch/x86/Kconfig.debug
+++ b/xen/arch/x86/Kconfig.debug
@@ -0,0 +1,8 @@
+config DEBUG_TLB_CLK
+ bool "TLB clock stressing"
+ default DEBUG
+ help
+ Stress the TLB clock wrapping logic by narrowing down the counter to
+ just a few bits. On wrap-around a global TLB shootdown takes place.
+
+ Disable to run real-time workloads more reliably on debug builds.
diff --git a/xen/arch/x86/flushtlb.c b/xen/arch/x86/flushtlb.c
index 09e676c151..0d788047c5 100644
--- a/xen/arch/x86/flushtlb.c
+++ b/xen/arch/x86/flushtlb.c
@@ -20,11 +20,7 @@
#include <asm/spec_ctrl.h>
/* Debug builds: Wrap frequently to stress-test the wrap logic. */
-#ifdef NDEBUG
-#define WRAP_MASK (0xFFFFFFFFU)
-#else
-#define WRAP_MASK (0x000003FFU)
-#endif
+#define WRAP_MASK (IS_ENABLED(CONFIG_DEBUG_TLB_CLK) ? 0x3FFU : UINT32_MAX)
#ifndef CONFIG_PV
# undef X86_CR4_PCIDE
base-commit: 6238c97ea430706cb4a959b1474ad40a57ed1033
--
2.43.0
|