From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [RFC PATCH 3/3] tools, libxl: handle the iomem parameter with the memory_mapping hcall Date: Mon, 3 Mar 2014 12:19:06 +0100 Message-ID: <1393845546.4058.41.camel@Solace> References: <1393721365-22458-1-git-send-email-avanzini.arianna@gmail.com> <1393721365-22458-4-git-send-email-avanzini.arianna@gmail.com> <531308FD.8070007@linaro.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8214663841292704719==" Return-path: In-Reply-To: <531308FD.8070007@linaro.org> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Julien Grall Cc: paolo.valente@unimore.it, Ian Campbell , stefano.stabellini@eu.citrix.com, Ian Jackson , xen-devel@lists.xen.org, julien.grall@citrix.com, etrudeau@broadcom.com, Arianna Avanzini , viktor.kleinik@globallogic.com List-Id: xen-devel@lists.xenproject.org --===============8214663841292704719== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-p938SJfTPP77LI1w5REY" --=-p938SJfTPP77LI1w5REY Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 =3D ERROR_FAIL; > > + } else { > > + ret =3D 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"-%"P= RIx64, > > + domid, io->start, io->start + io->number - 1); > > + ret =3D ERROR_FAIL; > > + } >=20 > 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. >=20 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 --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-p938SJfTPP77LI1w5REY Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iEYEABECAAYFAlMUZSoACgkQk4XaBE3IOsRTLACeOz2eI0TKx7r0PnLFa1t71BRN LNsAoImZ6Q+9jO7cJBC9F838/PklRSiY =usr5 -----END PGP SIGNATURE----- --=-p938SJfTPP77LI1w5REY-- --===============8214663841292704719== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============8214663841292704719==--