Skip to content

Commit 0f4ccbc

Browse files
daviddaneyralfbaechle
authored andcommitted
MIPS: No branches in delay slots for huge pages in handle_tlbl
For the case PM_DEFAULT_MASK == 0, we were placing a branch in the delay slot of another branch. This leads to undefined behavior. Signed-off-by: David Daney <david.daney@cavium.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/2775/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
1 parent d968275 commit 0f4ccbc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎arch/mips/mm/tlbex.c‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1962,7 +1962,8 @@ static void __cpuinit build_r4000_tlb_load_handler(void)
19621962
uasm_i_andi(&p, wr.r3, wr.r3, 2);
19631963
uasm_il_beqz(&p, &r, wr.r3, label_tlbl_goaround2);
19641964
}
1965-
1965+
if (PM_DEFAULT_MASK == 0)
1966+
uasm_i_nop(&p);
19661967
/*
19671968
* We clobbered C0_PAGEMASK, restore it. On the other branch
19681969
* it is restored in build_huge_tlb_write_entry.

0 commit comments

Comments
 (0)