From: Julian Stecklina <js@alien8.de>
To: kvm@vger.kernel.org
Cc: Julian Stecklina <js@alien8.de>
Subject: [PATCH] KVM: Enable VMX-related bits in MSR_IA32_FEATURE_CONTROL.
Date: Tue, 6 Mar 2012 16:02:21 +0100 [thread overview]
Message-ID: <1331046141-11101-1-git-send-email-js@alien8.de> (raw)
The spec (Vol 3C, Chapter 34.1) regarding the IA32_FEATURE_CONTROL MSR says "Therefore the lock bit must be set after configuring support for Intel Virtualization Technology and prior to transferring control to an option ROM or the OS." and regarding bit 2: "This bit enables VMX for system executive that do not require SMX."
Signed-off-by: Julian Stecklina <js@alien8.de>
---
arch/x86/kvm/vmx.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 4ea7678..aef1e5b 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2007,7 +2007,12 @@ static int vmx_get_vmx_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 *pdata)
switch (msr_index) {
case MSR_IA32_FEATURE_CONTROL:
- *pdata = 0;
+ /*
+ * If nested VMX is enabled, set the lock bit (bit 0)
+ * and the "Enable VMX outside SMX" bit (bit 2) in the
+ * FEATURE_CONTROL MSR.
+ */
+ *pdata = nested_vmx_allowed(vcpu) ? 0x5 : 0;
break;
case MSR_IA32_VMX_BASIC:
/*
--
1.7.9.2
next reply other threads:[~2012-03-06 15:02 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-06 15:02 Julian Stecklina [this message]
2012-03-06 15:13 ` [PATCH] KVM: Enable VMX-related bits in MSR_IA32_FEATURE_CONTROL Avi Kivity
2012-03-06 15:25 ` Julian Stecklina
2012-03-06 15:47 ` Nadav Har'El
2012-03-06 16:45 ` Julian Stecklina
2012-03-06 17:33 ` Nadav Har'El
2012-03-07 10:07 ` Avi Kivity
2012-03-07 11:10 ` Nadav Har'El
2012-03-07 14:14 ` Avi Kivity
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=1331046141-11101-1-git-send-email-js@alien8.de \
--to=js@alien8.de \
--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