mirror of
https://github.com/xen-project/xen.git
synced 2026-10-30 03:00:05 +01:00
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: 0fbf3208d9
master date: 2013-09-09 14:34:12 +0200
This commit is contained in:
1 parent
e1d767acd8
commit
1e5b44dc07
1 file changed
+1
@@ -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)) )
|
||||
|
||||