I've also noticed these upcoming changes for kernel 4.15. Do you see any
indication that they could be related?
I won't have an environment ready to test them until 4.15 goes stable.
x86:
- Improved emulation of LAPIC timer mode changes, MCi_STATUS MSRs, and
after-reset state
KVM: x86: really disarm lapic timer when clearing TMICT
KVM: x86: thoroughly disarm LAPIC timer around TSC deadline switch
KVM: LAPIC: Fix lapic timer mode transition
KVM: LAPIC: Introduce limit_periodic_timer_frequency
KVM: LAPIC: Keep timer running when switching between one-shot and
periodic mode
KVM: LAPIC: Apply change to TDCR right away to the timer
Best,
Andrew
On 12/27/2017 3:38 PM, Paolo Bonzini wrote:
On 27/12/2017 19:55, Andrew Davis wrote:
In a nutshell:
* OpenBSD dev claims QEMU/KVM local APIC emulation is broken.
* OpenBSD dev states that OpenBSD uses local APIC to interrupt every
10ms in "repeated mode".
* OpenBSD dev claims that other systems (Linux, FreeBSD) likely do not
use the local APIC in "repeated mode".
I'm not familiar enough with low-level development to verify or confirm
these claims.
I've tried tweaking some different settings on the guest and host, such
as disabling the HPET timer and x2apic, neither of which has proven
effective.
Adding "kvm-intel.preemption_timer=0" on the host kernel commandline
seems to resolve the timing issue. However, I had at least one host that
wouldn't reboot cleanly with this flag enabled.
Ok, this is interesting. Please gather a trace using
trace-cmd record -e kvm -c -P pid-of-qemu
for about 10 seconds; run it once right after booting, once when it
starts taking 2 seconds, one when it starts taking 4 seconds.
The traces are big but should compress well.
Thanks,
Paolo
This is only an issue on OpenBSD. Other guest operating systems (CentOS,
Ubuntu, FreeBSD) on the same machine do not exhibit this behavior.