From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH v2 08/10] xen/arm: Implement xen_rem_foreign_from_p2m Date: Tue, 10 Dec 2013 01:33:08 +0000 Message-ID: <52A66F54.7060809@linaro.org> References: <1386560047-17500-1-git-send-email-julien.grall@linaro.org> <1386560047-17500-9-git-send-email-julien.grall@linaro.org> <1386606664.7812.55.camel@kazak.uk.xensource.com> <52A5F909.7070904@linaro.org> <1386609534.7812.80.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1VqCCH-0001za-6b for xen-devel@lists.xenproject.org; Tue, 10 Dec 2013 01:33:13 +0000 Received: by mail-wi0-f173.google.com with SMTP id hn9so4713485wib.6 for ; Mon, 09 Dec 2013 17:33:11 -0800 (PST) In-Reply-To: <1386609534.7812.80.camel@kazak.uk.xensource.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: Ian Campbell Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com, patches@linaro.org List-Id: xen-devel@lists.xenproject.org On 12/09/2013 05:18 PM, Ian Campbell wrote: > On Mon, 2013-12-09 at 17:08 +0000, Julien Grall wrote: >> On 12/09/2013 04:31 PM, Ian Campbell wrote: >>> On Mon, 2013-12-09 at 03:34 +0000, Julien Grall wrote: [..] > >>> >>>> + return -EINVAL; >>>> + } >>>> + >>>> + guest_physmap_remove_page(d, gpfn, mfn, 0); >>>> + put_page(mfn_to_page(mfn)); >>> >>> Some of this could become a common helper with create_p2m_entries and >>> the relinquish stuff in the previous patch. >> >> The best solution is to move put_page in guest_physmap_remove_page. But >> as we didn't plan to handle refcount for each mapping in Xen 4.4, >> perhaps we can delay it? > > You can move it and still have it be conditional I think, since g_p_r_p > can see the type in the pte, can't it? I plan to move the put_page in create_p2m_entries and check pte type. -- Julien Grall