[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-arm] [PATCH] linux-user/arm/nwfpe: Check coprocessor number fo
From: |
Richard Henderson |
Subject: |
Re: [Qemu-arm] [PATCH] linux-user/arm/nwfpe: Check coprocessor number for FPA emulation |
Date: |
Wed, 29 Nov 2017 09:30:07 +0000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 11/28/2017 05:34 PM, Peter Maydell wrote:
> 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 <address@hidden>
> Signed-off-by: Peter Maydell <address@hidden>
> ---
> Tested with a chroot of arm debian lenny, which is the last one that
> still used the calling convention that mandated use of the old FPA11 FPU
> and thus needs nwfpe emulation.
> ---
> linux-user/arm/nwfpe/fpa11.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
Reviewed-by: Richard Henderson <address@hidden>
r~