total_pages = ram_size >> PAGE_SHIFT;
- if ( bootinfo.static_heap )
+ if ( using_static_heap )
{
const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
do
{
- e = bootinfo.static_heap ?
+ e = using_static_heap ?
fit_xenheap_in_static_heap(pfn_to_paddr(xenheap_pages), MB(32)) :
consider_modules(ram_start, ram_end,
pfn_to_paddr(xenheap_pages),
for ( ; i < (1 << kernel_order_out); i++ )
free_domheap_page(pages + i);
+ /*
+ * When using static heap feature, don't give bootmodules memory back to
+ * the heap allocator
+ */
+ if ( using_static_heap )
+ return 0;
+
/*
* When freeing the kernel, we need to pass the module start address and
* size as they were before taking an offset to gzip header into account,
if ( rc )
panic("Unable to remove the init section (rc = %d)\n", rc);
- init_domheap_pages(pa, pa + len);
- printk("Freed %ldkB init memory.\n", (long)(__init_end-__init_begin)>>10);
+ if ( !using_static_heap )
+ {
+ init_domheap_pages(pa, pa + len);
+ printk("Freed %ldkB init memory.\n",
+ (long)(__init_end-__init_begin) >> 10);
+ }
}
/**
struct bootmodules *mi = &bootinfo.modules;
int i;
+ /*
+ * When using static heap feature, don't give bootmodules memory back to
+ * the heap allocator
+ */
+ if ( using_static_heap )
+ goto out;
+
for ( i = 0; i < mi->nr_mods; i++ )
{
paddr_t s = mi->module[i].start;
mi->nr_mods = 0;
+ out:
remove_early_mappings();
}
if ( rc )
return rc;
- bootinfo.static_heap = true;
+ using_static_heap = true;
}
printk("Checking for initrd in /chosen\n");
const struct membanks *reserved_mem = bootinfo_get_reserved_mem();
paddr_t s, e;
- if ( bootinfo.static_heap )
+ if ( using_static_heap )
{
for ( i = 0 ; i < reserved_mem->nr_banks; i++ )
{
#define PGT_TYPE_INFO_INITIALIZER 0
#endif
+/* Flag saved when Xen is using the static heap feature */
+bool __ro_after_init using_static_heap;
+
unsigned long __read_mostly max_page;
unsigned long __read_mostly total_pages;
paddr_t __ro_after_init mem_hotplug;
#ifdef CONFIG_STATIC_SHM
struct shared_meminfo shmem;
#endif
- bool static_heap;
};
#ifdef CONFIG_ACPI
struct page_info;
+extern bool using_static_heap;
+
void put_page(struct page_info *page);
bool __must_check get_page(struct page_info *page,
const struct domain *domain);