From: bugzilla-daemon@kernel.org
To: kvm@vger.kernel.org
Subject: [Bug 216033] KVM VMX nested virtualization: VMXON does not check guest CR0 against IA32_VMX_CR0_FIXED0
Date: Thu, 26 May 2022 16:18:35 +0000 [thread overview]
Message-ID: <bug-216033-28872-DeJ3APpi6P@https.bugzilla.kernel.org/> (raw)
In-Reply-To: <bug-216033-28872@https.bugzilla.kernel.org/>
https://bugzilla.kernel.org/show_bug.cgi?id=216033
Sean Christopherson (seanjc@google.com) changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |seanjc@google.com
--- Comment #1 from Sean Christopherson (seanjc@google.com) ---
Ugh, KVM is comically wrong. It _deliberately_ avoids checking CR0/CR4 with a
comment saying that "most faulting conditions have already been checked by
hardware", but the SDM pseudocode makes it very clear that only the (CR0.PE =
0) or (CR4.VMXE = 0) or (RFLAGS.VM = 1) or (IA32_EFER.LMA = 1 and CS.L = 0)
checks are performed before the VM-Exit occurs.
/*
* The Intel VMX Instruction Reference lists a bunch of bits that are
* prerequisite to running VMXON, most notably cr4.VMXE must be set to
* 1 (see vmx_is_valid_cr4() for when we allow the guest to set this).
* Otherwise, we should fail with #UD. But most faulting conditions
* have already been checked by hardware, prior to the VM-exit for
* VMXON. We do test guest cr4.VMXE because processor CR4 always has
* that bit set to 1 in non-root mode.
*/
if (!kvm_read_cr4_bits(vcpu, X86_CR4_VMXE)) {
kvm_queue_exception(vcpu, UD_VECTOR);
return 1;
}
--
You may reply to this email to add a comment.
You are receiving this mail because:
You are watching the assignee of the bug.
next prev parent reply other threads:[~2022-05-26 16:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-26 3:54 [Bug 216033] New: KVM VMX nested virtualization: VMXON does not check guest CR0 against IA32_VMX_CR0_FIXED0 bugzilla-daemon
2022-05-26 16:18 ` bugzilla-daemon [this message]
2022-09-02 18:39 ` [Bug 216033] " bugzilla-daemon
2022-09-02 19:00 ` bugzilla-daemon
2022-09-02 19:45 ` bugzilla-daemon
2022-09-02 20:57 ` bugzilla-daemon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-216033-28872-DeJ3APpi6P@https.bugzilla.kernel.org/ \
--to=bugzilla-daemon@kernel.org \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).