From: Christoph Egger Subject: Re: [PATCH] ept: Put locks around ept_get_entry Date: Fri, 27 Aug 2010 14:42:02 +0200 Message-ID: <201008271442.03511.Christoph.Egger@amd.com> References: <201008271338.31094.Christoph.Egger@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: George Dunlap Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On Friday 27 August 2010 13:58:44 George Dunlap wrote: > On Fri, Aug 27, 2010 at 12:38 PM, Christoph Egger > > wrote: > > Please use p2m_get_hostp2m(d) instead of d->arch.p2m. > > ...or, just use the p2m variable which was passed as a parameter to > the function. :-) That's even better. The function defintion isn't visible in the hunk. Christoph > Sorry, I wrote this patch for XenServer (using 3.4), and didn't take a > close look. New patch on the way... > -George > > > Christoph > > > >> diff -r 3c4c3d48a835 -r e17c8f37a2c2 xen/arch/x86/mm/hap/p2m-ept.c > >> --- a/xen/arch/x86/mm/hap/p2m-ept.c =A0 Thu Aug 26 11:16:56 2010 +0100 > >> +++ b/xen/arch/x86/mm/hap/p2m-ept.c =A0 Fri Aug 27 12:23:27 2010 +0100 > >> @@ -431,6 +431,10 @@ > >> =A0 =A0 =A0int i; > >> =A0 =A0 =A0int ret =3D 0; > >> =A0 =A0 =A0mfn_t mfn =3D _mfn(INVALID_MFN); > >> + =A0 =A0int do_locking =3D !p2m_locked_by_me(d->arch.p2m); > >> + > >> + =A0 =A0if ( do_locking ) > >> + =A0 =A0 =A0 =A0p2m_lock(d->arch.p2m); > >> > >> =A0 =A0 =A0*t =3D p2m_mmio_dm; > >> > >> @@ -507,6 +511,8 @@ > >> =A0 =A0 =A0} > >> > >> =A0out: > >> + =A0 =A0if ( do_locking ) > >> + =A0 =A0 =A0 =A0p2m_unlock(d->arch.p2m); > >> =A0 =A0 =A0unmap_domain_page(table); > >> =A0 =A0 =A0return mfn; > >> =A0} =2D-=20 =2D--to satisfy European Law for business letters: Advanced Micro Devices GmbH Einsteinring 24, 85609 Dornach b. Muenchen Geschaeftsfuehrer: Alberto Bozzo, Andrew Bowd Sitz: Dornach, Gemeinde Aschheim, Landkreis Muenchen Registergericht Muenchen, HRB Nr. 43632