Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 701a261a authored by Boris Ostrovsky's avatar Boris Ostrovsky Committed by David Vrabel
Browse files

x86/xen: Free bootmem in free_p2m_page() during early boot



With recent changes in p2m we now have legitimate cases when
p2m memory needs to be freed during early boot (i.e. before
slab is initialized).

Signed-off-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
Reviewed-by: default avatarJuergen Gross <jgross@suse.com>
Signed-off-by: default avatarDavid Vrabel <david.vrabel@citrix.com>
parent 8b8cd8a3
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -167,10 +167,13 @@ static void * __ref alloc_p2m_page(void)
	return (void *)__get_free_page(GFP_KERNEL | __GFP_REPEAT);
}

/* Only to be called in case of a race for a page just allocated! */
static void free_p2m_page(void *p)
static void __ref free_p2m_page(void *p)
{
	BUG_ON(!slab_is_available());
	if (unlikely(!slab_is_available())) {
		free_bootmem((unsigned long)p, PAGE_SIZE);
		return;
	}

	free_page((unsigned long)p);
}