aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2013-09-12 11:15:24 +0200
committerJan Beulich <jbeulich@suse.com>2013-09-12 11:15:24 +0200
commit1e5b44dc07d5f052d85441dc875ef65cf00f4841 (patch)
tree60090b0fec775718a5313fd264f8d3dd8b5db6f8
parente1d767acd8c08c776a65dfc67eed0afbcfbc1c86 (diff)
downloadxen-1e5b44dc07d5f052d85441dc875ef65cf00f4841.tar.gz
xen-1e5b44dc07d5f052d85441dc875ef65cf00f4841.tar.bz2
xen-1e5b44dc07d5f052d85441dc875ef65cf00f4841.zip
xmalloc: make whole pages xfree() clear the order field (ab)used by xmalloc()
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 <tomasz.wroblewski@citrix.com> Signed-off-by: Jan Beulich <jbeulich@suse.com> Tested-by: Tomasz Wroblewski <tomasz.wroblewski@citrix.com> Acked-by: Keir Fraser <keir@xen.org> master commit: 0fbf3208d9c1a568aeeb61d9f4fbca03b1cfa1f8 master date: 2013-09-09 14:34:12 +0200
-rw-r--r--xen/common/xmalloc_tlsf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/xen/common/xmalloc_tlsf.c b/xen/common/xmalloc_tlsf.c
index f19fb85f1f..d3bdfa7d57 100644
--- 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)) )