Skip to content

Commit 7ee9552

Browse files
Anton JohanssonMichael Tokarev
authored andcommitted
accel/tcg: Fix typo causing tb->page_addr[1] to not be recorded
For TBs crossing page boundaries, the 2nd page will never be recorded/removed, as the index of the 2nd page is computed from the address of the 1st page. This is due to a typo, fix it. Cc: [email protected] Fixes: deba787 ("accel/tcg: Always lock pages before translation") Signed-off-by: Anton Johansson <[email protected]> Reviewed-by: Manos Pitsidianakis <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]> Reviewed-by: Alex Bennée <[email protected]> Message-Id: <[email protected]> Signed-off-by: Richard Henderson <[email protected]> (cherry picked from commit 3b279f7) Signed-off-by: Michael Tokarev <[email protected]>
1 parent 37f037c commit 7ee9552

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

accel/tcg/tb-maint.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,7 @@ static void tb_record(TranslationBlock *tb)
712712
tb_page_addr_t paddr0 = tb_page_addr0(tb);
713713
tb_page_addr_t paddr1 = tb_page_addr1(tb);
714714
tb_page_addr_t pindex0 = paddr0 >> TARGET_PAGE_BITS;
715-
tb_page_addr_t pindex1 = paddr0 >> TARGET_PAGE_BITS;
715+
tb_page_addr_t pindex1 = paddr1 >> TARGET_PAGE_BITS;
716716

717717
assert(paddr0 != -1);
718718
if (unlikely(paddr1 != -1) && pindex0 != pindex1) {
@@ -744,7 +744,7 @@ static void tb_remove(TranslationBlock *tb)
744744
tb_page_addr_t paddr0 = tb_page_addr0(tb);
745745
tb_page_addr_t paddr1 = tb_page_addr1(tb);
746746
tb_page_addr_t pindex0 = paddr0 >> TARGET_PAGE_BITS;
747-
tb_page_addr_t pindex1 = paddr0 >> TARGET_PAGE_BITS;
747+
tb_page_addr_t pindex1 = paddr1 >> TARGET_PAGE_BITS;
748748

749749
assert(paddr0 != -1);
750750
if (unlikely(paddr1 != -1) && pindex0 != pindex1) {

0 commit comments

Comments
 (0)