unsigned int initrdidx, num_parked = 0;
multiboot_info_t *mbi;
module_t *mod;
- unsigned long nr_pages, raw_max_page, modules_headroom, module_map[1];
+ unsigned long nr_pages, raw_max_page, modules_headroom = 0, module_map[1];
int i, j, e820_warn = 0, bytes = 0;
bool acpi_boot_table_init_done = false, relocated = false, lu_reserved = false;
int ret;
}
bitmap_fill(module_map, mbi->mods_count);
- __clear_bit(0, module_map); /* Dom0 kernel is always first */
+ if ( !lu_breadcrumb_phys )
+ __clear_bit(0, module_map); /* Dom0 kernel is always first */
if ( pvh_boot )
{
mod[mbi->mods_count].mod_end = __2M_rwdata_end - _stext;
}
- modules_headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
- bootstrap_map(NULL);
+
+ if ( !lu_breadcrumb_phys )
+ {
+ modules_headroom = bzimage_headroom(bootstrap_map(mod), mod->mod_end);
+ bootstrap_map(NULL);
+ }
#ifndef highmem_start
/* Don't allow split below 4Gb. */
cpu_has_nx ? XENLOG_INFO : XENLOG_WARNING "Warning: ",
cpu_has_nx ? "" : "not ");
- initrdidx = find_first_bit(module_map, mbi->mods_count);
- if ( bitmap_weight(module_map, mbi->mods_count) > 1 )
- printk(XENLOG_WARNING
- "Multiple initrd candidates, picking module #%u\n",
- initrdidx);
- /*
- * We're going to setup domain0 using the module(s) that we stashed safely
- * above our heap. The second module, if present, is an initrd ramdisk.
- */
- dom0 = create_dom0(mod, modules_headroom,
- (initrdidx > 0) && (initrdidx < mbi->mods_count)
- ? mod + initrdidx : NULL, kextra, loader);
- if ( dom0 == NULL )
- panic("Could not set up DOM0 guest OS\n");
+ if ( lu_breadcrumb_phys )
+ {
+ dom0 = lu_restore_domains(&lu_stream);
+ if ( dom0 == NULL )
+ panic("No DOM0 found in live update data\n");
+
+ lu_stream_free(&lu_stream);
+ }
+ else
+ {
+ initrdidx = find_first_bit(module_map, mbi->mods_count);
+ if ( bitmap_weight(module_map, mbi->mods_count) > 1 )
+ printk(XENLOG_WARNING
+ "Multiple initrd candidates, picking module #%u\n",
+ initrdidx);
+ /*
+ * We're going to setup domain0 using the module(s) that we stashed
+ * safely above our heap. The second module, if present, is an initrd.
+ */
+ dom0 = create_dom0(mod, modules_headroom,
+ (initrdidx > 0) && (initrdidx < mbi->mods_count)
+ ? mod + initrdidx : NULL, kextra, loader);
+ if ( dom0 == NULL )
+ panic("Could not set up DOM0 guest OS\n");
+ }
heap_init_late();