[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v7 7/8] xen/arm: export shared memory regions as reserved-memory on device tree
On Tue, 28 Aug 2018, Julien Grall wrote: > Hi, > > On 11/08/18 01:00, Stefano Stabellini wrote: > > Shared memory regions need to be advertised to the guest. Fortunately, a > > device tree binding for special memory regions already exist: > > reserved-memory. > > > > Add a reserved-memory node for each shared memory region, for both > > masters and slaves. > > > > Signed-off-by: Stefano Stabellini <stefanos@xxxxxxxxxx> > > --- > > Changes in v7: > > - change node name to xen-shmem > > - add compatible property > > - add id property > > --- > > tools/libxl/libxl_arch.h | 2 +- > > tools/libxl/libxl_arm.c | 59 > > +++++++++++++++++++++++++++++++++++++++++++++--- > > tools/libxl/libxl_dom.c | 2 +- > > tools/libxl/libxl_x86.c | 2 +- > > 4 files changed, 59 insertions(+), 6 deletions(-) > > > > diff --git a/tools/libxl/libxl_arch.h b/tools/libxl/libxl_arch.h > > index 6a07ccf..3626e4a 100644 > > --- a/tools/libxl/libxl_arch.h > > +++ b/tools/libxl/libxl_arch.h > > @@ -36,7 +36,7 @@ int libxl__arch_domain_create(libxl__gc *gc, > > libxl_domain_config *d_config, > > /* setup arch specific hardware description, i.e. DTB on ARM */ > > _hidden > > int libxl__arch_domain_init_hw_description(libxl__gc *gc, > > - libxl_domain_build_info *info, > > + libxl_domain_config *d_config, > > libxl__domain_build_state > > *state, > > struct xc_dom_image *dom); > > /* finalize arch specific hardware description. */ > > diff --git a/tools/libxl/libxl_arm.c b/tools/libxl/libxl_arm.c > > index 5f62e78..72dd0d2 100644 > > --- a/tools/libxl/libxl_arm.c > > +++ b/tools/libxl/libxl_arm.c > > @@ -461,6 +461,56 @@ 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", ROOT_ADDRESS_CELLS); > > + if (res) return res; > > + > > + res = fdt_property_cell(fdt, "#size-cells", ROOT_SIZE_CELLS); > > + if (res) return res; > > + > > + res = fdt_property(fdt, "ranges", NULL, 0); > > + if (res) return res; > > + > > + for (i = 0; i < d_config->num_sshms; i++) { > > + uint64_t start = d_config->sshms[i].begin; > > NIT: newline. I'll add > > + if (d_config->sshms[i].role == LIBXL_SSHM_ROLE_SLAVE) > > + start += d_config->sshms[i].offset; > > + name = GCSPRINTF("xen-shmem@%"PRIx64, start); > > + > > + res = fdt_begin_node(fdt, name); > > + if (res) return res; > > + > > + res = fdt_property_regs(gc, fdt, ROOT_ADDRESS_CELLS, > > ROOT_SIZE_CELLS, > > + 1, start, d_config->sshms[i].size); > > + if (res) return res; > > + > > + res = fdt_property_compat(gc, fdt, 1, "xen,shared-memory"); > > This requires a patch in the Linux DT docs for the new binding. But more > likely you want to expose a bit more about the shared-memory. For instance the > ID is something really useful to have in hand. > > This could help a tailored guest to distinguish between 2 shared memory. yes, I'll do _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/mailman/listinfo/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |