From: Rusty Russell Date: Wed, 25 Jul 2007 03:29:51 +0000 (+1000) Subject: KVM: load_pdptrs() cleanups X-Git-Tag: v2.6.24-rc1~1365^2~82 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c820c2aa27bb5b6069aa708b0a0b44b59a16bfa7;p=pandora-kernel.git KVM: load_pdptrs() cleanups load_pdptrs can be handed an invalid cr3, and it should not oops. This can happen because we injected #gp in set_cr3() after we set vcpu->cr3 to the invalid value, or from kvm_vcpu_ioctl_set_sregs(), or memory configuration changes after the guest did set_cr3(). We should also copy the pdpte array once, before checking and assigning, otherwise an SMP guest can potentially alter the values between the check and the set. Finally one nitpick: ret = 1 should be done as late as possible: this allows GCC to check for unset "ret" should the function change in future. Signed-off-by: Rusty Russell Signed-off-by: Avi Kivity --- Reading git-diff-tree failed