Skip to content

Commit 3de6347

Browse files
Sean Christophersonbonzini
authored andcommitted
KVM: vmx: rename KVM_GUEST_CR0_MASK tp KVM_VM_CR0_ALWAYS_OFF
The KVM_GUEST_CR0_MASK macro tracks CR0 bits that are forced to zero by the VMX architecture, i.e. CR0.{NW,CD} must always be zero in the hardware CR0 post-VMXON. Rename the macro to clarify its purpose, be consistent with KVM_VM_CR0_ALWAYS_ON and avoid confusion with the CR0_GUEST_HOST_MASK field. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Reviewed-by: Jim Mattson <jmattson@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 3d0d0d9 commit 3de6347

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kvm/vmx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ static bool __read_mostly enable_preemption_timer = 1;
131131
module_param_named(preemption_timer, enable_preemption_timer, bool, S_IRUGO);
132132
#endif
133133

134-
#define KVM_GUEST_CR0_MASK (X86_CR0_NW | X86_CR0_CD)
134+
#define KVM_VM_CR0_ALWAYS_OFF (X86_CR0_NW | X86_CR0_CD)
135135
#define KVM_VM_CR0_ALWAYS_ON_UNRESTRICTED_GUEST X86_CR0_NE
136136
#define KVM_VM_CR0_ALWAYS_ON \
137137
(KVM_VM_CR0_ALWAYS_ON_UNRESTRICTED_GUEST | \
@@ -5260,7 +5260,7 @@ static void vmx_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0)
52605260
struct vcpu_vmx *vmx = to_vmx(vcpu);
52615261
unsigned long hw_cr0;
52625262

5263-
hw_cr0 = (cr0 & ~KVM_GUEST_CR0_MASK);
5263+
hw_cr0 = (cr0 & ~KVM_VM_CR0_ALWAYS_OFF);
52645264
if (enable_unrestricted_guest)
52655265
hw_cr0 |= KVM_VM_CR0_ALWAYS_ON_UNRESTRICTED_GUEST;
52665266
else {

0 commit comments

Comments
 (0)