From: Jan Kiszka <[email protected]>

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 <[email protected]>
Signed-off-by: Avi Kivity <[email protected]>

diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
index baa46c7..b923f2a 100644
--- a/arch/x86/kvm/vmx.c
+++ b/arch/x86/kvm/vmx.c
@@ -656,7 +656,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)
--
To unsubscribe from this list: send the line "unsubscribe kvm-commits" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to