[PATCH-for-8.0] linux-user/mips: Use P5600 as default CPU to run NaN2008 ELF binaries

Philippe Mathieu-Daudé posted 1 patch 1 year ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20230327162444.388-1-philmd@linaro.org
Maintainers: Laurent Vivier <laurent@vivier.eu>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>
linux-user/mips/target_elf.h | 3 +++
1 file changed, 3 insertions(+)
[PATCH-for-8.0] linux-user/mips: Use P5600 as default CPU to run NaN2008 ELF binaries
Posted by Philippe Mathieu-Daudé 1 year ago
Per the release 6.06 revision history:

 5.03 August 21, 2013

 • ABS2008 and NAN2008 fields of Table 5.7 “FCSR RegisterField
   Descriptions” were optional in release 3 and could be R/W,
   but as of release 5 are required, read-only, and preset by
   hardware.

The P5600 core implements the release 5, and has the ABS2008
and NAN2008 bits set in CP1_fcr31. Therefore it is able to run
ELF binaries compiled with EF_MIPS_NAN2008, such the CIP United
Debian NaN2008 distribution:
http://repo.oss.cipunited.com/mipsel-nan2008/README.txt

In order to run such compiled binaries, select by default the
P5600 core when the ELF 'MIPS_NAN2008' flag is set.

Reported-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 linux-user/mips/target_elf.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/linux-user/mips/target_elf.h b/linux-user/mips/target_elf.h
index a98c9bd6ad..b965e86b2b 100644
--- a/linux-user/mips/target_elf.h
+++ b/linux-user/mips/target_elf.h
@@ -15,6 +15,9 @@ static inline const char *cpu_get_model(uint32_t eflags)
     if ((eflags & EF_MIPS_MACH) == EF_MIPS_MACH_5900) {
         return "R5900";
     }
+    if (eflags & EF_MIPS_NAN2008) {
+        return "P5600";
+    }
     return "24Kf";
 }
 #endif
-- 
2.38.1


Re: [PATCH-for-8.0] linux-user/mips: Use P5600 as default CPU to run NaN2008 ELF binaries
Posted by Philippe Mathieu-Daudé 12 months ago
On 27/3/23 18:24, Philippe Mathieu-Daudé wrote:
> Per the release 6.06 revision history:
> 
>   5.03 August 21, 2013
> 
>   • ABS2008 and NAN2008 fields of Table 5.7 “FCSR RegisterField
>     Descriptions” were optional in release 3 and could be R/W,
>     but as of release 5 are required, read-only, and preset by
>     hardware.
> 
> The P5600 core implements the release 5, and has the ABS2008
> and NAN2008 bits set in CP1_fcr31. Therefore it is able to run
> ELF binaries compiled with EF_MIPS_NAN2008, such the CIP United
> Debian NaN2008 distribution:
> http://repo.oss.cipunited.com/mipsel-nan2008/README.txt
> 
> In order to run such compiled binaries, select by default the
> P5600 core when the ELF 'MIPS_NAN2008' flag is set.
> 
> Reported-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   linux-user/mips/target_elf.h | 3 +++
>   1 file changed, 3 insertions(+)

Patch queued.


Re: [PATCH-for-8.0] linux-user/mips: Use P5600 as default CPU to run NaN2008 ELF binaries
Posted by Laurent Vivier 12 months ago
Le 27/03/2023 à 18:24, Philippe Mathieu-Daudé a écrit :
> Per the release 6.06 revision history:
> 
>   5.03 August 21, 2013
> 
>   • ABS2008 and NAN2008 fields of Table 5.7 “FCSR RegisterField
>     Descriptions” were optional in release 3 and could be R/W,
>     but as of release 5 are required, read-only, and preset by
>     hardware.
> 
> The P5600 core implements the release 5, and has the ABS2008
> and NAN2008 bits set in CP1_fcr31. Therefore it is able to run
> ELF binaries compiled with EF_MIPS_NAN2008, such the CIP United
> Debian NaN2008 distribution:
> http://repo.oss.cipunited.com/mipsel-nan2008/README.txt
> 
> In order to run such compiled binaries, select by default the
> P5600 core when the ELF 'MIPS_NAN2008' flag is set.
> 
> Reported-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---
>   linux-user/mips/target_elf.h | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/linux-user/mips/target_elf.h b/linux-user/mips/target_elf.h
> index a98c9bd6ad..b965e86b2b 100644
> --- a/linux-user/mips/target_elf.h
> +++ b/linux-user/mips/target_elf.h
> @@ -15,6 +15,9 @@ static inline const char *cpu_get_model(uint32_t eflags)
>       if ((eflags & EF_MIPS_MACH) == EF_MIPS_MACH_5900) {
>           return "R5900";
>       }
> +    if (eflags & EF_MIPS_NAN2008) {
> +        return "P5600";
> +    }
>       return "24Kf";
>   }
>   #endif

Acked-by: Laurent Vivier <laurent@vivier.eu>

Re: [PATCH-for-8.0] linux-user/mips: Use P5600 as default CPU to run NaN2008 ELF binaries
Posted by Richard Henderson 1 year ago
On 3/27/23 09:24, Philippe Mathieu-Daudé wrote:
> Per the release 6.06 revision history:
> 
>   5.03 August 21, 2013
> 
>   • ABS2008 and NAN2008 fields of Table 5.7 “FCSR RegisterField
>     Descriptions” were optional in release 3 and could be R/W,
>     but as of release 5 are required, read-only, and preset by
>     hardware.
> 
> The P5600 core implements the release 5, and has the ABS2008
> and NAN2008 bits set in CP1_fcr31. Therefore it is able to run
> ELF binaries compiled with EF_MIPS_NAN2008, such the CIP United
> Debian NaN2008 distribution:
> http://repo.oss.cipunited.com/mipsel-nan2008/README.txt
> 
> In order to run such compiled binaries, select by default the
> P5600 core when the ELF 'MIPS_NAN2008' flag is set.
> 
> Reported-by: Jiaxun Yang<jiaxun.yang@flygoat.com>
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   linux-user/mips/target_elf.h | 3 +++
>   1 file changed, 3 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~