This patchset introduces memory_region_set_enabled() and memory_region_set_address() to avoid the requirement on memory routers to track the internal state of the memory API (so they know whether they need to add or remove a region). Instead, they can simply copy the state of the region from the guest-exposed register to the memory core, via the new mutator functions.
Please review. Do we need a memory_region_set_size() as well? Do we want memory_region_set_attributes(mr, MR_ATTR_ENABLED | MR_ATTR_SIZE, (MemoryRegionAttributes) { .enabled = s->enabled, .address = s->addr, }); ? Avi Kivity (3): memory: introduce memory_region_set_enabled() memory: introduce memory_region_set_address() memory: optimize empty transactions due to mutators memory.c | 64 ++++++++++++++++++++++++++++++++++++++++++++++++++++--------- memory.h | 28 +++++++++++++++++++++++++++ 2 files changed, 82 insertions(+), 10 deletions(-) -- 1.7.6.3