Skip to content

Commit afa8b47

Browse files
jstancekKAGA-KOKO
authored andcommitted
x86/timer: Force PIT initialization when !X86_FEATURE_ARAT
KVM guests with commit c8c4076 ("x86/timer: Skip PIT initialization on modern chipsets") applied to guest kernel have been observed to have unusually higher CPU usage with symptoms of increase in vm exits for HLT and MSW_WRITE (MSR_IA32_TSCDEADLINE). This is caused by older QEMUs lacking support for X86_FEATURE_ARAT. lapic clock retains CLOCK_EVT_FEAT_C3STOP and nohz stays inactive. There's no usable broadcast device either. Do the PIT initialization if guest CPU lacks X86_FEATURE_ARAT. On real hardware it shouldn't matter as ARAT and DEADLINE come together. Fixes: c8c4076 ("x86/timer: Skip PIT initialization on modern chipsets") Signed-off-by: Jan Stancek <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]>
1 parent e16c298 commit afa8b47

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

arch/x86/kernel/apic/apic.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,10 @@ bool __init apic_needs_pit(void)
834834
if (!boot_cpu_has(X86_FEATURE_APIC))
835835
return true;
836836

837+
/* Virt guests may lack ARAT, but still have DEADLINE */
838+
if (!boot_cpu_has(X86_FEATURE_ARAT))
839+
return true;
840+
837841
/* Deadline timer is based on TSC so no further PIT action required */
838842
if (boot_cpu_has(X86_FEATURE_TSC_DEADLINE_TIMER))
839843
return false;

0 commit comments

Comments
 (0)