]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/hpet: Disable legacy replacement mode after IRQ test
authorSimon Gaiser <simon@invisiblethingslab.com>
Tue, 22 Aug 2023 06:51:38 +0000 (08:51 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 22 Aug 2023 06:51:38 +0000 (08:51 +0200)
As far as I understand the HPET legacy mode is not required after the
timer IRQ test. For previous discussion see [1] and [2]. Keeping it
enabled prevents reaching deeper C-states on some systems and thereby
also S0ix residency. So disable it after the timer IRQ test worked. Note
that this code path is only reached when opt_hpet_legacy_replacement < 0,
so explicit user choice is still honored.

Link: https://lore.kernel.org/xen-devel/cb408368-077d-edb5-b4ad-f80086db48c1@invisiblethingslab.com/
Link: https://lore.kernel.org/xen-devel/20230718122603.2002-1-simon@invisiblethingslab.com/
Signed-off-by: Simon Gaiser <simon@invisiblethingslab.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/io_apic.c

index b3afef8933d734b6c1d118e728c11bd82bc6a62a..0ef61fb2f167a3230b1820ea33c28e42c4d6dd39 100644 (file)
@@ -1964,6 +1964,9 @@ static void __init check_timer(void)
 
             if ( timer_irq_works() )
             {
+                printk(XENLOG_DEBUG
+                       "IRQ test with HPET Legacy Replacement Mode worked - disabling it again\n");
+                hpet_disable_legacy_replacement_mode();
                 local_irq_restore(flags);
                 return;
             }