On Mon, Mar 13, 2017 at 04:36:35PM +0100, Aleksandar Markovic wrote: > From: Leonid Yegoshin <Leonid.Yegoshin@xxxxxxxxxx> > > Fix the problem of inaccurate identification of instructions BLEZL and > BGTZL in R2 emulation code by making sure all necessary encoding > specifications are met. > > Previously, certain R6 instructions could be identified as BLEZL or > BGTZL. R2 emulation routine didn't take into account that both BLEZL > and BGTZL instructions require their rt field (bits 20 to 16 of > instruction encoding) to be 0, and that, at same time, if the value in > that field is not 0, the encoding may represent a legitimate MIPS R6 > instruction. > > This means that a problem could occur after emulation optimization, > when emulation routine tried to pipeline emulation, picked up a next > candidate, and subsequently misrecognized an R6 instruction as BLEZL > or BGTZL. > > It should be said that for single pass strategy, the problem does not > happen because CPU doesn't trap on branch-compacts which share opcode > space with BLEZL/BGTZL (but have rt field != 0, of course). > > Signed-off-by: Leonid Yegoshin <leonid.yegoshin@xxxxxxxxxx> > Signed-off-by: Miodrag Dinic <miodrag.dinic@xxxxxxxxxxx> > Signed-off-by: Aleksandar Markovic <aleksandar.markovic@xxxxxxxxxxx> > Reported-by: Douglas Leung <douglas.leung@xxxxxxxxxx> > Reviewed-by: Paul Burton <paul.burton@xxxxxxxxxx> Thanks for sorting out the review comments on v1. Applied, Ralf