From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: [PATCH] nestedsvm: fix paging mode Date: Fri, 21 Sep 2012 16:01:31 +0200 Message-ID: <505C733B.50205@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090209060906050805000502" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org --------------090209060906050805000502 Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: 7bit On VMRUN and VMEXIT emulation update the paging mode for Shadow-on-Nested. This allows Xen to walk the l1 hypervisors shadow page table correctly. Problem found with 64bit Win7 and 32bit XPMode where Win7 switches forth and back between long mode and PAE legacy pagetables. Signed-off-by: Christoph Egger P.S.: Please apply this patch to xen-4.2-testing as well. -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85689 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --------------090209060906050805000502 Content-Type: text/plain; charset="us-ascii"; name="xen_nh_paging.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_nh_paging.diff" Content-Description: xen_nh_paging.diff 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) --------------090209060906050805000502 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --------------090209060906050805000502--