You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two questions regarding mapped memory handling:
I see there is a database uc_engine->mapped_blocks that contains all user mapped memory (not mmio), specified by uc_mem_map_ptr. This is seemingly used only for checking for memory overlap when mapping new blocks. For converting physical address to MemoryRegion, however, uc->memory_mapping() is used that performs a much more complicated lookup to get the corresponfing mr.
Why is that? These are all physicial memory blocks, they do not change after mapping(?). What am I missing?
Can I use the mapped_blocks only (or similar uplevel structure) to convert a physical address to a memory region (in case I have no mmio)?
Injecting data to physical memory: user is supposed to write guest memory via uc_mem_write(). This finds the memory regions affected and performs the actual write. In cases when it is known that a target area is inside a given mr and the host memory is allocated by the user, may the user write guest memory via simple write to the allocated blob (e.g. from a hook), like a DMA would?
If not, what else shall be done after such a memory write to make emulator states consistent?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have two questions regarding mapped memory handling:
I see there is a database uc_engine->mapped_blocks that contains all user mapped memory (not mmio), specified by uc_mem_map_ptr. This is seemingly used only for checking for memory overlap when mapping new blocks. For converting physical address to MemoryRegion, however, uc->memory_mapping() is used that performs a much more complicated lookup to get the corresponfing mr.
Why is that? These are all physicial memory blocks, they do not change after mapping(?). What am I missing?
Can I use the mapped_blocks only (or similar uplevel structure) to convert a physical address to a memory region (in case I have no mmio)?
Injecting data to physical memory: user is supposed to write guest memory via uc_mem_write(). This finds the memory regions affected and performs the actual write. In cases when it is known that a target area is inside a given mr and the host memory is allocated by the user, may the user write guest memory via simple write to the allocated blob (e.g. from a hook), like a DMA would?
If not, what else shall be done after such a memory write to make emulator states consistent?
Thanks,
Viktor
Beta Was this translation helpful? Give feedback.
All reactions