diff -r ef514a30fd70 xen/arch/x86/hvm/svm/nestedsvm.c --- a/xen/arch/x86/hvm/svm/nestedsvm.c Fri Sep 21 13:25:22 2012 +0200 +++ b/xen/arch/x86/hvm/svm/nestedsvm.c Fri Sep 21 14:44:13 2012 +0200 @@ -745,6 +745,11 @@ nsvm_vcpu_vmrun(struct vcpu *v, struct c return 1; } + /* If we use nested paging and l1 guest uses shadow paging ... */ + if (paging_mode_hap(v->domain) && !nestedhvm_paging_mode_hap(v)) + /* ... update the paging modes. */ + paging_update_paging_modes(v); + nv->nv_vmswitch_in_progress = 0; return 0; } @@ -1412,6 +1417,11 @@ nestedsvm_vcpu_vmexit(struct vcpu *v, st */ rc = nhvm_vcpu_vmexit(v, regs, exitcode); + /* If we use nested paging and l1 guest uses shadow paging ... */ + if (paging_mode_hap(v->domain) && !nestedhvm_paging_mode_hap(v)) + /* ... update the paging modes. */ + paging_update_paging_modes(v); + nv->nv_vmswitch_in_progress = 0; if (rc)