diff options
author | Nadav Har'El <nyh@math.technion.ac.il> | 2013-07-08 19:12:35 +0800 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2013-07-18 12:29:29 +0200 |
commit | b3897a49e22fc173efa77527a447c714f753f681 (patch) | |
tree | 71387ace3ec9f606f98413719dcaffbeedd48266 /arch/x86/kvm/x86.c | |
parent | 6b61edf76551c4ee3ad2e6e377bc4c23c42cedf5 (diff) | |
download | linux-b3897a49e22fc173efa77527a447c714f753f681.tar.gz linux-b3897a49e22fc173efa77527a447c714f753f681.tar.bz2 linux-b3897a49e22fc173efa77527a447c714f753f681.zip |
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>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index abbcaa7f6e8f..d2caeb9e592f 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -850,7 +850,8 @@ static u32 msrs_to_save[] = { #ifdef CONFIG_X86_64 MSR_CSTAR, MSR_KERNEL_GS_BASE, MSR_SYSCALL_MASK, MSR_LSTAR, #endif - MSR_IA32_TSC, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA + MSR_IA32_TSC, MSR_IA32_CR_PAT, MSR_VM_HSAVE_PA, + MSR_IA32_FEATURE_CONTROL }; static unsigned num_msrs_to_save; |