Skip to contentSkip to conversation

x86/hpet: Disable legacy replacement mode after IRQ test

PATCH New Simon Gaiser 1 participant 1 message Aug 7, 2023

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 x86/hpet: Disable legacy replacement mode after IRQ test

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.

---

[ Resending v3, now with a unique Message-ID, sorry. ]

Changes in v3:

- Edit log message and downgrade it to XENLOG_DEBUG.

Changes in v2:

- Always disable legacy mode after test, not only when ARAT is available. See [3] for reasoning.

[3]: https://lore.kernel.org/xen-devel/[email protected]/

---
 xen/arch/x86/io_apic.c | 2 ++
 1 file changed, 2 insertions(+)
xen/arch/x86/io_apic.c +2 -0
index 041233b9b7..b4b4cd5939 100644
@@ -1967,6 +1967,8 @@ 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;
             }
Signature · 1 line
2.40.1