Commit 88266249 authored by Hu Tao's avatar Hu Tao Committed by Paolo Bonzini
Browse files

exec: check offset_within_address_space for register subpage

If offset_within_address_space falls in a page, then we register a
subpage. So check offset_within_address_space rather than

Cc: Paolo Bonzini <>
Cc: Richard Henderson <>
Cc: "Andreas Färber" <>
Cc: Peter Maydell <>
Cc: Blue Swirl <>
Signed-off-by: default avatarHu Tao <>
Signed-off-by: default avatarPaolo Bonzini <>
parent 098178f2
......@@ -854,7 +854,7 @@ static void mem_add(MemoryListener *listener, MemoryRegionSection *section)
now = remain;
if (int128_lt(remain.size, page_size)) {
register_subpage(d, &now);
} else if (remain.offset_within_region & ~TARGET_PAGE_MASK) {
} else if (remain.offset_within_address_space & ~TARGET_PAGE_MASK) {
now.size = page_size;
register_subpage(d, &now);
} else {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment