Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH] KVM : Fix read/write to IA32_FEATURE_CONTROL MSR in nested virt
@ 2013-07-03 13:41 Arthur Chunqi Li
  2013-07-04  7:00 ` Paolo Bonzini
  0 siblings, 1 reply; 14+ messages in thread
From: Arthur Chunqi Li @ 2013-07-03 13:41 UTC (permalink / raw)
  To: kvm; +Cc: gleb, pbonzini, jan.kiszka, Arthur Chunqi Li

Fix read/write to IA32_FEATURE_CONTROL MSR in nested environment.
Simply return 0x5 when read and generate #GP(0) when write.
Delete handling codes in vmx_set_vmx_msr() and generate #GP(0) in
handle_wrmsr().

Signed-off-by: Arthur Chunqi Li <yzt356@gmail.com>
---
 arch/x86/kvm/vmx.c |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index 260a919..e125f94 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -2277,7 +2277,7 @@ 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;
+		*pdata = 0x5;
 		break;
 	case MSR_IA32_VMX_BASIC:
 		/*
@@ -2356,9 +2356,6 @@ static int vmx_set_vmx_msr(struct kvm_vcpu *vcpu, u32 msr_index, u64 data)
 	if (!nested_vmx_allowed(vcpu))
 		return 0;
 
-	if (msr_index == MSR_IA32_FEATURE_CONTROL)
-		/* TODO: the right thing. */
-		return 1;
 	/*
 	 * No need to treat VMX capability MSRs specially: If we don't handle
 	 * them, handle_wrmsr will #GP(0), which is correct (they are readonly)
-- 
1.7.9.5


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

end of thread, other threads:[~2013-07-05  3:26 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-03 13:41 [PATCH] KVM : Fix read/write to IA32_FEATURE_CONTROL MSR in nested virt Arthur Chunqi Li
2013-07-04  7:00 ` Paolo Bonzini
2013-07-04  7:10   ` Gleb Natapov
2013-07-04  7:21     ` Arthur Chunqi Li
2013-07-04  7:24       ` Gleb Natapov
2013-07-04  8:16         ` Gmail
2013-07-04 10:43           ` Gleb Natapov
2013-07-04 11:01     ` Paolo Bonzini
2013-07-04 11:12       ` Gleb Natapov
2013-07-04 11:21         ` Paolo Bonzini
2013-07-04 11:31           ` Gleb Natapov
2013-07-04 12:34             ` Paolo Bonzini
2013-07-04 12:43               ` Gleb Natapov
2013-07-05  3:26                 ` Arthur Chunqi Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox