[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3/5] libxc: Allow loading of firmware modules for HVM guest



On Thu, Mar 15, 2018 at 05:31:51PM +0000, Anoob Soman wrote:
> This allows to load iPXE rom as a firmware module, instead of requiring
> it to be embedded into hvmloader.
> 
> Signed-off-by: Anoob Soman <anoob.soman@xxxxxxxxxx>
> ---
>  tools/libxc/xc_dom_x86.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c
> index 0b65dab..be06d43 100644
> --- a/tools/libxc/xc_dom_x86.c
> +++ b/tools/libxc/xc_dom_x86.c
> @@ -1723,6 +1723,19 @@ static int bootlate_hvm(struct xc_dom_image *dom)
>      {
>          add_module_to_list(dom, &dom->system_firmware_module, "firmware",
>                             modlist, start_info);
> +        for ( i = 0; i < dom->num_modules; i++ )
> +        {
> +            struct xc_hvm_firmware_module mod;
> +
> +            DOMPRINTF("Adding module %u", i);
> +            mod.guest_addr_out =
> +                dom->modules[i].seg.vstart;

Shouldn't this be dom->modules[i].seg.vstart - dom->parms.virt_base?

> +            mod.length =
> +                dom->modules[i].seg.vend - dom->modules[i].seg.vstart;
> +
> +            add_module_to_list(dom, &mod, dom->modules[i].cmdline,
> +                               modlist, start_info);
> +        }

Now that both paths of the if ... else ... structure contain the same
code it should be lifted outside of the loop.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.