Fix wrong offset used in split_region
This commit is contained in:
@ -985,7 +985,9 @@ static void uc_invalidate_tb(struct uc_struct *uc, uint64_t start_addr, size_t l
|
|||||||
{
|
{
|
||||||
tb_page_addr_t start, end;
|
tb_page_addr_t start, end;
|
||||||
|
|
||||||
// GVA to GPA (GPA -> HVA via page_find, HVA->HPA via host mmu)
|
// GVA to GPA
|
||||||
|
// (GPA -> HVA via memory_region_get_ram_addr(mr) + GPA + block->host,
|
||||||
|
// HVA->HPA via host mmu)
|
||||||
start = get_page_addr_code(uc->cpu->env_ptr, start_addr) & (target_ulong)(-1);
|
start = get_page_addr_code(uc->cpu->env_ptr, start_addr) & (target_ulong)(-1);
|
||||||
|
|
||||||
// For 32bit target.
|
// For 32bit target.
|
||||||
|
3
uc.c
3
uc.c
@ -1090,7 +1090,8 @@ static bool split_region(struct uc_struct *uc, MemoryRegion *mr,
|
|||||||
|
|
||||||
QLIST_FOREACH(block, &uc->ram_list.blocks, next)
|
QLIST_FOREACH(block, &uc->ram_list.blocks, next)
|
||||||
{
|
{
|
||||||
if (block->offset <= mr->addr &&
|
// block->offset is the offset within ram_addr_t, not GPA
|
||||||
|
if (block->mr->addr <= mr->addr &&
|
||||||
block->used_length >= (mr->end - mr->addr)) {
|
block->used_length >= (mr->end - mr->addr)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user