From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58818) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN3Cg-00046V-0h for qemu-devel@nongnu.org; Thu, 19 May 2011 09:23:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QN3Cb-00059I-GK for qemu-devel@nongnu.org; Thu, 19 May 2011 09:23:49 -0400 Received: from mail-gx0-f173.google.com ([209.85.161.173]:51128) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN3Cb-000590-E5 for qemu-devel@nongnu.org; Thu, 19 May 2011 09:23:45 -0400 Received: by gxk26 with SMTP id 26so1037723gxk.4 for ; Thu, 19 May 2011 06:23:44 -0700 (PDT) Message-ID: <4DD519DE.90608@codemonkey.ws> Date: Thu, 19 May 2011 08:23:42 -0500 From: Anthony Liguori 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> In-Reply-To: <4DD4B94C.3070700@web.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] Memory API List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: Peter Maydell , Avi Kivity , qemu-devel 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. Regards, Anthony Liguori > IOW, I don't think we get away with that simple approach above but still > require to track mapping via a PhysMemClient. But we should be able to > avoid filtering by adding overlapping regions with higher prio. > > Jan >