Skip to content

Commit 82dc11b

Browse files
calmisisean-jc
authored andcommitted
KVM: VMX: Move the comment of CR4.MCE handling right above the code
Move the comment about keeping the hosts CR4.MCE loaded in hardware above the code that actually modifies the hardware CR4 value. No functional change indented. Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com> Link: https://lore.kernel.org/r/20230410125017.1305238-3-xiaoyao.li@intel.com [sean: elaborate in changelog] Signed-off-by: Sean Christopherson <seanjc@google.com>
1 parent 334006b commit 82dc11b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

arch/x86/kvm/vmx/vmx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3389,13 +3389,13 @@ void vmx_set_cr4(struct kvm_vcpu *vcpu, unsigned long cr4)
33893389
{
33903390
unsigned long old_cr4 = kvm_read_cr4(vcpu);
33913391
struct vcpu_vmx *vmx = to_vmx(vcpu);
3392+
unsigned long hw_cr4;
3393+
33923394
/*
33933395
* Pass through host's Machine Check Enable value to hw_cr4, which
33943396
* is in force while we are in guest mode. Do not let guests control
33953397
* this bit, even if host CR4.MCE == 0.
33963398
*/
3397-
unsigned long hw_cr4;
3398-
33993399
hw_cr4 = (cr4_read_shadow() & X86_CR4_MCE) | (cr4 & ~X86_CR4_MCE);
34003400
if (is_unrestricted_guest(vcpu))
34013401
hw_cr4 |= KVM_VM_CR4_ALWAYS_ON_UNRESTRICTED_GUEST;

0 commit comments

Comments
 (0)