diff options
author | Sean Christopherson | 2019-07-10 18:07:34 +0200 |
---|---|---|
committer | Paolo Bonzini | 2019-07-11 15:10:22 +0200 |
commit | d7a08882a0a4b4e176691331ee3f492996579534 (patch) | |
tree | ecfa90d990e01fd7e80d5eaa3093348fcd27f7b0 /drivers/reset/reset-zynq.c | |
parent | KVM: x86: PMU Event Filter (diff) | |
download | kernel-qcow2-linux-d7a08882a0a4b4e176691331ee3f492996579534.tar.gz kernel-qcow2-linux-d7a08882a0a4b4e176691331ee3f492996579534.tar.xz kernel-qcow2-linux-d7a08882a0a4b4e176691331ee3f492996579534.zip |
KVM: x86: Unconditionally enable irqs in guest context
On VMX, KVM currently does not re-enable irqs until after it has exited
the guest context. As a result, a tick that fires in the window between
VM-Exit and guest_exit_irqoff() will be accounted as system time. While
said window is relatively small, it's large enough to be problematic in
some configurations, e.g. if VM-Exits are consistently occurring a hair
earlier than the tick irq.
Intentionally toggle irqs back off so that guest_exit_irqoff() can be
used in lieu of guest_exit() in order to avoid the save/restore of flags
in guest_exit(). On my Haswell system, "nop; cli; sti" is ~6 cycles,
versus ~28 cycles for "pushf; pop <reg>; cli; push <reg>; popf".
Fixes: f2485b3e0c6c0 ("KVM: x86: use guest_exit_irqoff")
Reported-by: Wei Yang <w90p710@gmail.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'drivers/reset/reset-zynq.c')
0 files changed, 0 insertions, 0 deletions