Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fb764416492a1204c20fdf4507019012d27bd1a2
Commit:     fb764416492a1204c20fdf4507019012d27bd1a2
Parent:     002c7f7c32a6123f0894d7d579ffae8e98911830
Author:     Rusty Russell <[EMAIL PROTECTED]>
AuthorDate: Tue Jul 31 20:45:03 2007 +1000
Committer:  Avi Kivity <[EMAIL PROTECTED]>
CommitDate: Sat Oct 13 10:18:22 2007 +0200

    KVM: Don't assign vcpu->cr3 if it's invalid: check first, set last
    
    sSigned-off-by: Rusty Russell <[EMAIL PROTECTED]>
    Signed-off-by: Avi Kivity <[EMAIL PROTECTED]>
---
 drivers/kvm/kvm_main.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 2be6b1c..5dc6017 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -579,7 +579,6 @@ void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
                }
        }
 
-       vcpu->cr3 = cr3;
        mutex_lock(&vcpu->kvm->lock);
        /*
         * Does the new cr3 value map to physical memory? (Note, we
@@ -592,8 +591,10 @@ void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
         */
        if (unlikely(!gfn_to_memslot(vcpu->kvm, cr3 >> PAGE_SHIFT)))
                inject_gp(vcpu);
-       else
+       else {
+               vcpu->cr3 = cr3;
                vcpu->mmu.new_cr3(vcpu);
+       }
        mutex_unlock(&vcpu->kvm->lock);
 }
 EXPORT_SYMBOL_GPL(set_cr3);
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to