]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit4ab450872a3c1999e62962e918a412e2e31f3082
tree41059135afa859a2f92ab935e7fbdb1de81682ba
parente833b87f2f6060d8dc47ce01b240a8e3b9ba84c9
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