[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86/APIC: no need for timer calibration when using TDT


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 17 Jan 2022 11:32:11 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=iJTv3lvJMS3Sd/lLe8RAePN9QmHhfw7Jcahlxzy1KOU=; b=d254MCTXh9VNVHmL7aYLDwudTFo6KfizUE5oGlNxdTp7o02mdoYw/F7fplZDvUyBgicnbBYaTkqDlmuTqGuyJuWqdGQ2yBbcxfiIlBbbGUAYFC8aEHxzb3TocyMvQivogHO0WESpgM3dDMzPql29oJxOaY1PN3NZPYta0bRPgAW/2RmOYN5X9JA1PB3cMTyH9G4XUBrJ66dsoUQ/DVGtukO54mHTKVjETsYFERE1kyN2zM1KRwYE0g9WMJ5mzdwQsEM8fyJ4AHJQH/BWxsHqVfSIZuQYb1/OCUMMXhYKxqWtgtlQCEtFM0dErKvusDseRWHJaWAwHdwhJBs/2M0C3g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YGbN3ZjTCyMiN3fmPhNv35s0ZvxUBX21IQS9XOTYduqzRd+6zyDf+kuGEnf8BTmnPPtOGrBuROWaKOZWWGCdMSRdmDiTz1jBx+Zwez0b8+1zmXNE06u6EkARDdjfYpI1dbZMbSYlgfovL5IOT3p2DWfKtQdupWod3h9Pa78uji8Ns75c4vH08eQ3hYRQd9Iiq5QsHSTUfuYtMLDblfJVQJOPVo8gAF7VXpAhcOIYU95Uq94/YjEaBJc9Hm0usZhS71h05/feZ9i068AzMDBXzF7qFiIWwSPT23GMcl38VX3qqsmPUkAluJ/NQgqP5cuGmwrfH3Vb7acnJ3/Pkb12Ng==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 17 Jan 2022 10:32:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

The only global effect of calibrate_APIC_clock() is the setting of
"bus_scale"; the final __setup_APIC_LVTT(0) is (at best) redundant with
the immediately following setup_APIC_timer() invocation. Yet "bus_scale"
isn't used when using TDT. Avoid wasting 100ms for calibration in this
case.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/apic.c
+++ b/xen/arch/x86/apic.c
@@ -1292,11 +1292,15 @@ void __init setup_boot_APIC_clock(void)
 
     check_deadline_errata();
 
+    if ( !boot_cpu_has(X86_FEATURE_TSC_DEADLINE) )
+        tdt_enable = false;
+
     local_irq_save(flags);
 
-    calibrate_APIC_clock();
+    if ( !tdt_enable || apic_verbosity )
+        calibrate_APIC_clock();
 
-    if ( tdt_enable && boot_cpu_has(X86_FEATURE_TSC_DEADLINE) )
+    if ( tdt_enable )
     {
         printk(KERN_DEBUG "TSC deadline timer enabled\n");
         tdt_enabled = true;




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.