mirror of
https://git.proxmox.com/git/qemu
synced 2025-08-15 04:09:44 +00:00
memory: fix RAM subpages in newly initialized pages
If the first subpage installed in a page is RAM, then we install it as
a full page, instead of a subpage. Fix by not special casing RAM.
The issue dates to commit db7b5426a4
, which introduced subpages.
Signed-off-by: Avi Kivity <avi@redhat.com>
This commit is contained in:
parent
d6f2ea22a0
commit
8636b9295b
8
exec.c
8
exec.c
@ -2660,13 +2660,12 @@ void cpu_register_physical_memory_log(MemoryRegionSection *section,
|
|||||||
*p = section_index;
|
*p = section_index;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
MemoryRegion *mr = section->mr;
|
|
||||||
p = phys_page_find_alloc(addr >> TARGET_PAGE_BITS, 1);
|
|
||||||
*p = section_index;
|
|
||||||
if (!(memory_region_is_ram(mr) || mr->rom_device)) {
|
|
||||||
target_phys_addr_t start_addr2, end_addr2;
|
target_phys_addr_t start_addr2, end_addr2;
|
||||||
int need_subpage = 0;
|
int need_subpage = 0;
|
||||||
|
|
||||||
|
p = phys_page_find_alloc(addr >> TARGET_PAGE_BITS, 1);
|
||||||
|
*p = section_index;
|
||||||
|
|
||||||
CHECK_SUBPAGE(addr, start_addr, start_addr2, end_addr,
|
CHECK_SUBPAGE(addr, start_addr, start_addr2, end_addr,
|
||||||
end_addr2, need_subpage);
|
end_addr2, need_subpage);
|
||||||
|
|
||||||
@ -2677,7 +2676,6 @@ void cpu_register_physical_memory_log(MemoryRegionSection *section,
|
|||||||
section_index);
|
section_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
addr += TARGET_PAGE_SIZE;
|
addr += TARGET_PAGE_SIZE;
|
||||||
} while (addr != end_addr);
|
} while (addr != end_addr);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user