> -----Original Message-----
> From: Jan Kiszka [mailto:[email protected]]
> Sent: 2019年2月19日 13:25
> To: Peng Fan <[email protected]>
> Cc: [email protected]; [email protected]; Henning
> Schild <[email protected]>
> Subject: Re: [PATCH] driver: invoke jailhouse_firmware_free when disabling
> jailhouse
>
> On 19.02.19 03:30, Peng Fan wrote:
> > After `jailhouse disable`, there is still an IO entry from /proc/iomem
> > for jailhouse, so call jailhouse_firmware_free when disabling
> > jailhouse for fix this. Also drop the call to jailhouse_firmware_free
> > when enabling jailhouse.
> >
> > Signed-off-by: Peng Fan <[email protected]>
> > ---
> > driver/main.c | 12 ++++++------
> > 1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/driver/main.c b/driver/main.c index fe752753..5cdb5892
> > 100644
> > --- a/driver/main.c
> > +++ b/driver/main.c
> > @@ -306,8 +306,11 @@ static void jailhouse_firmware_free(void)
> > resource_size(hypervisor_mem_res));
> > hypervisor_mem_res = NULL;
> > }
> > - vunmap(hypervisor_mem);
> > - hypervisor_mem = NULL;
> > +
> > + if (hypervisor_mem) {
> > + vunmap(hypervisor_mem);
> > + hypervisor_mem = NULL;
> > + }
> > }
> >
> > int jailhouse_console_dump_delta(char *dst, unsigned int head, @@
> > -437,10 +440,6 @@ static int jailhouse_cmd_enable(struct
> jailhouse_system __user *arg)
> > #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();
> > -
> > hypervisor_mem_res = request_mem_region(hv_mem->phys_start,
> > hv_mem->size,
> > "Jailhouse hypervisor");
> > @@ -701,6 +700,7 @@ static int jailhouse_cmd_disable(void)
> > update_last_console();
> >
> > jailhouse_cell_delete_root();
> > + jailhouse_firmware_free();
> > jailhouse_enabled = false;
> > module_put(THIS_MODULE);
> >
> >
>
> If you look at how the code became like this, you will also find the reason:
> b336a2935dff -> 6efdd17c8bf5. Maybe we need a better inline comment to
> document this?
It is clear from the patch
"
driver: keep the firmware mapped after "disable"
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.
"
I did not check the patch history.
Thanks,
Peng.
>
> Jan
>
> --
> Siemens AG, Corporate Technology, CT RDA IOT SES-DE Corporate
> Competence Center Embedded Linux
--
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.