diff options
author | Kevin Tian <kevin.tian@intel.com> | 2011-08-30 12:56:17 +0200 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2011-09-25 18:52:17 +0200 |
commit | 58fbbf26eb01cf6d92cf18da8d14b3a4af9c4b47 (patch) | |
tree | 738874a15a233eed6e2e18d9cfe99f09482e8b17 /arch/x86/kvm/lapic.c | |
parent | KVM: SVM: Fix TSC MSR read in nested SVM (diff) | |
download | linux-58fbbf26eb01cf6d92cf18da8d14b3a4af9c4b47.tar.xz linux-58fbbf26eb01cf6d92cf18da8d14b3a4af9c4b47.zip |
KVM: APIC: avoid instruction emulation for EOI writes
Instruction emulation for EOI writes can be skipped, since sane
guest simply uses MOV instead of string operations. This is a nice
improvement when guest doesn't support x2apic or hyper-V EOI
support.
a single VM bandwidth is observed with ~8% bandwidth improvement
(7.4Gbps->8Gbps), by saving ~5% cycles from EOI emulation.
Signed-off-by: Kevin Tian <kevin.tian@intel.com>
<Based on earlier work from>:
Signed-off-by: Eddie Dong <eddie.dong@intel.com>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
-rw-r--r-- | arch/x86/kvm/lapic.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 57dcbd4308fa..52645f283870 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -864,6 +864,15 @@ static int apic_mmio_write(struct kvm_io_device *this, return 0; } +void kvm_lapic_set_eoi(struct kvm_vcpu *vcpu) +{ + struct kvm_lapic *apic = vcpu->arch.apic; + + if (apic) + apic_reg_write(vcpu->arch.apic, APIC_EOI, 0); +} +EXPORT_SYMBOL_GPL(kvm_lapic_set_eoi); + void kvm_free_lapic(struct kvm_vcpu *vcpu) { if (!vcpu->arch.apic) |