KVM: VMX: Use proper slot index for kvm_set_shared_msr
PATCH 1/1 KVM: VMX: Use proper slot index for kvm_set_shared_msr
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]>
---
IOW: Win7 boots for me again.
arch/x86/kvm/vmx.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
arch/x86/kvm/vmx.c +2 -1
@@ -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)
Quoted 4 lines · Jan Kiszka
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?
Quoted 23 lines
Signed-off-by Jan Kiszka<[email protected]>---
IOW: Win7 boots for me again.
arch/x86/kvm/vmx.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)arch/x86/kvm/vmx.c +2
-1@@ -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)
Signature · 1 line
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
Quoted 6 lines · Avi Kivity
Quoted 3 lines · Jan Kiszka
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.
Signature · 1 line
error compiling committee.c: too many arguments to function