[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/2] xen/x86: don't send IPI to sync TSC when it is reliable
- To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
- From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
- Date: Mon, 7 Jul 2025 17:07:11 -0700
- 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=ZQgClbWGpr0ReiNMGJQkgrRBR0Oeh+B5V1gh+NMd/0c=; b=ja0rIqwLda4cQq1mdroEMO/jQv8msZnk2mKQKtkxPvYpWcVyRZdhu6FnjLXvbQW0gnvzQoefWD+Z0BJOfC7z8FxaLff0sbLJIGGwui5X++V0kGjjbVbI0KWuqBCm9+rdAX2phWK2g6OjE1b45atRxYyFE0Bzx0JGJJRl/Ub/J17nlRevEiEh46vXJ4AjLMUOeE5oYG+N2j6n2Lv2dsbL1mLFYXzsYbjfTZu3dsWGzWeHYve3TzI1PlmD5tITR6aBMu3CtRyB3ytA1FEKeEY3Tcqs4vw71B1N61Bs3YLbm8jUO3qCfapbnxUS7GG9pp/Ah/qcdihQQ5pgO2caWaL+gA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gHiStk4PWORhutOfSpL0C392e9LoSpLYaY3/x1D0ZjvjM+9Id/3KVkuoe3/hodWlIXw9l9vWALi/LAO4+lLJzfHNREzDQ3y85CIAjApVgtJpPBWhN6KX3wcOXWdlcKKxPF6E7hygbBR+jz26q01roD5wuXw5lXPbdOIAyqBsOkAZm2Bv7JOflIad8qeB01q8X9PZAOiZXOstGwPmfHJCHonNUrA6Ec2zpLjJJKO32Td+onMhOzZMog+ZVIAz5jkYvp2E/90bhuXPM9dxVJ8fzOQ0zOZDxwIEOnklCdwx7t4wsnUmjXc74AsNiHM26JxvQKcKKaGPnnGbBWoJ4VD5bg==
- Cc: <jbeulich@xxxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <roger.pau@xxxxxxxxxx>, <stefano.stabellini@xxxxxxx>, <Xenia.Ragiadakou@xxxxxxx>, <alejandro.garciavallejo@xxxxxxx>, <Jason.Andryuk@xxxxxxx>
- Delivery-date: Tue, 08 Jul 2025 00:07:38 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On real time configuration with the null scheduler, we shouldn't
interrupt the guest execution unless strictly necessary: the guest could
be a real time guest (e.g. FreeRTOS) and interrupting its execution
could lead to a missed deadline.
The principal source of interruptions is IPIs. Remove the unnecessary
IPI on all physical CPUs to sync the TSC when the TSC is known to be
reliable.
Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
---
xen/arch/x86/time.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/xen/arch/x86/time.c b/xen/arch/x86/time.c
index 59129f419d..bfd022174a 100644
--- a/xen/arch/x86/time.c
+++ b/xen/arch/x86/time.c
@@ -2303,6 +2303,10 @@ static void cf_check time_calibration(void *unused)
local_irq_enable();
}
+ if ( boot_cpu_has(X86_FEATURE_CONSTANT_TSC) &&
+ boot_cpu_has(X86_FEATURE_TSC_RELIABLE) )
+ return;
+
cpumask_copy(&r.cpu_calibration_map, &cpu_online_map);
/* @wait=1 because we must wait for all cpus before freeing @r. */
--
2.25.1
|