From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keir Fraser Subject: Re: [PATCH] xmalloc: make whole pages xfree() clear the order field (ab)used by xmalloc() Date: Mon, 09 Sep 2013 04:14:45 -0700 Message-ID: References: <521C75AB02000078000EEA15@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 1VIzR0-00028D-1z for xen-devel@lists.xenproject.org; Mon, 09 Sep 2013 11:15:10 +0000 Received: by mail-pd0-f174.google.com with SMTP id y13so6088602pdi.33 for ; Mon, 09 Sep 2013 04:14:51 -0700 (PDT) In-Reply-To: <521C75AB02000078000EEA15@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 , Tomasz Wroblewski Cc: Andrew Cooper , dgdegra@tycho.nsa.gov, xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On 27/08/2013 08:47, "Jan Beulich" wrote: > Not doing this was found to cause problems with sequences of allocation > (multi-page), freeing, and then again allocation of the same page upon > boot when interrupts are still disabled (causing the owner field to be > non-zero, thus making the allocator attempt a TLB flush and, in its > processing, triggering an assertion). > > Reported-by: Tomasz Wroblewski > Signed-off-by: Jan Beulich > Tested-by: Tomasz Wroblewski Acked-by: Keir Fraser > --- a/xen/common/xmalloc_tlsf.c > +++ b/xen/common/xmalloc_tlsf.c > @@ -629,6 +629,7 @@ void xfree(void *p) > unsigned int i, order = get_order_from_pages(size); > > BUG_ON((unsigned long)p & ((PAGE_SIZE << order) - 1)); > + PFN_ORDER(virt_to_page(p)) = 0; > for ( i = 0; ; ++i ) > { > if ( !(size & (1 << i)) ) > > >