linux-user/arm/nwfpe: Check coprocessor number for FPA emulation
commit579648554acbd6c22d5cc2f03cf77cfc25332650
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 11 Jan 2018 13:25:39 +0000 (11 13:25 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 11 Jan 2018 13:25:39 +0000 (11 13:25 +0000)
tree23de5ddf4d6a0e3171b6cb8a167f5b7061fa6355
parent487b406af1164dc036c70126f53a20c4c395db92
linux-user/arm/nwfpe: Check coprocessor number for FPA emulation

Our copy of the nwfpe code for emulating of the old FPA11 floating
point unit doesn't check the coprocessor number in the instruction
when it emulates it.  This means that we might treat some
instructions which should really UNDEF as being FPA11 instructions by
accident.

The kernel's copy of the nwfpe code doesn't make this error; I suspect
the bug was noticed and fixed as part of the process of mainlining
the nwfpe code more than a decade ago.

Add a check that the coprocessor number (which is always in bits
[11:8] of the instruction) is either 1 or 2, which is where the
FPA11 lives.

Reported-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
linux-user/arm/nwfpe/fpa11.c