From: Greg KH on
2.6.33-stable review patch. If anyone has any objections, please let me know.


From: Joerg Roedel <joerg.roedel(a)>

Currently the vmexit emulation does not sync control
registers were the access is typically intercepted by the
nested hypervisor. But we can not count on that intercepts
to sync these registers too and make the code
architecturally more correct.

Cc: stable(a)
Signed-off-by: Joerg Roedel <joerg.roedel(a)>
Signed-off-by: Avi Kivity <avi(a)>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)>

(cherry picked from commit cdbbdc1210223879450555fee04c29ebf116576b)
arch/x86/kvm/svm.c | 4 ++++
1 file changed, 4 insertions(+)

--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1622,9 +1622,13 @@ static int nested_svm_vmexit(struct vcpu
nested_vmcb->save.ds = vmcb->save.ds;
nested_vmcb->save.gdtr = vmcb->save.gdtr;
nested_vmcb->save.idtr = vmcb->save.idtr;
+ nested_vmcb->save.cr0 = svm->vcpu.arch.cr0;
if (npt_enabled)
nested_vmcb->save.cr3 = vmcb->save.cr3;
+ else
+ nested_vmcb->save.cr3 = svm->vcpu.arch.cr3;
nested_vmcb->save.cr2 = vmcb->save.cr2;
+ nested_vmcb->save.cr4 = svm->vcpu.arch.cr4;
nested_vmcb->save.rflags = vmcb->save.rflags;
nested_vmcb-> = vmcb->;
nested_vmcb->save.rsp = vmcb->save.rsp;

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)
More majordomo info at
Please read the FAQ at