qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] linux-user/mips: Low down switchable NaN2008 requirement


From: Laurent Vivier
Subject: Re: [PATCH] linux-user/mips: Low down switchable NaN2008 requirement
Date: Tue, 7 Mar 2023 15:18:32 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0

Phil (or someone else that knows mips), could you review?

With one review I will apply to my linux-user branch.

Thanks,
Laurent

Le 22/02/2023 à 11:28, Jiaxun Yang a écrit :
Ping?

2023年2月11日 17:34,Jiaxun Yang <jiaxun.yang@flygoat.com> 写道:

Previously switchable NaN2008 requires fcsr31.nan2008 to be writable
for guest. However as per MIPS arch spec this bit can never be writable.
This cause NaN2008 ELF to be rejected by QEMU.

NaN2008 can be enabled on R2~R5 processors, just make it available
unconditionally.

Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
linux-user/mips/cpu_loop.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/linux-user/mips/cpu_loop.c b/linux-user/mips/cpu_loop.c
index d5c1c7941d..b5c2ca4a3e 100644
--- a/linux-user/mips/cpu_loop.c
+++ b/linux-user/mips/cpu_loop.c
@@ -301,8 +301,7 @@ void target_cpu_copy_regs(CPUArchState *env, struct 
target_pt_regs *regs)
     }
     if (((info->elf_flags & EF_MIPS_NAN2008) != 0) !=
         ((env->active_fpu.fcr31 & (1 << FCR31_NAN2008)) != 0)) {
-        if ((env->active_fpu.fcr31_rw_bitmask &
-              (1 << FCR31_NAN2008)) == 0) {
+        if (!(env->insn_flags & ISA_MIPS_R2)) {
             fprintf(stderr, "ELF binary's NaN mode not supported by CPU\n");
             exit(1);
         }
--
2.37.1 (Apple Git-137.1)







reply via email to

[Prev in Thread] Current Thread [Next in Thread]