We used to unmap the firmware image right after "jailhouse disable". Change that and keep the firmware mapped until we exit the module or restart jailhouse. This way we can look into the firmware that just ran.
This will be used by later patches. Signed-off-by: Henning Schild <[email protected]> Tested-by: Ralf Ramsauer <[email protected]> diff --git a/driver/main.c b/driver/main.c --- a/driver/main.c +++ b/driver/main.c @@ -394,6 +394,9 @@ static int jailhouse_cmd_enable(struct j #ifdef JAILHOUSE_BORROW_ROOT_PT remap_addr = JAILHOUSE_BASE; #endif + /* Unmap hypervisor_mem from a previous "enable". The mapping has to be + * redone since the root-cell config might have changed. */ + jailhouse_firmware_free(); /* Map physical memory region reserved for Jailhouse. */ hypervisor_mem = jailhouse_ioremap(hv_mem->phys_start, remap_addr, hv_mem->size); @@ -609,8 +612,6 @@ static int jailhouse_cmd_disable(void) update_last_console(); - jailhouse_firmware_free(); - jailhouse_cell_delete_root(); jailhouse_enabled = false; module_put(THIS_MODULE); @@ -833,6 +834,7 @@ static void __exit jailhouse_exit(void) unregister_reboot_notifier(&jailhouse_shutdown_nb); misc_deregister(&jailhouse_misc_dev); jailhouse_sysfs_exit(jailhouse_dev); + jailhouse_firmware_free(); jailhouse_pci_unregister(); root_device_unregister(jailhouse_dev); } -- You received this message because you are subscribed to the Google Groups "Jailhouse" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
