diff options
author | Radim Krčmář <rkrcmar@redhat.com> | 2016-07-12 23:09:20 +0300 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2016-07-14 10:03:53 +0300 |
commit | 0ca52e7b81a37260c7edb823c8ac6a49c6280b5e (patch) | |
tree | 6116f41d00673db8be0280dfca84dfb274da8096 /arch/x86/kvm/lapic.h | |
parent | e45115b62f9abb143a03036dbde05faf5864aa01 (diff) | |
download | linux-0ca52e7b81a37260c7edb823c8ac6a49c6280b5e.tar.xz |
KVM: x86: dynamic kvm_apic_map
x2APIC supports up to 2^32-1 LAPICs, but most guest in coming years will
probably has fewer VCPUs. Dynamic size saves memory at the cost of
turning one constant into a variable.
apic_map mutex had to be moved before allocation to avoid races with cpu
hotplug.
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/lapic.h')
-rw-r--r-- | arch/x86/kvm/lapic.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/lapic.h b/arch/x86/kvm/lapic.h index 336ba51bb16e..8d811139d2b3 100644 --- a/arch/x86/kvm/lapic.h +++ b/arch/x86/kvm/lapic.h @@ -200,7 +200,7 @@ static inline int kvm_lapic_latched_init(struct kvm_vcpu *vcpu) return lapic_in_kernel(vcpu) && test_bit(KVM_APIC_INIT, &vcpu->arch.apic->pending_events); } -static inline int kvm_apic_id(struct kvm_lapic *apic) +static inline u32 kvm_apic_id(struct kvm_lapic *apic) { return (kvm_lapic_get_reg(apic, APIC_ID) >> 24) & 0xff; } |