From: Tim Deegan Subject: Re: [PATCH] x86/mm: Take the p2m lock even in shadow mode. Date: Thu, 21 Feb 2013 14:33:01 +0000 Message-ID: <20130221143301.GL24051@ocelot.phlegethon.org> References: <1361456469-16406-1-git-send-email-tim@xen.org> <51263D3C02000078000BFFB5@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: <51263D3C02000078000BFFB5@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@lists.xen.org List-Id: xen-devel@lists.xenproject.org At 14:29 +0000 on 21 Feb (1361456940), Jan Beulich wrote: > >>> On 21.02.13 at 15:21, Tim Deegan wrote: > > The reworking of p2m lookups to use get_gfn()/put_gfn() left the > > shadow code not taking the p2m lock, even in cases where the p2m would > > be updated (i.e. PoD). > > > > In many cases, shadow code doesn't need the exclusion that > > get_gfn()/put_gfn() provides, as it has its own interlocks against p2m > > updates, but this is taking things too far, and can lead to crashes in > > the PoD code. > > > > Now that most shadow-code p2m lookups are done with explicitly > > unlocked accessors, or with the get_page_from_gfn() accessor, which is > > often lock-free, we can just turn this locking on. > > > > The remaining locked lookups are in sh_page_fault() (in a path that's > > almost always already serializing on the paging lock), and in > > emulate_map_dest() (which can probably be updated to use > > get_page_from_gfn()). They're not addressed here but may be in a > > follow-up patch. > > I assume once coming out of stage testing, this also needs to be > put into 4.2? Yes, sorry I forgot to mention it. Definitely a candidate for 4.2 Tim.