qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] linux-user/mips: Low down switchable NaN2008 requirement
@ 2023-02-11 17:34 Jiaxun Yang
  2023-02-22 10:28 ` Jiaxun Yang
  2023-03-09 12:32 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 8+ messages in thread
From: Jiaxun Yang @ 2023-02-11 17:34 UTC (permalink / raw)
  To: qemu-devel; +Cc: philmd, laurent, Jiaxun Yang

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)



^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-03-21 16:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-11 17:34 [PATCH] linux-user/mips: Low down switchable NaN2008 requirement Jiaxun Yang
2023-02-22 10:28 ` Jiaxun Yang
2023-03-07 14:18   ` Laurent Vivier
2023-03-09 12:32 ` Philippe Mathieu-Daudé
2023-03-11 12:39   ` Jiaxun Yang
2023-03-15  8:18     ` Philippe Mathieu-Daudé
2023-03-21  9:23       ` Jiaxun Yang
2023-03-21 16:14         ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).