KVM: VMX: Use KVM_POSSIBLE_CR*_GUEST_BITS to initialize guest/host masks
authorSean Christopherson <sean.j.christopherson@intel.com>
Fri, 3 Jul 2020 04:04:22 +0000 (21:04 -0700)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 3 Jul 2020 16:16:33 +0000 (12:16 -0400)
commitfa71e9527f6a0153ae6a880031b902818af1bdaf
tree41059135afa859a2f92ab935e7fbdb1de81682ba
parent7c83d096aed055a7763a03384f92115363448b71
KVM: VMX: Use KVM_POSSIBLE_CR*_GUEST_BITS to initialize guest/host masks

Use the "common" KVM_POSSIBLE_CR*_GUEST_BITS defines to initialize the
CR0/CR4 guest host masks instead of duplicating most of the CR4 mask and
open coding the CR0 mask.  SVM doesn't utilize the masks, i.e. the masks
are effectively VMX specific even if they're not named as such.  This
avoids duplicate code, better documents the guest owned CR0 bit, and
eliminates the need for a build-time assertion to keep VMX and x86
synchronized.

Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Message-Id: <20200703040422.31536-3-sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/vmx/nested.c
arch/x86/kvm/vmx/vmx.c