From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: [PATCH] nestedsvm: fix shadow-on-hap Date: Wed, 11 May 2011 14:53:03 +0200 Message-ID: <4DCA86AF.6050207@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------030209060308010009020902" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --------------030209060308010009020902 Content-Type: text/plain; charset="ISO-8859-15"; format=flowed Content-Transfer-Encoding: 7bit Hi, attached patch lets l2 guest actually run with shadow-on-hap. Signed-off-by: Christoph Egger -- ---to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85689 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632 --------------030209060308010009020902 Content-Type: text/plain; name="xen_nh_hapshadow.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_nh_hapshadow.diff" Content-Description: xen_nh_hapshadow.diff diff -r 0c60c61ff836 xen/arch/x86/hvm/svm/entry.S --- a/xen/arch/x86/hvm/svm/entry.S Tue May 10 11:42:02 2011 +0200 +++ b/xen/arch/x86/hvm/svm/entry.S Wed May 11 14:50:40 2011 +0200 @@ -65,12 +65,16 @@ ENTRY(svm_asm_do_resume) testl $~0,(r(dx),r(ax),1) jnz .Lsvm_process_softirqs + testb $0, VCPU_nsvm_hap_enabled(r(bx)) + jz .Lsvm_asid_handle + mov VCPU_nhvm_p2m(r(bx)),r(ax) test r(ax),r(ax) sete %al andb VCPU_nhvm_guestmode(r(bx)),%al jnz .Lsvm_nsvm_no_p2m +.Lsvm_asid_handle: call svm_asid_handle_vmrun cmpb $0,addr_of(tb_init_done) diff -r 0c60c61ff836 xen/arch/x86/hvm/svm/nestedsvm.c --- a/xen/arch/x86/hvm/svm/nestedsvm.c Tue May 10 11:42:02 2011 +0200 +++ b/xen/arch/x86/hvm/svm/nestedsvm.c Wed May 11 14:50:40 2011 +0200 @@ -546,6 +547,7 @@ static int nsvm_vmcb_prepare4vmrun(struc /* host nested paging + guest shadow paging. */ n2vmcb->_np_enable = 1; /* Keep h_cr3 as it is. */ + n2vmcb->_h_cr3 = n1vmcb->_h_cr3; /* When l1 guest does shadow paging * we assume it intercepts page faults. */ --------------030209060308010009020902 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.xensource.com http://lists.xensource.com/xen-devel --------------030209060308010009020902--