From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LOvgu-0002Oy-4C for qemu-devel@nongnu.org; Mon, 19 Jan 2009 10:05:28 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LOvgt-0002OZ-JH for qemu-devel@nongnu.org; Mon, 19 Jan 2009 10:05:27 -0500 Received: from [199.232.76.173] (port=33482 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LOvgt-0002OQ-DO for qemu-devel@nongnu.org; Mon, 19 Jan 2009 10:05:27 -0500 Received: from mx2.redhat.com ([66.187.237.31]:33074) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LOvgs-0001q7-RG for qemu-devel@nongnu.org; Mon, 19 Jan 2009 10:05:27 -0500 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id n0JF5PhZ012401 for ; Mon, 19 Jan 2009 10:05:25 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id n0JF5PEP025330 for ; Mon, 19 Jan 2009 10:05:25 -0500 Received: from zweiblum.travel.kraxel.org (vpn-10-79.str.redhat.com [10.32.10.79]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n0JF5OPi030217 for ; Mon, 19 Jan 2009 10:05:25 -0500 Message-ID: <497496B2.8020107@redhat.com> Date: Mon, 19 Jan 2009 16:05:22 +0100 From: Gerd Hoffmann MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/5] Add target memory mapping API References: <1232308399-21679-1-git-send-email-avi@redhat.com> <1232308399-21679-2-git-send-email-avi@redhat.com> <18804.34053.211615.181730@mariner.uk.xensource.com> In-Reply-To: <18804.34053.211615.181730@mariner.uk.xensource.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Ian Jackson wrote: > The interface when cpu_physical_memory_map returns 0 is strange. > Normally everything in qemu is done with completion callbacks, but > here we have a kind of repeated polling. Check patch #2 ;) > typedef struct { > /* to be filled in by caller before calling _map: */ > unsigned flags; > target_phys_addr_t addr, len; /* len is updated by _map */ > /* filled in by _map: */ > void *buffer; > /* private to _map et al: */ > } CpuPhysicalMemoryMapping; > > void cpu_physical_memory_map(CpuPhysicalMemoryMapping*; > CpuPhysicalMemoryMapCallback *cb, void *cb_arg); > /* There may be a limit on the number of concurrent maps > * and the limit may be as low as one. */ Hmm, I'd like to see grant tables fit into this picture too. Using flags (instead of is_write) for map requests we can handle that too I think. We need a flag indicating we are passing a grant handle not a guest address, then we can stick the handle into addr (or make that a union). cheers, Gerd