From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZfR8d-0005g5-Id for qemu-devel@nongnu.org; Fri, 25 Sep 2015 07:26:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZfR8c-0005os-OU for qemu-devel@nongnu.org; Fri, 25 Sep 2015 07:26:03 -0400 References: <1443069231-14856-1-git-send-email-david@gibson.dropbear.id.au> <1443069231-14856-6-git-send-email-david@gibson.dropbear.id.au> <1443115949.23936.569.camel@redhat.com> <20150925052434.GD11620@voom.redhat.com> From: Paolo Bonzini Message-ID: <56052F43.8030108@redhat.com> Date: Fri, 25 Sep 2015 13:25:55 +0200 MIME-Version: 1.0 In-Reply-To: <20150925052434.GD11620@voom.redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 5/7] memory: Allow replay of IOMMU mapping notifications List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: David Gibson , Alex Williamson Cc: lvivier@redhat.com, thuth@redhat.com, qemu-ppc@nongnu.org, abologna@redhat.com, qemu-devel@nongnu.org -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256 On 25/09/2015 07:24, David Gibson wrote: >> When memory_listener_register() replays mappings, it does so on >> an rcu copy of the flatview for each AddressSpace. Here we >> don't seem to have anything protecting against concurrency... do >> we need to worry about that? > > I was assuming that the IOMMU mappings are protected by the BQL. I > _think_ that's the case (for every IOMMU we have so far), but I'm > not really sure how to be sure. Yes, even in listener_add_address_space there's no real need to use address_space_get_flatview because updates to both the memory maps and the MemoryListener list are protected by the BQL. It could just read as->current_map directly. listener_add_address_space plays it a bit safe because QEMU doesn't (yet?) have stuff like rcu_dereference_check. It's sad that we'll have to reinvent so much debugging stuff from Linux... Paolo -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJWBS9AAAoJEL/70l94x66D5l0H/AxF9flRUf6PaNO6RLpd0N8y z17BXqKuGIIevkGtF66xCRNDTRgfHKlugKkSQjaQIlGlh2k/nKfozcFERiE6/unv QmUS3+c3ryLMhOC4VidU90Krq1ZsXLLNE1Z81aSQwD4Y0LXEp3hFuL1F/K6tDUtY Vzk2KJu/bEaeDhJa4UglBOBLGWIYNRvokIFc2TdoMjdBvKfygLHfjL3rroQOle4U 40/mBO+3J58cyfCBYha0U9DxVTvceaFubj3M72W3ajenXZ15lq75B0M9GCNNujHE oaP8ehQ5wByyiGGmcZkStEXU/ups7J6cMWWjpTak3PqO0O5DVo+j5P4QbvJE57Q= =gQRk -----END PGP SIGNATURE-----