kvm: vmx: Introduce lapic_mode enumeration
authorJim Mattson <jmattson@google.com>
Wed, 9 May 2018 20:56:04 +0000 (16:56 -0400)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 14 May 2018 16:14:25 +0000 (18:14 +0200)
commit588716494258899389206fa50426e78cc9df89b9
treebdc5a412da6eb60065c0c17e374fff398cd6f47e
parentceef7d10dfb6284d512c499292e6daa35ea83f90
kvm: vmx: Introduce lapic_mode enumeration

The local APIC can be in one of three modes: disabled, xAPIC or
x2APIC. (A fourth mode, "invalid," is included for completeness.)

Using the new enumeration can make some of the APIC mode logic easier
to read. In kvm_set_apic_base, for instance, it is clear that one
cannot transition directly from x2APIC mode to xAPIC mode or directly
from APIC disabled to x2APIC mode.

Signed-off-by: Jim Mattson <jmattson@google.com>
Signed-off-by: Krish Sadhukhan <krish.sadhukhan@oracle.com>
[Check invalid bits even if msr_info->host_initiated.  Reported by
 Wanpeng Li. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/lapic.h
arch/x86/kvm/x86.c