From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= Subject: Re: PCI passthrough for HVM with stubdomain broken by "tools/libxl: handle the iomem parameter with the memory_mapping hcall" Date: Wed, 22 Jun 2016 16:13:14 +0200 Message-ID: <20160622141314.GD1593@mail-itl> References: <20160622130335.GA410@mail-itl> <576AB3B102000078000F7B53@prv-mh.provo.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6501840591213666337==" Return-path: In-Reply-To: <576AB3B102000078000F7B53@prv-mh.provo.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Jan Beulich Cc: dgdegra@tycho.nsa.gov, xen-devel List-Id: xen-devel@lists.xenproject.org --===============6501840591213666337== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4eTFwF/zYFyPfRP5" Content-Disposition: inline --4eTFwF/zYFyPfRP5 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jun 22, 2016 at 07:50:09AM -0600, Jan Beulich wrote: > >>> On 22.06.16 at 15:03, wrote: > > I've finally found what was causing long standing issue of not working > > PCI passthrough for HVM domains with qemu in stubdomain (only - without > > the other one in dom0). It looks to be this patch: > > http://xenbits.xen.org/gitweb/?p=3Dxen.git;a=3Dcommitdiff;h=3Dc428c9f16= 2895cb3473f=20 > > ab26d23ffbf41a6f293d;hp=3Ddcccaf806a92eabb95929a67c344ac1e9ead6257 > >=20 > > It calls xc_domain_getinfo from xc_domain_memory_mapping (to check if > > the target domain is auto-translated), but xc_domain_getinfo fails with > > EPERM in stubdomain. > >=20 > > What would be the best solution for this? Allowing xc_domain_getinfo > > from stubdomain in xen/include/xsm/dummy.h? Currently it is uses policy > > XSM_XS_PRIV in unstable and just XSM_PRIV in 4.6 - so, maybe have some > > combination of XSM_XS_PRIV and XSM_DM_PRIV? Or maybe fix this by > > removing xc_domain_getinfo call in xc_domain_memory_mapping, possibly > > implementing the logic from that commit solely in libxl? >=20 > Once we fixed the quirky behavior of the current implementation > (allowing information to be returned for other than the requested > domain), I see no reason why this couldn't become XSM_DM_PRIV. Can you explain this more? Is this fix backported to 4.6 and/or 4.4? > But let's ask Daniel explicitly. And in that context I then also wonder > whether the xsm_getdomaininfo() invocation shouldn't be limited to > the respective sysctl. Actually getdomaininfo is handled in two places in xsm/dummy.h: - xsm_getdomaininfo (which does nothing when XSM is disabled) - xsm_domctl (which enforce actual policy) Also reading commit message of XSM_XS_PRIV introduction, it may be useful to be able to just check if given domain is alive, without getting all the information returned by XEN_DOMCTL_getdomaininfo. I find this useful also for any other inter-domain communication (for example libxenvchan connection). But for now, XEN_DOMCTL_getdomaininfo should be allowed either when device-model domain is asking about its target domain, or calling domain is xenstore domain/privileged domain. Right? How to combine those types? Change XSM_XS_PRIV to XSM_XS_DM_PRIV (it looks like the only usage of XSM_XS_PRIV)? --=20 Best Regards, Marek Marczykowski-G=C3=B3recki Invisible Things Lab A: Because it messes up the order in which people normally read text. Q: Why is top-posting such a bad thing? --4eTFwF/zYFyPfRP5 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJXapz7AAoJENuP0xzK19csFmMH/05zyz4FMiU05o35qZoJaQO+ uS4zJN9wsLBYrfWoe3RLvb9q2DJCx+R/UWINpiCddp8ADo2wWF3I28GoMxNPSeZF pmtBrbk6AH+qbAqWM+62aCh/rf4B7EcdIP/pFU8WlUxdBeNj1/Os2qR8hrzCmQSk RQixNlD6qZouys6Bc7Mo+1ooUD7KqBdeVXrp4r0q28BumZ0pzdMz7U+6dU40b8Kk aYAU96rGgojuWHKH15LjnpdGin4W4FCyMrP8PBfnPNSmInzHenUGObmRTa28yLof /GwWEwMQ/hUBTVCCYLlxozoOK7gYX/NLxs6CdZXSMzp7BFi3+du/a/SuiFhvS7c= =YKip -----END PGP SIGNATURE----- --4eTFwF/zYFyPfRP5-- --===============6501840591213666337== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============6501840591213666337==--