All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/APIC: no need for timer calibration when using TDT
@ 2022-01-17 10:32 Jan Beulich
  2022-01-20 16:09 ` Andrew Cooper
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Beulich @ 2022-01-17 10:32 UTC (permalink / raw)
  To: xen-devel; +Cc: Andrew Cooper, Wei Liu, Roger Pau Monné

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@suse.com>

--- 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;



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] x86/APIC: no need for timer calibration when using TDT
  2022-01-17 10:32 [PATCH] x86/APIC: no need for timer calibration when using TDT Jan Beulich
@ 2022-01-20 16:09 ` Andrew Cooper
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cooper @ 2022-01-20 16:09 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Andrew Cooper, Wei Liu, Roger Pau Monné

On 17/01/2022 10:32, Jan Beulich wrote:
> 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@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-20 16:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-17 10:32 [PATCH] x86/APIC: no need for timer calibration when using TDT Jan Beulich
2022-01-20 16:09 ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.