kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: Make CR4.VMXE reserved for the guest
@ 2020-07-08 11:03 Paolo Bonzini
  2020-07-08 18:19 ` Jim Mattson
  0 siblings, 1 reply; 2+ messages in thread
From: Paolo Bonzini @ 2020-07-08 11:03 UTC (permalink / raw)
  To: linux-kernel, kvm

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.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 arch/x86/kvm/x86.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h
index 56975c6c1e15..224670d7c245 100644
--- a/arch/x86/kvm/x86.h
+++ b/arch/x86/kvm/x86.h
@@ -392,6 +392,8 @@ bool kvm_vcpu_exit_request(struct kvm_vcpu *vcpu);
 		__reserved_bits |= X86_CR4_LA57;        \
 	if (!__cpu_has(__c, X86_FEATURE_UMIP))          \
 		__reserved_bits |= X86_CR4_UMIP;        \
+	if (!__cpu_has(__c, X86_FEATURE_VMX))           \
+		__reserved_bits |= X86_CR4_VMXE;        \
 	__reserved_bits;                                \
 })
 
-- 
2.26.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: x86: Make CR4.VMXE reserved for the guest
  2020-07-08 11:03 [PATCH] KVM: x86: Make CR4.VMXE reserved for the guest Paolo Bonzini
@ 2020-07-08 18:19 ` Jim Mattson
  0 siblings, 0 replies; 2+ messages in thread
From: Jim Mattson @ 2020-07-08 18:19 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: LKML, kvm list

On Wed, Jul 8, 2020 at 4:04 AM Paolo Bonzini <pbonzini@redhat.com> wrote:
>
> 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.
>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Jim Mattson <jmattson@google.com>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-08 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-08 11:03 [PATCH] KVM: x86: Make CR4.VMXE reserved for the guest Paolo Bonzini
2020-07-08 18:19 ` Jim Mattson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).