KVM: x86: Validate guest writes to MSR_IA32_APICBASE
authorJan Kiszka <jan.kiszka@siemens.com>
Fri, 24 Jan 2014 15:48:44 +0000 (16:48 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Mon, 27 Jan 2014 13:39:44 +0000 (14:39 +0100)
commit58cb628dbe24ce21b884729aebe15acb903dbfb5
tree56355ea28e8f76fc0f933ae39d481ecb00a90a0b
parentb3af1e889ec4909f6b48dabd19a311d9c9f8d58e
KVM: x86: Validate guest writes to MSR_IA32_APICBASE

Check for invalid state transitions on guest-initiated updates of
MSR_IA32_APICBASE. This address both enabling of the x2APIC when it is
not supported and all invalid transitions as described in SDM section
10.12.5. It also checks that no reserved bit is set in APICBASE by the
guest.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
[Use cpuid_maxphyaddr instead of guest_cpuid_get_phys_bits. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/cpuid.h
arch/x86/kvm/lapic.h
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c