Merge pull request #28 from rmalmain/main
Fix wrong dirty address tracking for MMIO accesses. Assert is only triggered for debug builds.
This commit is contained in:
commit
16c921c8e6
@ -1830,7 +1830,8 @@ static bool mmu_lookup(CPUState *cpu, vaddr addr, MemOpIdx oi,
|
|||||||
|
|
||||||
//// --- Begin LibAFL code ---
|
//// --- Begin LibAFL code ---
|
||||||
|
|
||||||
if (type == MMU_DATA_STORE) {
|
// TODO: check if the second condition solves faulty dirty address report
|
||||||
|
if (type == MMU_DATA_STORE && !(flags & (TLB_INVALID_MASK | TLB_MMIO))) {
|
||||||
syx_snapshot_dirty_list_add_hostaddr(l->page[0].haddr);
|
syx_snapshot_dirty_list_add_hostaddr(l->page[0].haddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -393,7 +393,13 @@ void syx_snapshot_dirty_list_add_hostaddr(void* host_addr) {
|
|||||||
ram_addr_t offset;
|
ram_addr_t offset;
|
||||||
RAMBlock* rb = qemu_ram_block_from_host((void*) host_addr, true, &offset);
|
RAMBlock* rb = qemu_ram_block_from_host((void*) host_addr, true, &offset);
|
||||||
|
|
||||||
|
#ifdef CONFIG_DEBUG_TCG
|
||||||
assert(rb);
|
assert(rb);
|
||||||
|
#else
|
||||||
|
if (!rb) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
hwaddr paddr = rb->mr->addr + offset;
|
hwaddr paddr = rb->mr->addr + offset;
|
||||||
// If this assert is ever false, please understand why
|
// If this assert is ever false, please understand why
|
||||||
|
Loading…
x
Reference in New Issue
Block a user