From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52849) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT7IJ-00079Q-8t for qemu-devel@nongnu.org; Tue, 30 Oct 2012 04:35:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TT7IE-0001gd-MP for qemu-devel@nongnu.org; Tue, 30 Oct 2012 04:35:31 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:55910) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TT7IE-0001gX-EG for qemu-devel@nongnu.org; Tue, 30 Oct 2012 04:35:26 -0400 Received: by mail-lb0-f173.google.com with SMTP id gj3so21711lbb.4 for ; Tue, 30 Oct 2012 01:35:25 -0700 (PDT) Date: Tue, 30 Oct 2012 09:35:20 +0100 From: "Edgar E. Iglesias" Message-ID: <20121030083519.GA25405@edde.se.axis.com> References: <20121027041159.GA20153@zapo> <508EB01D.5010608@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <508EB01D.5010608@redhat.com> Subject: Re: [Qemu-devel] [RFC] Memory API and fine grained Memory Regions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: Peter Maydell , John Williams , John Williams , "qemu-devel@nongnu.org Developers" , Peter Crosthwaite On Mon, Oct 29, 2012 at 06:34:37PM +0200, Avi Kivity wrote: > On 10/29/2012 01:37 AM, John Williams wrote: > > >> IMO, an mr per reg would just add a massive overhead for no win. > > > > I tend to agree with Edgar here - QEMU has a careful line to walk between being an emulator and an RTL simulator. > > > > Any WAG on the runtime overhead of a mem region per register vs a switch-based decodes in read/write handlers? > > > > Actually a region-per-register can be faster, since the subpage logic > will dispatch the access directly to the handler, instead of going first > to the device handler, then following the switch. I understood the suggestion as if you would need to allocate a MemoryRegion per reg. That sounds to me like a massive overhead. Many of these regs hold pure configuration state and have no side effects. Some devices map huge amount of address space and use bits in the addresses to decide the effect of the access. At minimum you'd have to allow for old style decoding without forcing the device to put a function pointer to the same func for every address. But as long as it is optional and it doesn't slow things down, I agree that some device models will benefit. Cheers, Edgar