On 12 January 2015 at 23:18, Peter Fillmore <pe...@peterfillmore.com> wrote: > The setup code is <edited for brevity>: > MemoryRegion *sysmem = get_system_memory(); > MemoryRegion *iap = g_new(MemoryRegion, 1); > //create pointer for region > memory_region_init_ram(iap, NULL, "vivotech.iap", > 0x1000,&error_abort); //init 0x1000 bytes of ram > vmstate_register_ram_global(iap); > //register with qemu > memory_region_add_subregion(sysmem, 0x7FFFFFF0, iap); > //add to the sysmem
I'm confused; this doesn't look wrong, but it also doesn't seem to have anything at all to do with the code fragment you quoted in your previous email as being how you set up the memory. Also is it really 0x1000 bytes starting at 0x7ffffff0 ?? That sounds very weird -- usually memory is at some aligned address. In fact I think this is the problem: we require the whole page of the address space to be RAM to be able to execute out of it. We can't deal with executing from pages which are split between RAM and something else like the setup you have here. (Reading or writing from that sort of mixed-usage page is fine; it's just executing code that won't work.) -- PMM