Skip to content
Commit 8322ebbb authored by David Matlack's avatar David Matlack Committed by Paolo Bonzini
Browse files

KVM: nVMX: generate MSR_IA32_CR{0,4}_FIXED1 from guest CPUID



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>
parent 3899152c
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment