]> 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)
commitef8329e700f53267aeae8a1f3bf9692e799cb76b
tree41059135afa859a2f92ab935e7fbdb1de81682ba
parent14536a971fd8894816fb90c4ab06eb8d19410c8b
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