From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH 2/2] xen/page_alloc: Defer the domain mapping in scrub_one_page() Date: Mon, 09 Dec 2013 11:02:17 +0000 Message-ID: References: <52A5A4F8020000780010B4DC@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" 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 1VpybZ-0006ec-1z for xen-devel@lists.xenproject.org; Mon, 09 Dec 2013 11:02:25 +0000 Received: by mail-wi0-f182.google.com with SMTP id en1so3492346wid.15 for ; Mon, 09 Dec 2013 03:02:23 -0800 (PST) In-Reply-To: <52A5A4F8020000780010B4DC@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: Andrew Cooper , Tim Deegan , xen-devel List-Id: xen-devel@lists.xenproject.org On 09/12/2013 10:09, "Jan Beulich" wrote: >>>> On 04.12.13 at 16:09, Andrew Cooper wrote: >> This avoids a resource leak and needless playing with the pagetables in the >> case that the page is broken. >> >> Signed-off-by: Andrew Cooper >> CC: Keir Fraser > > Keir? Reviewed-by: Keir Fraser >> CC: Jan Beulich >> CC: Tim Deegan >> --- >> xen/common/page_alloc.c | 4 +++- >> 1 file changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c >> index 8002bd2..5f484a2 100644 >> --- a/xen/common/page_alloc.c >> +++ b/xen/common/page_alloc.c >> @@ -1652,11 +1652,13 @@ __initcall(pagealloc_keyhandler_init); >> >> void scrub_one_page(struct page_info *pg) >> { >> - void *p = __map_domain_page(pg); >> + void *p; >> >> if ( unlikely(pg->count_info & PGC_broken) ) >> return; >> >> + p = __map_domain_page(pg); >> + >> #ifndef NDEBUG >> /* Avoid callers relying on allocations returning zeroed pages. */ >> memset(p, 0xc2, PAGE_SIZE); >> -- >> 1.7.10.4 > > >