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
