• David Matlack's avatar
    KVM: nVMX: generate MSR_IA32_CR{0,4}_FIXED1 from guest CPUID · 8322ebbb
    David Matlack authored
    MSR_IA32_CR{0,4}_FIXED1 define which bits in CR0 and CR4 are allowed to
    be 1 during VMX operation. Since the set of allowed-1 bits is the same
    in and out of VMX operation, we can generate these MSRs entirely from
    the guest's CPUID. This lets userspace avoiding having to save/restore
    these MSRs.
    
    This patch also initializes MSR_IA32_CR{0,4}_FIXED1 from the CPU's MSRs
    by default. This is a saner than the current default of -1ull, which
    includes bits that the host CPU does not support.
    Signed-off-by: default avatarDavid Matlack <dmatlack@google.com>
    Signed-off-by: default avatarRadim Krčmář <rkrcmar@redhat.com>
    8322ebbb
vmx.c 329 KB