[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 29/31] libxc/xen: introduce HVM_PARAM_MODLIST_PFN
On Fri, Aug 07, 2015 at 12:18:06PM +0200, Roger Pau Monne wrote: > This HVM parameter is used to pass a list of loaded modules to the guest. > Right now the number of loaded modules is limited to 1 by the current > implementation, but this interface allows passing more than one module. > > Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx> > Cc: Ian Jackson <ian.jackson@xxxxxxxxxxxxx> > Cc: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx> > Cc: Ian Campbell <ian.campbell@xxxxxxxxxx> > Cc: Wei Liu <wei.liu2@xxxxxxxxxx> > Cc: Keir Fraser <keir@xxxxxxx> > Cc: Jan Beulich <jbeulich@xxxxxxxx> > Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx> > --- > tools/libxc/xc_dom_x86.c | 20 ++++++++++++++++++++ > xen/arch/x86/hvm/hvm.c | 2 ++ > xen/include/public/hvm/params.h | 23 ++++++++++++++++++++++- > 3 files changed, 44 insertions(+), 1 deletion(-) > > diff --git a/tools/libxc/xc_dom_x86.c b/tools/libxc/xc_dom_x86.c > index 369745d..1599de4 100644 > --- a/tools/libxc/xc_dom_x86.c > +++ b/tools/libxc/xc_dom_x86.c > @@ -579,6 +579,26 @@ static int alloc_magic_pages_hvm(struct xc_dom_image > *dom) > xc_hvm_param_set(xch, domid, HVM_PARAM_CMDLINE_PFN, cmdline_pfn); > } > > + if ( dom->ramdisk_blob ) > + { > + xen_pfn_t modlist_pfn = xc_dom_alloc_page(dom, "module list"); > + uint64_t *modlist = xc_map_foreign_range(xch, domid, PAGE_SIZE, > + PROT_READ | PROT_WRITE, > + modlist_pfn); > + if ( modlist == NULL ) { > + DOMPRINTF("Unable to map module list page"); > + goto error_out; > + } > + > + /* This is currently limited to only one module. */ > + modlist[0] = dom->ramdisk_seg.vstart - dom->parms.virt_base; > + modlist[1] = dom->ramdisk_seg.vend - dom->ramdisk_seg.vstart; > + modlist[2] = 0; > + modlist[3] = 0; > + munmap(modlist, PAGE_SIZE); > + xc_hvm_param_set(xch, domid, HVM_PARAM_MODLIST_PFN, modlist_pfn); > + } > + The code looks correct. Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx> _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |