On 25/08/2017 10:31, Alexey Kardashevskiy wrote: > > Interestingly, mem_add() from exec.c is called twice: > as as->dispatch_listener.region_add() and > as as->dispatch_listener.region_nop() - I did not understand > the trick but it does not work if I remove the .region_nop() hook. > How does it work? :)
Didn't note this. The hooks are: - region_add: a new MemoryRegionSection appeared compared to the previous FlatView - region_nop: a region that was in the previous FlatView stayed there - region_del: a MemoryRegionSection disappeared compared to the previous FlatView Because the AddressSpaceDispatch is rebuilt from scratch, it cares about both new (region_add) and existing (region_nop) regions. Paolo