From: Keir Fraser Subject: Re: [PATCH] Make get_page_from_l1e refcount correctly on foreign pagetables. Date: Thu, 14 May 2009 10:17:07 +0100 Message-ID: References: <20090513160725.GH12377@york.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090513160725.GH12377@york.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Tim Deegan , "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org On 13/05/2009 17:07, "Tim Deegan" wrote: > Hypercalls from dom0 can end up doing resyncs on HVM guests' out-of-sync > shadow pagetables. At that point the check against current->domain in > get_page_from_l1e() triggers the typecount exemption for foreign mappings > and a writeable typecount gets lost. > > Make the foreign-domain check explicit by having get_page_from_l1e_for(), > which understands both the dom whose right are being used and the dom > whose pagetables are being updated. Most callers of get_page_from_l1e() > have both the same (instead of one hard-coded to current->domain as before). The patch doesn't apply to unstable/3.4. Further, the usage of domain pointers in get_page_from_l1e_for() is now pretty insane -- we have 'd', 'target', 'owner', and still a couple of references to 'current->domain'. Can we rename some of these, and/or remove redundant variables, and/or add a function comment explaining what is going on therein, and be really sure this won't bite us if we check it in so close to 3.4.0? I'm certainly nervous about it. -- Keir