aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2012-09-13 10:19:24 -0400
committerAvi Kivity <avi@redhat.com>2012-09-20 08:05:26 -0400
commit1e08ec4a130e2745d96df169e67c58df98a07311 (patch)
tree362647f5b0bac59e7fe93ce66775afac2cd7da79 /arch/x86/kvm/x86.c
parent1d86b5cc4c6d9a1be1458be3701ac9c915a9706f (diff)
KVM: optimize apic interrupt delivery
Most interrupt are delivered to only one vcpu. Use pre-build tables to find interrupt destination instead of looping through all vcpus. In case of logical mode loop only through vcpus in a logical cluster irq is sent to. Signed-off-by: Gleb Natapov <gleb@redhat.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 497226e49d4b..fc2a0a132e4b 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6270,6 +6270,7 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type)
6270 set_bit(KVM_USERSPACE_IRQ_SOURCE_ID, &kvm->arch.irq_sources_bitmap); 6270 set_bit(KVM_USERSPACE_IRQ_SOURCE_ID, &kvm->arch.irq_sources_bitmap);
6271 6271
6272 raw_spin_lock_init(&kvm->arch.tsc_write_lock); 6272 raw_spin_lock_init(&kvm->arch.tsc_write_lock);
6273 mutex_init(&kvm->arch.apic_map_lock);
6273 6274
6274 return 0; 6275 return 0;
6275} 6276}
@@ -6322,6 +6323,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
6322 put_page(kvm->arch.apic_access_page); 6323 put_page(kvm->arch.apic_access_page);
6323 if (kvm->arch.ept_identity_pagetable) 6324 if (kvm->arch.ept_identity_pagetable)
6324 put_page(kvm->arch.ept_identity_pagetable); 6325 put_page(kvm->arch.ept_identity_pagetable);
6326 kfree(rcu_dereference_check(kvm->arch.apic_map, 1));
6325} 6327}
6326 6328
6327void kvm_arch_free_memslot(struct kvm_memory_slot *free, 6329void kvm_arch_free_memslot(struct kvm_memory_slot *free,