Skip to content

Commit

Permalink
address_space_dispatch_clear remove subpage with higher priority
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippTakacs committed Oct 11, 2024
1 parent 9230df8 commit de2ae81
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions qemu/exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1395,6 +1395,7 @@ static subpage_t *subpage_init(struct uc_struct *uc, FlatView *fv, hwaddr base)
memory_region_init_io(fv->root->uc, &mmio->iomem, &subpage_ops, mmio,
TARGET_PAGE_SIZE);
mmio->iomem.subpage = true;
mmio->iomem.priority = uc->snapshot_level;
#if defined(DEBUG_SUBPAGE)
printf("%s: %p base " TARGET_FMT_plx " len %08x\n", __func__,
mmio, base, TARGET_PAGE_SIZE);
Expand Down Expand Up @@ -1457,6 +1458,15 @@ AddressSpaceDispatch *address_space_dispatch_new(struct uc_struct *uc, FlatView

void address_space_dispatch_clear(AddressSpaceDispatch *d)
{
MemoryRegionSection *section;
struct uc_struct *uc = d->uc;
while (d->map.sections_nb > 0) {
d->map.sections_nb--;
section = &d->map.sections[d->map.sections_nb];
if (section->mr->priority > uc->snapshot_level) {
phys_section_destroy(section->mr);
}
}
g_free(d->map.sections);
g_free(d->map.nodes);
g_free(d);
Expand Down

0 comments on commit de2ae81

Please sign in to comment.