From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59173) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN3EN-00052J-RO for qemu-devel@nongnu.org; Thu, 19 May 2011 09:25:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QN3EM-0005Pk-L8 for qemu-devel@nongnu.org; Thu, 19 May 2011 09:25:35 -0400 Received: from goliath.siemens.de ([192.35.17.28]:23552) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN3EM-0005PV-B9 for qemu-devel@nongnu.org; Thu, 19 May 2011 09:25:34 -0400 Message-ID: <4DD51A4A.9050902@siemens.com> Date: Thu, 19 May 2011 15:25:30 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <4DD3C5B9.1080908@redhat.com> <4DD3D236.90708@siemens.com> <4DD3D95E.2060105@redhat.com> <4DD3E1B3.3020405@siemens.com> <4DD3E610.1080201@siemens.com> <4DD4199E.2000702@codemonkey.ws> <4DD4B94C.3070700@web.de> <4DD519DE.90608@codemonkey.ws> In-Reply-To: <4DD519DE.90608@codemonkey.ws> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] Memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Peter Maydell , Avi Kivity , qemu-devel On 2011-05-19 15:23, Anthony Liguori wrote: > On 05/19/2011 01:31 AM, Jan Kiszka wrote: >> On 2011-05-18 21:10, Anthony Liguori wrote: >>> On 05/18/2011 10:30 AM, Jan Kiszka wrote: >>> static void i440fx_io_intercept(void *opaque, uint64_t addr, uint32_t >>> value, int size, MemRegion *next) >>> { >>> I440FX *s = opaque; >>> >>> if (range_overlaps(addr, size, PAM_REGION)) { >>> ... >>> } else { >>> dispatch_io(next, addr, value, size); >>> } >>> } >>> >>> There's no need for an explicit intercept mechanism if you make multiple >>> levels have their own dispatch tables and register progressively larger >>> regions. In fact.... >> >> Actually, things are a bit more complicated: This layer has to properly >> adopt the coalescing properties of underlying regions or we cause >> performance regressions to VGA emulation. That means it has to register >> dispatching slots of the corresponding size and set the coalescing flag >> accordingly. And it likely need to adjust them as the regions below >> change. > > As I mentioned in another thread, I don't think we want to "design" > coalescing into the API. Coalescing is something that breaks through > abstractions layers and is really just a hack. We depend on it for speed, and even if it's nothing to be found in real HW, we need to design it in as this example demonstrates. The pain of not doing it, specifically when we go for hierarchical management, will be much higher. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux