From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38700) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TO3UW-0002ee-23 for qemu-devel@nongnu.org; Tue, 16 Oct 2012 05:31:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TO3UM-0008OX-AW for qemu-devel@nongnu.org; Tue, 16 Oct 2012 05:31:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39707) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TO3UM-0008OE-0x for qemu-devel@nongnu.org; Tue, 16 Oct 2012 05:31:02 -0400 Message-ID: <507D292A.4080702@redhat.com> Date: Tue, 16 Oct 2012 11:30:18 +0200 From: Avi Kivity MIME-Version: 1.0 References: <1349962023-560-1-git-send-email-avi@redhat.com> <1350009361.20486.131.camel@pasglop> <507BE941.7000205@redhat.com> <1350330738.4678.4.camel@pasglop> In-Reply-To: <1350330738.4678.4.camel@pasglop> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC v1 0/7] IOMMU support List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Benjamin Herrenschmidt Cc: "Michael S. Tsirkin" , liu ping fan , qemu-devel@nongnu.org, Blue Swirl , Alex Williamson , Anthony Liguori , Paolo Bonzini On 10/15/2012 09:52 PM, Benjamin Herrenschmidt wrote: >> >> I do have an is_write parameter to translate, in fact I added it in >> order to implement the spapr iommu. Or do you mean something else? > > Hrm, sort of. "is_write" means you can only express RO vs RW. Two > parameter for read and write allow to express WO. The only difference is > going to be if something does one translate for several R and W. > > Not a huge deal, since mostly translate is used for atomic accesses so > one translate = one access... except with map. It's useful to > differenciate the map with 3 states: RO, WO, RW. address_space_rw() and address_space_map() can only by used for one direction at the time (the first due to its API, the second because of the need to bounce sometimes), so the current ->translate() signature is okay for that. We can consider dropping the is_write parameter and replacing it with permission bits in IOMMUTLBEntry, I think it's a little more elegant (but no real advantage unless we start caching IOMMUTLBEntries). -- error compiling committee.c: too many arguments to function