From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:46863) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5u2o-0007qm-FL for qemu-devel@nongnu.org; Mon, 27 Aug 2012 03:47:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T5u2k-0005aB-DG for qemu-devel@nongnu.org; Mon, 27 Aug 2012 03:47:34 -0400 Received: from mout.web.de ([212.227.17.11]:56755) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T5u2k-0005Zx-31 for qemu-devel@nongnu.org; Mon, 27 Aug 2012 03:47:30 -0400 Message-ID: <503B260E.70607@web.de> Date: Mon, 27 Aug 2012 09:47:26 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <1345801763-24227-1-git-send-email-qemulist@gmail.com> <1345801763-24227-11-git-send-email-qemulist@gmail.com> <503792F1.4090109@redhat.com> <503B1B4B.6050108@redhat.com> In-Reply-To: <503B1B4B.6050108@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enig6093A3EF74F1B3D2B14AE210" Subject: Re: [Qemu-devel] [PATCH 10/10] qdev: fix create in place obj's life cycle problem List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Avi Kivity , Liu Ping Fan , liu ping fan , Anthony Liguori , qemu-devel@nongnu.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig6093A3EF74F1B3D2B14AE210 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2012-08-27 09:01, Paolo Bonzini wrote: > Il 25/08/2012 09:42, liu ping fan ha scritto: >>>> >>>> I don't see why MMIO dispatch should hold the IDEBus ref rather than= the >>>> PCIIDEState. >>>> >> When transfer memory_region_init_io() 3rd para from void* opaque to >> Object* obj, the obj : opaque is not neccessary 1:1 map. For such >> situation, in order to let MemoryRegionOps tell between them, we >> should pass PCIIDEState->bus[0], bus[1] separately. >=20 > The rule should be that the obj is the object that you want referenced,= > and that should be the PCIIDEState. >=20 > But this is anyway moot because it only applies to objects that are > converted to use unlocked dispatch. This likely will not be the case > for IDE. BTW, I'm pretty sure - after implementing the basics for BQL-free PIO dispatching - that device objects are the wrong target for reference counting. We keep memory regions in our dispatching tables (PIO dispatching needs some refactoring for this), and those regions need protection for BQL-free use. Devices can't pass away as long as the have referenced regions, memory region deregistration services will have to take care of this. I'm currently not using reference counting at all, I'm enforcing that only BQL-protected regions can be deregistered. Also note that there seems to be another misconception in the discussions: deregistration is not only bound to device unplug. It also happens on device reconfiguration, e.g. PCI BAR (re-)mapping. Another strong indicator that we should worry about individual memory regions, not devices. Jan --------------enig6093A3EF74F1B3D2B14AE210 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://www.enigmail.net/ iEYEARECAAYFAlA7Jg4ACgkQitSsb3rl5xTrUQCgt6+FCdoQdUMLR+rLplh+d575 Sa8AoOGjsq1f9KHPbMFgBPtxlIOiW0LN =cEkB -----END PGP SIGNATURE----- --------------enig6093A3EF74F1B3D2B14AE210--