From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: Re: Ping: [PATCH] use clear_domain_page() instead of open coding it Date: Mon, 2 Nov 2015 13:50:52 +0000 Message-ID: <1446472252.3088.43.camel@citrix.com> References: <56251FA002000078000AC6C0@prv-mh.provo.novell.com> <562E335902000078000AE9C7@prv-mh.provo.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 1ZtFVg-0007WM-Cq for xen-devel@lists.xenproject.org; Mon, 02 Nov 2015 13:50:56 +0000 In-Reply-To: <562E335902000078000AE9C7@prv-mh.provo.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 , Ian Jackson , Keir Fraser , Tim Deegan Cc: George Dunlap , Andrew Cooper , Kevin Tian , Jun Nakajima , xen-devel List-Id: xen-devel@lists.xenproject.org On Mon, 2015-10-26 at 07:06 -0600, Jan Beulich wrote: > > > > On 19.10.15 at 16:51, wrote: > > "REST" maintainers, could I please get an ack or otherwise on this > common code change? > > Thanks, Jan > > > --- a/xen/common/page_alloc.c > > +++ b/xen/common/page_alloc.c > > @@ -1959,22 +1959,16 @@ __initcall(pagealloc_keyhandler_init); > > > > void scrub_one_page(struct page_info *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); > > + unmap_domain_page(memset(__map_domain_page(pg), 0xc2, PAGE_SIZE)); I'm not madly keep on this clever nesting of the map/memset/unmap and would have preferred a more localised void *p (or a memset_domain_page helper maybe), but I don't mind enough to block this over: Acked-by: Ian Campbell > > #else > > /* For a production build, clear_page() is the fastest way to > > scrub. */ > > - clear_page(p); > > + clear_domain_page(_mfn(page_to_mfn(pg))); > > #endif > > - > > - unmap_domain_page(p); > > } > > > > static void dump_heap(unsigned char key) > > >