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

Re: [Xen-devel] [RFC PATCH 3/3] tools, libxl: handle the iomem parameter with the memory_mapping hcall



On dom, 2014-03-02 at 18:33 +0800, Julien Grall wrote:
> > diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> > index a604cd8..7da0778 100644
> > --- a/tools/libxl/libxl_create.c
> > +++ b/tools/libxl/libxl_create.c
> > @@ -1099,6 +1099,16 @@ static void domcreate_launch_dm(libxl__egc *egc, 
> > libxl__multidev *multidev,
> >                    "failed give dom%d access to iomem range 
> > %"PRIx64"-%"PRIx64,
> >                    domid, io->start, io->start + io->number - 1);
> >               ret = ERROR_FAIL;
> > +        } else {
> > +            ret = xc_domain_memory_mapping(CTX->xch, domid,
> > +                                           io->start, io->start,
> > +                                           io->number, 1);
> > +            if (ret < 0) {
> > +                LOGE(ERROR,
> > +                     "failed to map to dom%d iomem range 
> > %"PRIx64"-%"PRIx64,
> > +                     domid, io->start, io->start + io->number - 1);
> > +                ret = ERROR_FAIL;
> > +            }
> 
> This code is common on both x86 and ARM. On x86, we don't want to map
> the I/O mem region in the guest here. QEMU will do it later.
> 
Right. I took a quick look and, as you're saying, I found the call sites
of xc_domain_memory_mapping() in QEMU's code (in _pt_iomem_helper() ).
At the same time, I see QEMU being created as a device model in this
same function, below this hunk... But that does _not_ _always_ happen, I
think, does it?

In particular, what about PV guests for which libxl__need_xenpv_qemu()
returns 0? Who calls xc_domain_memory_mapping() on the specified iomem
region(s) for them?

I'm asking because libxl__need_xenpv_qemu() does not look like it's
considering num_iomem / num_irqs at all and, although I know ARM guests
are not 'full PV', we don't have QEMU there (yet) either... so I think
it's a similar situation.

Sorry if I'm missing something obvious, I'm not super familiar with this
code, and I guess Arianna can just try investigate this a bit further,
but if someone has any ideas... :-P

Thanks and Regards,
Dario

-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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