From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek =?utf-8?Q?Marczykowski-G=C3=B3recki?= Subject: Re: PCI passthrough with stubdomain Date: Fri, 23 Sep 2016 20:56:43 +0200 Message-ID: <20160923185643.GD31510@mail-itl> References: <20160923084814.GS7339@mail-itl> <20160923132707.GH20069@var.bordeaux.inria.fr> <20160923142541.GB31510@mail-itl> <20160923145133.GM4441@var.bordeaux.inria.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0777255181216142271==" Return-path: In-Reply-To: <20160923145133.GM4441@var.bordeaux.inria.fr> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Samuel Thibault , xen-devel , HW42 List-Id: xen-devel@lists.xenproject.org --===============0777255181216142271== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="3UykYV/sQxZDUdLk" Content-Disposition: inline --3UykYV/sQxZDUdLk Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 23, 2016 at 04:51:33PM +0200, Samuel Thibault wrote: > Marek Marczykowski-G=C3=B3recki, on Fri 23 Sep 2016 16:25:41 +0200, wrote: > > Toolstack during (stub)domain startup setup two things, mostly > > asynchronously: > > 1. pciback/pcifront (through standard xenstore entries) > > 2. instruct qemu to attach device (by writing "pci-ins" to > > device-model/xxx/command) >=20 > Ah, since pcifront_watches runs in a separate thread, it may not have > called init_pcifront before qemu calls libpci, i.e. pcifront_scan. Yes, exactly. > I'd say that's where the fix should be: make pcifront_scan wait for > init_pcifront to be done. It's however not so simple: we want to make > pcifront_scan do nothing if no pciback is to be launched. My memory is > rusty: is there something we are sure will show up in the xenstore when > a pciback is to be launched? If so, pcifront_scan could do this: wait > for pcifront_watches to have checked for the potential presence of > pciback. If pciback is not to be started, just do nothing; if pciback is > to be started, wait for init_pcifront to have been called by > pcifront_watches. Then it will find the devices. Ok. So, two questions: 1. How to do this? ;) I.e. what synchronization primitives are available in mini-os? Just pthread_mutex_lock/unlock? 2. Wouldn't the same problem be with other stubdomain implementations? Like Linux + qemu-xen or rumprun + qemu-xen? At least in Linux case pcifront driver will also needs some time for initialization... --=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? --3UykYV/sQxZDUdLk Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJX5XrrAAoJENuP0xzK19csHZEH/1J97voQ/KWq6tixNRMgfOqa iECddGrw3YWCdcowh++hapWhCWEbqW1laZRAh2YVD0S6F7TTeM1cKtRykOz/K/FU BlXALnaA5vvgpHDxnIPRWKEUtKwXiaTtUI8h913ihpBNDNRW1jXGGrEy9GYrG9fw HS9tfAG69B4udEEwR58GCL3xOUCsjTZiHtb9dO/yqUh9kMyx3FyJc1CSNv3TV74z GMDVZraVQqZQxoqTaxkiXb0ikyLatRzeiz4ay0rfuoeghFcFSDcVcpUYZNwNm16Q 3W8NVGcKeX0a9FHQ0FzcFmJPobUl6ljM/bdDP1f6aH+8Dr2UOBOG9c69S0frlgo= =+Ece -----END PGP SIGNATURE----- --3UykYV/sQxZDUdLk-- --===============0777255181216142271== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============0777255181216142271==--