Skip to contentSkip to conversation

exec: check offset_within_address_space for register subpage

PATCH In review Hu Tao 2 participants 2 messages Aug 29, 2013 – Sep 3, 2013

lore
Share & tools
lore

Hu Tao

author
#0 lore raw

PATCH 1/1 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 offset_within_region.

Cc Paolo Bonzini <[email protected]>
Cc Richard Henderson <[email protected]>
Cc "Andreas Färber" <[email protected]>
Cc Peter Maydell <[email protected]>
Cc Blue Swirl <[email protected]>
---
 exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
exec.c +1 -1
index 3ca9381..f1f9151 100644
@@ -869,7 +869,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 {
Signature · 1 line
1.8.1.4
Reviewed-by on v1 1/1
#1 lore raw

Il 29/08/2013 12:21, Hu Tao ha scritto:

Quoted 20 lines

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

Cc Paolo Bonzini <[email protected]>
Cc Richard Henderson <[email protected]>
Cc "Andreas Färber" <[email protected]>
Cc Peter Maydell <[email protected]>
Cc Blue Swirl <[email protected]>
---
 exec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
exec.c +0 -0
index 3ca9381..f1f9151 100644

exec.c static void mem_add(MemoryListener *listener, MemoryRegionSection *section) · line 875

Quoted 8 lines
exec.c +1 -1
@@ -869,7 +869,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 {