diff options
| author | Yang Zhang <yang.z.zhang@Intel.com> | 2013-04-07 08:25:18 +0800 | 
|---|---|---|
| committer | Gleb Natapov <gleb@redhat.com> | 2013-04-07 13:55:49 +0300 | 
| commit | 44944d4d28948c71b110b09a2e924e505cd39e8b (patch) | |
| tree | 6d0b96165c11414c98edd14501f016627687d7dd /arch/x86/kvm/lapic.c | |
| parent | 99437a2782730ec8c7e6cfebb6143d00b091e4a8 (diff) | |
| download | olio-linux-3.10-44944d4d28948c71b110b09a2e924e505cd39e8b.tar.xz olio-linux-3.10-44944d4d28948c71b110b09a2e924e505cd39e8b.zip  | |
KVM: Call kvm_apic_match_dest() to check destination vcpu
For a given vcpu, kvm_apic_match_dest() will tell you whether
the vcpu in the destination list quickly. Drop kvm_calculate_eoi_exitmap()
and use kvm_apic_match_dest() instead.
Signed-off-by: Yang Zhang <yang.z.zhang@Intel.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.c')
| -rw-r--r-- | arch/x86/kvm/lapic.c | 47 | 
1 files changed, 0 insertions, 47 deletions
diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index a8e9369f41c..e2274745ab3 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -145,53 +145,6 @@ static inline int kvm_apic_id(struct kvm_lapic *apic)  	return (kvm_apic_get_reg(apic, APIC_ID) >> 24) & 0xff;  } -void kvm_calculate_eoi_exitmap(struct kvm_vcpu *vcpu, -				struct kvm_lapic_irq *irq, -				u64 *eoi_exit_bitmap) -{ -	struct kvm_lapic **dst; -	struct kvm_apic_map *map; -	unsigned long bitmap = 1; -	int i; - -	rcu_read_lock(); -	map = rcu_dereference(vcpu->kvm->arch.apic_map); - -	if (unlikely(!map)) { -		__set_bit(irq->vector, (unsigned long *)eoi_exit_bitmap); -		goto out; -	} - -	if (irq->dest_mode == 0) { /* physical mode */ -		if (irq->delivery_mode == APIC_DM_LOWEST || -				irq->dest_id == 0xff) { -			__set_bit(irq->vector, -				  (unsigned long *)eoi_exit_bitmap); -			goto out; -		} -		dst = &map->phys_map[irq->dest_id & 0xff]; -	} else { -		u32 mda = irq->dest_id << (32 - map->ldr_bits); - -		dst = map->logical_map[apic_cluster_id(map, mda)]; - -		bitmap = apic_logical_id(map, mda); -	} - -	for_each_set_bit(i, &bitmap, 16) { -		if (!dst[i]) -			continue; -		if (dst[i]->vcpu == vcpu) { -			__set_bit(irq->vector, -				  (unsigned long *)eoi_exit_bitmap); -			break; -		} -	} - -out: -	rcu_read_unlock(); -} -  static void recalculate_apic_map(struct kvm *kvm)  {  	struct kvm_apic_map *new, *old = NULL;  |