From: Tim Deegan Subject: Re: [PATCH 1/1 V3] x86/AMD: Fix nested svm crash due to assertion in __virt_to_maddr Date: Wed, 17 Jul 2013 20:43:59 +0100 Message-ID: <20130717194359.GB80836@ocelot.phlegethon.org> References: <1373564054-4293-1-git-send-email-suravee.suthikulpanit@amd.com> <51DFD3EC02000078000E45BB@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <51DFD3EC02000078000E45BB@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: chegger@amazon.de, suravee.suthikulpanit@amd.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 09:01 +0100 on 12 Jul (1373619676), Jan Beulich wrote: > >>> On 11.07.13 at 19:34, wrote: > > --- a/xen/arch/x86/mm/hap/nested_hap.c > > +++ b/xen/arch/x86/mm/hap/nested_hap.c > > @@ -191,6 +191,19 @@ out: > > return rc; > > } > > > > +int > > +nestedhvm_walk_L0_p2m(struct vcpu *v, paddr_t L1_gpa, paddr_t *L0_gpa) > > +{ > > + p2m_type_t p2mt_10; > > + unsigned int page_order_10; > > + p2m_access_t p2ma_10 = p2m_access_rwx; > > Pointless initializer? Indeed, p2ma_10 could be left alone. > > + > > + return nestedhap_walk_L0_p2m ( p2m_get_hostp2m(v->domain), > > Extra spaces around "(". > > > + L1_gpa, L0_gpa, > > + &p2mt_10, &p2ma_10, &page_order_10, > > + 0, 0, 0); > > Wouldn't the caller's use of the GPA imply that you want read and > write access here? Yes, at least for the callers you've added. > I'm not clear about the need for this new wrapper: Is it really > benign to the caller what type, access, and order get returned > here? Is it really too much of a burden to have the two call > sites do the call here directly? The more that (see above) you'd > really need to give the caller control over the access requested? Yeah, I'm not sure the wrapper is needed. Can the callers just use get_page_from_gfn() to do the translation from guest-MFN -- i.e. will we always be in non-nested mode when we're emulating VMLOAD/VMSAVE? Cheers, Tim.