KVM: nVMX: Fix read/write to MSR_IA32_FEATURE_CONTROL
authorNadav Har'El <nyh@math.technion.ac.il>
Mon, 8 Jul 2013 11:12:35 +0000 (19:12 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 18 Jul 2013 10:29:29 +0000 (12:29 +0200)
commitb3897a49e22fc173efa77527a447c714f753f681
tree71387ace3ec9f606f98413719dcaffbeedd48266
parent6b61edf76551c4ee3ad2e6e377bc4c23c42cedf5
KVM: nVMX: Fix read/write to MSR_IA32_FEATURE_CONTROL

Fix read/write to IA32_FEATURE_CONTROL MSR in nested environment.

This patch simulate this MSR in nested_vmx and the default value is
0x0. BIOS should set it to 0x5 before VMXON. After setting the lock
bit, write to it will cause #GP(0).

Another QEMU patch is also needed to handle emulation of reset
and migration. Reset to vCPU should clear this MSR and migration
should reserve value of it.

This patch is based on Nadav's previous commit.
http://permalink.gmane.org/gmane.comp.emulators.kvm.devel/88478

Signed-off-by: Nadav Har'El <nyh@math.technion.ac.il>
Signed-off-by: Arthur Chunqi Li <yzt356@gmail.com>
Signed-off-by: Gleb Natapov <gleb@redhat.com>
arch/x86/kvm/vmx.c
arch/x86/kvm/x86.c