From: HW42 Subject: PCI passthrough hotplugging with stubdom: create new mem mapping failed! Date: Mon, 19 Jun 2017 05:38:00 +0000 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1858678915600552563==" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: xen-devel@lists.xen.org Cc: =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= List-Id: xen-devel@lists.xenproject.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============1858678915600552563== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="enKCHUSijmCJpRcXwkJoEkBT0G7OQl5P4" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --enKCHUSijmCJpRcXwkJoEkBT0G7OQl5P4 Content-Type: multipart/mixed; boundary="WmqTr081ERnq3wnWknwNktPEvQ2cN0oVW"; protected-headers="v1" From: HW42 To: xen-devel@lists.xen.org Cc: =?UTF-8?Q?Marek_Marczykowski-G=c3=b3recki?= Message-ID: Subject: PCI passthrough hotplugging with stubdom: create new mem mapping failed! --WmqTr081ERnq3wnWknwNktPEvQ2cN0oVW Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi, I'm currently debugging why hotplugging pci devices doesn't work with the= linux based stubdom used in the next Qubes release (based on Anthony's and Eric's patches). When attaching a pci device to a running domain qemu in the stubdom throws the following error: [00:06.0] xen_pt_region_update: Error: create new mem mapping failed! (= err: 1) It seems that the problem is that do_pci_add first triggers the qemu device_add command (via xenstore or qmp) and then calls xc_domain_iomem_permission. So when qemu calls xc_domain_memory_mapping during the setup of the device it fails because the permissions aren't configured yet. When I just move the qemu device_add further down it indeed works. This problem does not appear when running qemu in dom0. Probably because dom0 has anyway permission to call xc_domain_memory_mapping. I don't understand why this is not a problem for minios based stubdoms. Maybe just timing? Does the above analysis sounds correct? (I'm not really familiar with this). If yes, where exactly should the qemu pci_add be moved? Thanks. --WmqTr081ERnq3wnWknwNktPEvQ2cN0oVW-- --enKCHUSijmCJpRcXwkJoEkBT0G7OQl5P4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEqieyzvOmi9FGaQcT5KzJJ4pkaBYFAllHY2IPHGh3NDJAaXBz dW1qLmRlAAoJEOSsySeKZGgWPvYQALwqKmK+WZdtY7NRaWTA755jV/cydaBAtt1W Y3qW5VwUKCWSu936gM63seHVEcDVCRRuu8z/e6gkL/QGkU4sXb3DTKE7v1aCrYvg yF9377J7H8MibD78UBuf6ul0O2n6F9qAgyEm0wfGRlilII4ohuoB1LvjL0U7gD8q +dL6blkI9lQBsHZjQ2X7fpNayft+3NpYDUj+vgT/rj2IE561OFYiHfA6ZYm7H752 f1qckRR2S1w+NqCSdcZi3lNhRwrFVXTW47l0sh57lDVJbIzP99DxMrSdQN3cKb3D 0fAhbRZGpko+QJ5bBTLGql9RykgB0S7pYGxSwXz7SUGlgee+6ef3YqTmi0DqGOFu 2+eV/pvbjB3CRH6SKPti7INWC8pSttcQDOIDKoTXzjJCvOnEnd+NdC4BTkmWb97B jeZOBWLPJc7fsj1RsaWCr5jnWoMLSzxc7RyN48CpHeFl3XvDrlhB9//pcPprAmuW nzYaeyKu+9dMix7AdWP13w+NAmO4cN4qnUpJxZ7FkhJvHgtqPHpYJ6u845X2YBBo Dd2pymjGl3GCvr08pNZ662kVnStgK2jBEIG8tG+Xi06tT5H4kgkfzL6AAizm1vSi 6ny+fKFltezOSY1nlzOd1XkVZzQ7Uc58gd9VRSkSqHYEE1RCNib3tD+YvM7IVXaj +h5Y3t1a =o1h0 -----END PGP SIGNATURE----- --enKCHUSijmCJpRcXwkJoEkBT0G7OQl5P4-- --===============1858678915600552563== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwczovL2xpc3RzLnhlbi5v cmcveGVuLWRldmVsCg== --===============1858678915600552563==--