From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jan Beulich" Subject: Re: regression from c/s 22071:c5aed2e049bc (ept: Put locks around ept_get_entry) ? Date: Tue, 14 Dec 2010 12:37:16 +0000 Message-ID: <4D07730C0200007800027CE6@vpn.id2.novell.com> References: <4D073B3A0200007800027BDF@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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: Christoph Egger , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 14.12.10 at 11:47, George Dunlap = wrote: > Yes, I have to apologize: I have a queue of PoD, p2m, and ept-related > fixes that I haven't pushed to the list because: > * they require non-negligible reworking > * it's been really difficult for me to set up an OSS-based system to = test=20 > them >=20 > It actually turns out that doing locking in ept_get_entry() is the > wrong thing to do anyway; it can cause the following deadlock: >=20 > p2m_change_type [grabs p2m lock] -> set_p2m_entry -> ept_set_entry -> > ept_set_middle_level -> p2m_alloc [grabs hap lock] >=20 > write cr4 -> hap_update_paging_modes [grabes hap lock] -> > hap_update_cr3 -> gfn_to_mfn -> ept_get_entry -> [grabs p2m lock] >=20 > Attached is a ported patch that removes locking in ept_get_entry(), > and implements access-once semantics for reading and writing. This > solves the original problem (a race between reading and writing the > table) without causing deadlocks. I haven't had a chance to test it > -- can you give it a spin? For really giving this a try I'd have to use it on 4.0, where it doesn't apply at all. Resolving the rejects is non-obvious for me in some cases, as I don't know this code well enough. Hence for the moment we'll just drop the bad backport of your first attempt. Jan