]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - arch/x86/kvm/vmx.c
KVM: nVMX: generate non-true VMX MSRs based on true versions
authorDavid Matlack <dmatlack@google.com>
Wed, 30 Nov 2016 02:14:06 +0000 (18:14 -0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 8 Dec 2016 14:31:06 +0000 (15:31 +0100)
commit0115f9cbac61918363cbaf26c8521ff9176ccc35
tree00ffe0258e6b729b86d853fc0a5f84fc150e9be2
parentea07e42dec5644105db8a853575a0a271f93d294
KVM: nVMX: generate non-true VMX MSRs based on true versions

The "non-true" VMX capability MSRs can be generated from their "true"
counterparts, by OR-ing the default1 bits. The default1 bits are fixed
and defined in the SDM.

Since we can generate the non-true VMX MSRs from the true versions,
there's no need to store both in struct nested_vmx. This also lets
userspace avoid having to restore the non-true MSRs.

Note this does not preclude emulating MSR_IA32_VMX_BASIC[55]=0. To do so,
we simply need to set all the default1 bits in the true MSRs (such that
the true MSRs and the generated non-true MSRs are equal).

Signed-off-by: David Matlack <dmatlack@google.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
arch/x86/kvm/vmx.c