KVM: x86: fix deadline tsc interrupt injection
authorRadim Krčmář <rkrcmar@redhat.com>
Fri, 10 Oct 2014 17:15:09 +0000 (19:15 +0200)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 3 Nov 2014 11:07:28 +0000 (12:07 +0100)
commit1e0ad70cc1957b9050368e433b1061a2cd1ce543
tree2f88c9acdcdd689170e5f144eff815652b75ddd0
parent5d87db711937019cb8eba1137c37573d7a604be8
KVM: x86: fix deadline tsc interrupt injection

The check in kvm_set_lapic_tscdeadline_msr() was trying to prevent a
situation where we lose a pending deadline timer in a MSR write.
Losing it is fine, because it effectively occurs before the timer fired,
so we should be able to cancel or postpone it.

Another problem comes from interaction with QEMU, or other userspace
that can set deadline MSR without a good reason, when timer is already
pending:  one guest's deadline request results in more than one
interrupt because one is injected immediately on MSR write from
userspace and one through hrtimer later.

The solution is to remove the injection when replacing a pending timer
and to improve the usual QEMU path, we inject without a hrtimer when the
deadline has already passed.

Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Reported-by: Nadav Amit <namit@cs.technion.ac.il>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.c
This page took 0.035577 seconds and 5 git commands to generate.