From: Tim Deegan Subject: Re: [PATCH 1/1 V5] x86/AMD: Fix nested svm crash due to assertion in __virt_to_maddr Date: Thu, 8 Aug 2013 10:38:24 +0100 Message-ID: <20130808093824.GA68503@ocelot.phlegethon.org> References: <1375691514-3426-1-git-send-email-suravee.suthikulpanit@amd.com> <520264F102000078000E9EFA@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1V7Mft-0000eg-2W for xen-devel@lists.xenproject.org; Thu, 08 Aug 2013 09:38:29 +0000 Content-Disposition: inline In-Reply-To: <520264F102000078000E9EFA@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: xen-devel , chegger@amazon.de, suravee.suthikulpanit@amd.com List-Id: xen-devel@lists.xenproject.org At 14:17 +0100 on 07 Aug (1375885025), Jan Beulich wrote: > >>> On 05.08.13 at 10:31, wrote: > > From: Suravee Suthikulpanit > > > > Fix assertion in __virt_to_maddr when starting nested SVM guest > > in debug mode. Investigation has shown that svm_vmsave/svm_vmload > > make use of __pa() with invalid address. > > > > Signed-off-by: Suravee Suthikulpanit > > Tim - have all your earlier comments been addressed in this version? Yes, I'm happy with this one. Reviewed-by: Tim Deegan > > - if (!nestedhvm_enabled(v->domain)) { > > + if ( !nestedhvm_enabled(v->domain) || !hvm_svm_enabled(v) ) { > > Suravee, why is this change needed (here and further down)? > Can we really get here when hvm_svm_enabled(v) returns false? > I don't recall this having been there in earlier versions. This came from discussion of what fault to inject -- we always intercept VM{RUN,LOAD,SAVE} so I think we can get here. The AMD docs for those say: "Checks exceptions (#GP) before the intercept." but nothing about checking guest_efer.SVME so AFAICT we have to do that in Xen. Arguably this fix could could be a separate patch. Certainly the same check ought to go into svm_exit_do_vmrun(). Tim.