From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Egger Subject: Re: [PATCH] nestedhvm: ASID emulation Date: Fri, 15 Apr 2011 11:57:50 +0200 Message-ID: <4DA8169E.3020100@amd.com> References: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040506030601040704070803" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Keir Fraser Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org --------------040506030601040704070803 Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit On 04/15/11 11:24, Keir Fraser wrote: > On 15/04/2011 10:08, "Christoph Egger" wrote: > >>> You didn't notice my subtle error in switching n1 and n2 asid selection in >>> svm_asid_handle_vmrun()? ;-) >> >> Oh, now that you mention it... > > Yeah, I fixed it before I checked it in (xen-unstable:23229). > >> A l2 smp guest actually boots up. Maybe I need to use more vcpus than I >> have physical cpus to hit that bug. > > I think it would have been a source of very subtle quite hard-to-repro bugs. > Not something you'd pick up in a simple does-it-boot smoke test. So a pretty > nasty bug all round! Just found another fallout that got lost from my original patch. After shutting down XP mode in Windows 7, Win7 turns off SVM in EFER after about 30 seconds. When starting XP mode again, Win 7 turns SVM on again. Then nv_n2asid can be stale. Attached patch fixes this. 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 --------------040506030601040704070803 Content-Type: text/plain; name="xen_nh_asid.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="xen_nh_asid.diff" Content-Description: xen_nh_asid.diff diff -r 9a0ed35421da -r ad5960696d68 xen/arch/x86/hvm/nestedhvm.c --- a/xen/arch/x86/hvm/nestedhvm.c +++ b/xen/arch/x86/hvm/nestedhvm.c @@ -61,6 +61,7 @@ nestedhvm_vcpu_reset(struct vcpu *v) nv->nv_vvmcxaddr = VMCX_EADDR; nv->nv_flushp2m = 0; nv->nv_p2m = NULL; + memset(&nv->nv_n2asid, 0, sizeof(struct hvm_vcpu_asid)); if ( hvm_funcs.nhvm_vcpu_reset ) hvm_funcs.nhvm_vcpu_reset(v); --------------040506030601040704070803 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 --------------040506030601040704070803--