From: Tim Deegan Subject: Re: [PATCH] NPT: temporarily retain page table mapping in do_recalc() Date: Tue, 6 May 2014 12:45:23 +0200 Message-ID: <20140506104523.GA34366@deinos.phlegethon.org> References: <536784BB020000780000EF15@mail.emea.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 1WhcsH-0001n7-Ch for xen-devel@lists.xenproject.org; Tue, 06 May 2014 10:45:25 +0000 Content-Disposition: inline In-Reply-To: <536784BB020000780000EF15@mail.emea.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 List-Id: xen-devel@lists.xenproject.org At 11:31 +0100 on 05 May (1399285915), Jan Beulich wrote: > Commit b3e024f3 ("x86/NPT: don't walk page tables when changing types > on a range") neglected the fact that p2m_next_level() replaces the > previous level's mapping with the new level's one, hence dereferencing > a stale pointer the translation for which may no longer be available > (timing dependent). Add a parameter to that function allowing the > caller to request that the mapping be retained (the unmapping will be > taken care of by the caller then). > > Signed-off-by: Jan Beulich That's not a very nice interface, but I can't see a way around it, since do_recalc() needs to have the lower-level mapping available before it writes the upper-level entry, and having all callers of p2m_next_level() do their own unmap would be awful too. Reviewed-by: Tim Deegan