Skip to content

Commit 53efe52

Browse files
committed
KVM: x86: Make CR4.VMXE reserved for the guest
CR4.VMXE is reserved unless the VMX CPUID bit is set. On Intel, it is also tested by vmx_set_cr4, but AMD relies on kvm_valid_cr4, so fix it. Reviewed-by: Jim Mattson <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent b899c13 commit 53efe52

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

arch/x86/kvm/x86.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,8 @@ bool kvm_vcpu_exit_request(struct kvm_vcpu *vcpu);
391391
__reserved_bits |= X86_CR4_LA57; \
392392
if (!__cpu_has(__c, X86_FEATURE_UMIP)) \
393393
__reserved_bits |= X86_CR4_UMIP; \
394+
if (!__cpu_has(__c, X86_FEATURE_VMX)) \
395+
__reserved_bits |= X86_CR4_VMXE; \
394396
__reserved_bits; \
395397
})
396398

0 commit comments

Comments
 (0)