Commit:     eff708bc2bacd4f22cf844871341bef341bd096a
Parent:     47ad8e689b4f94f9fc3b2588a7aaa65e4eca667c
Author:     Avi Kivity <[EMAIL PROTECTED]>
AuthorDate: Sun May 6 16:10:01 2007 +0300
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Mon Jul 16 12:05:41 2007 +0300

    KVM: VMX: Only reload guest msrs if they are already loaded
    If we set an msr via an ioctl() instead of by handling a guest exit, we
    have the host state loaded, so reloading the msrs would clobber host
    state instead of guest state.
    This fixes a host oops (and loss of a cpu) on a guest reboot.
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
 drivers/kvm/vmx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index 096cb6a..b353eaa 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -600,7 +600,8 @@ static int vmx_set_msr(struct kvm_vcpu *vcpu, u32 
msr_index, u64 data)
                msr = find_msr_entry(vcpu, msr_index);
                if (msr)
                        msr->data = data;
-               load_msrs(vcpu->guest_msrs, NR_BAD_MSRS);
+               if (vcpu->vmx_host_state.loaded)
+                       load_msrs(vcpu->guest_msrs, NR_BAD_MSRS);
        case MSR_IA32_SYSENTER_CS:
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to