diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2015-02-12 18:41:34 (GMT) |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2015-04-08 08:47:01 (GMT) |
commit | 3b5a5ffa928a3f875b0d5dd284eeb7c322e1688a (patch) | |
tree | 34ce2fe7e308d821549c1e7d3c88e60386636365 /arch/x86/kvm/lapic.h | |
parent | 3548a259f6990d8cb4f520e6c14f4b45b1f2fd38 (diff) | |
download | linux-3b5a5ffa928a3f875b0d5dd284eeb7c322e1688a.tar.xz |
KVM: x86: simplify kvm_apic_map
recalculate_apic_map() uses two passes over all VCPUs. This is a relic
from time when we selected a global mode in the first pass and set up
the optimized table in the second pass (to have a consistent mode).
Recent changes made mixed mode unoptimized and we can do it in one pass.
Format of logical MDA is a function of the mode, so we encode it in
apic_logical_id() and drop obsoleted variables from the struct.
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Message-Id: <1423766494-26150-5-git-send-email-rkrcmar@redhat.com>
[Add lid_bits temporary in apic_logical_id. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.h')
-rw-r--r-- | arch/x86/kvm/lapic.h | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h index e284c28..9d28383 100644 --- a/arch/x86/kvm/lapic.h +++ b/arch/x86/kvm/lapic.h @@ -148,21 +148,6 @@ static inline bool kvm_apic_vid_enabled(struct kvm *kvm) return kvm_x86_ops->vm_has_apicv(kvm); } -static inline u16 apic_cluster_id(struct kvm_apic_map *map, u32 ldr) -{ - u16 cid; - ldr >>= 32 - map->ldr_bits; - cid = (ldr >> map->cid_shift) & map->cid_mask; - - return cid; -} - -static inline u16 apic_logical_id(struct kvm_apic_map *map, u32 ldr) -{ - ldr >>= (32 - map->ldr_bits); - return ldr & map->lid_mask; -} - static inline bool kvm_apic_has_events(struct kvm_vcpu *vcpu) { return vcpu->arch.apic->pending_events; |