fix: Use correct addresses during memory cow

This commit is contained in:
Mark Giraud 2023-08-23 10:18:42 +02:00
parent da47173d8a
commit e189e1fb8b
No known key found for this signature in database
GPG Key ID: 1C0A1EDE9B8335F4

View File

@ -2156,7 +2156,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,
}
if (uc->snapshot_level && mr->ram && mr->priority < uc->snapshot_level) {
mr = memory_cow(uc, mr, addr & TARGET_PAGE_MASK, TARGET_PAGE_SIZE);
mr = memory_cow(uc, mr, paddr & TARGET_PAGE_MASK, TARGET_PAGE_SIZE);
if (!mr) {
uc->invalid_addr = paddr;
uc->invalid_error = UC_ERR_NOMEM;
@ -2164,7 +2164,7 @@ store_helper(CPUArchState *env, target_ulong addr, uint64_t val,
return;
}
/* refill tlb after CoW */
tlb_fill(env_cpu(env), paddr, size, MMU_DATA_STORE,
tlb_fill(env_cpu(env), addr, size, MMU_DATA_STORE,
mmu_idx, retaddr);
index = tlb_index(env, mmu_idx, addr);
entry = tlb_entry(env, mmu_idx, addr);