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

Re: [Xen-devel] [PATCH v8 7/8] xen/arm: export shared memory regions as reserved-memory on device tree



Stefano Stabellini writes ("[PATCH v8 7/8] xen/arm: export shared memory 
regions as reserved-memory on device tree"):
> Shared memory regions need to be advertised to the guest. Fortunately, a
> device tree binding for special memory regions already exist:
> reserved-memory.

Oh!  Here is the guest ABI.

But it's not documented.

> diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c
> index 054ad58..c1624c0 100644
> --- a/tools/libxl/libxl_arm.c
> +++ b/tools/libxl/libxl_arm.c
> @@ -436,6 +436,58 @@ static int make_memory_nodes(libxl__gc *gc, void *fdt,
>      return 0;
>  }
>  
> +static int make_reserved_nodes(libxl__gc *gc, void *fdt,
> +                               libxl_domain_config *d_config)
> +{
> +    int res, i;
> +    const char *name;
> +
> +    if (d_config->num_sshms == 0)
> +        return 0;
> +
> +    res = fdt_begin_node(fdt, "reserved-memory");
> +    if (res) return res;
> +
> +    res = fdt_property_cell(fdt, "#address-cells", GUEST_ROOT_ADDRESS_CELLS);
> +    if (res) return res;
> +
> +    res = fdt_property_cell(fdt, "#size-cells", GUEST_ROOT_SIZE_CELLS);
> +    if (res) return res;
> +
> +    res = fdt_property(fdt, "ranges", NULL, 0);
> +    if (res) return res;

The line lengths here are very long.  Also it's quite formulaic.  I
see make_psci_node is quite like that too.  IDK whether a local macro
would help.

> +    for (i = 0; i < d_config->num_sshms; i++) {
> +        uint64_t start = d_config->sshms[i].begin;
> +
> +        if (d_config->sshms[i].role == LIBXL_SSHM_ROLE_SLAVE)
> +            start += d_config->sshms[i].offset;

Why is d_config->sshms[i].offset not 0 for the owner ?
You could do this unconditionally.

> -static int libxl__prepare_dtb(libxl__gc *gc, libxl_domain_build_info *info,
> +static int libxl__prepare_dtb(libxl__gc *gc, libxl_domain_config *d_config,

Can we have this NFC change and its consequences as a pre-patch ?

Thanks,
Ian.

_______________________________________________
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®.