kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: VMX: Use proper slot index for kvm_set_shared_msr
@ 2009-10-29 16:53 Jan Kiszka
  2009-10-29 17:13 ` Avi Kivity
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kiszka @ 2009-10-29 16:53 UTC (permalink / raw)
  To: Avi Kivity, Marcelo Tosatti; +Cc: kvm

We were missing one indirection here to translate from vmx-local to
x86 slot indices, and this caused subtle host crashes.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---

IOW: Win7 boots for me again.

 arch/x86/kvm/vmx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index a1976c9..6b818c0 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -660,7 +660,8 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
 	}
 #endif
 	for (i = 0; i < vmx->save_nmsrs; ++i)
-		kvm_set_shared_msr(i, vmx->guest_msrs[i].data);
+		kvm_set_shared_msr(vmx->guest_msrs[i].index,
+				   vmx->guest_msrs[i].data);
 }
 
 static void __vmx_load_host_state(struct vcpu_vmx *vmx)

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

* Re: [PATCH] KVM: VMX: Use proper slot index for kvm_set_shared_msr
  2009-10-29 16:53 [PATCH] KVM: VMX: Use proper slot index for kvm_set_shared_msr Jan Kiszka
@ 2009-10-29 17:13 ` Avi Kivity
  2009-11-01  9:09   ` Avi Kivity
  0 siblings, 1 reply; 3+ messages in thread
From: Avi Kivity @ 2009-10-29 17:13 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Marcelo Tosatti, kvm

On 10/29/2009 06:53 PM, Jan Kiszka wrote:
> We were missing one indirection here to translate from vmx-local to
> x86 slot indices, and this caused subtle host crashes.
>
>    

Ahh, good catch.  How did it work?

> Signed-off-by: Jan Kiszka<jan.kiszka@siemens.com>
> ---
>
> IOW: Win7 boots for me again.
>
>   arch/x86/kvm/vmx.c |    3 ++-
>   1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index a1976c9..6b818c0 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -660,7 +660,8 @@ static void vmx_save_host_state(struct kvm_vcpu *vcpu)
>   	}
>   #endif
>   	for (i = 0; i<  vmx->save_nmsrs; ++i)
> -		kvm_set_shared_msr(i, vmx->guest_msrs[i].data);
> +		kvm_set_shared_msr(vmx->guest_msrs[i].index,
> +				   vmx->guest_msrs[i].data);
>   }
>
>   static void __vmx_load_host_state(struct vcpu_vmx *vmx)
>    


-- 
Do not meddle in the internals of kernels, for they are subtle and quick to panic.


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

* Re: [PATCH] KVM: VMX: Use proper slot index for kvm_set_shared_msr
  2009-10-29 17:13 ` Avi Kivity
@ 2009-11-01  9:09   ` Avi Kivity
  0 siblings, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2009-11-01  9:09 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: Marcelo Tosatti, kvm

On 10/29/2009 07:13 PM, Avi Kivity wrote:
> On 10/29/2009 06:53 PM, Jan Kiszka wrote:
>> We were missing one indirection here to translate from vmx-local to
>> x86 slot indices, and this caused subtle host crashes.
>>
>
> Ahh, good catch.  How did it work?

And, of course, applied.  Thanks.

-- 
error compiling committee.c: too many arguments to function


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

end of thread, other threads:[~2009-11-01  9:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-29 16:53 [PATCH] KVM: VMX: Use proper slot index for kvm_set_shared_msr Jan Kiszka
2009-10-29 17:13 ` Avi Kivity
2009-11-01  9:09   ` Avi Kivity

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).