linux-user/mips: Select correct CPUs
cover linux-user/mips: Select correct CPUs
Improve CPU type selection:
- Remove R5900
- Cover Octeon / R2 / Loongson*
Philippe Mathieu-Daudé (4):
linux-user/mips: Do not try to use removed R5900 CPU linux-user/mips: Select Octeon68XX CPU for Octeon binaries linux-user/mips: Select MIPS64R2-generic for Rel2 binaries linux-user/mips: Select Loongson CPU for Loongson binaries
linux-user/mips/target_elf.h | 3 --- linux-user/mips64/target_elf.h | 24 ++++++++++++++++++++---- 2 files changed, 20 insertions(+), 7 deletions(-)
Signature · 1 line
2.45.2
PATCH 1/4 linux-user/mips: Do not try to use removed R5900 CPU
R5900 emulation was removed in commit 823f2897bd.
Remove it from ELF parsing in order to avoid:
$ qemu-mipsn32 ./test5900 qemu-mipsn32: unable to find CPU model 'R5900'
This reverts commit 4d9e5a0eb7df6e98ac6cf5e16029f35dd05b9537.
--- linux-user/mips/target_elf.h | 3 --- linux-user/mips64/target_elf.h | 3 --- 2 files changed, 6 deletions(-)
linux-user/mips/target_elf.h +0 -3
@@ -12,9 +12,6 @@ static inline const char *cpu_get_model(uint32_t eflags)if ((eflags &EF_MIPS_ARCH ) ==EF_MIPS_ARCH_32R6 ) {return "mips32r6-generic" ; } -if ((eflags &EF_MIPS_MACH ) ==EF_MIPS_MACH_5900 ) { -return "R5900" ; - }if (eflags &EF_MIPS_NAN2008 ) {return "P5600" ; }
linux-user/mips64/target_elf.h +0 -3
@@ -12,9 +12,6 @@ static inline const char *cpu_get_model(uint32_t eflags)if ((eflags &EF_MIPS_ARCH ) ==EF_MIPS_ARCH_64R6 ) {return "I6400" ; } -if ((eflags &EF_MIPS_MACH ) ==EF_MIPS_MACH_5900 ) { -return "R5900" ; - } return "5KEf"; }#endif
Signature · 1 line
2.45.2
Re: [PATCH-for-9.1 1/4] linux-user/mips: Do not try to use removed R5900 CPU
Quoted 6 lines · Philippe Mathieu-Daudé
R5900 emulation was removed in commit
823f2897bd.
Remove it from ELF parsing in order to avoid:$ qemu-mipsn32 ./test5900 qemu-mipsn32: unable to find CPU model 'R5900'
Quoted 8 lines
This reverts commit
4d9e5a0eb7df6e98ac6cf5e16029f35dd05b9537.Fixes 823f2897bd ("target/mips: Disable R5900 support")Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- linux-user/mips/target_elf.h | 3 --- linux-user/mips64/target_elf.h | 3 --- 2 files changed, 6 deletions(-)
r~
PATCH 2/4 linux-user/mips: Select Octeon68XX CPU for Octeon binaries
In reply to Philippe Mathieu-DaudéThe Octeon68XX CPU is available since commit 9a6046a655 ("target/mips: introduce Cavium Octeon CPU model").
Cc: Pavel Dovgalyuk <[email protected]>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1722
--- linux-user/mips64/target_elf.h | 8 ++++++++ 1 file changed, 8 insertions(+)
linux-user/mips64/target_elf.h +8 -0
@@ -9,6 +9,14 @@#define MIPS64_TARGET_ELF_H static inline const char *cpu_get_model (uint32_t eflags) { +switch (eflags &EF_MIPS_MACH ) { +case EF_MIPS_MACH_OCTEON : +case EF_MIPS_MACH_OCTEON2 : +case EF_MIPS_MACH_OCTEON3 : +return "Octeon68XX" ; +default : +break ; + }if ((eflags &EF_MIPS_ARCH ) ==EF_MIPS_ARCH_64R6 ) {return "I6400" ; }
Signature · 1 line
2.45.2
Re: [PATCH-for-9.1 2/4] linux-user/mips: Select Octeon68XX CPU for Octeon binaries
Quoted 11 lines · Philippe Mathieu-Daudé
The Octeon68XX CPU is available since commit
9a6046a655("target/mips: introduce Cavium Octeon CPU model").Cc: Pavel Dovgalyuk<[email protected]> Resolves:https://gitlab.com/qemu-project/qemu/-/issues/1722
Reported-by Johnathan Hữu Trí<[email protected]>Suggested-by Richard Henderson<[email protected]>Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- linux-user/mips64/target_elf.h | 8 ++++++++ 1 file changed, 8 insertions(+)
r~
PATCH 3/4 linux-user/mips: Select MIPS64R2-generic for Rel2 binaries
In reply to Philippe Mathieu-Daudé--- linux-user/mips64/target_elf.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
linux-user/mips64/target_elf.h +6 -1
@@ -17,8 +17,13 @@ static inline const char *cpu_get_model(uint32_t eflags)default :break ; } -if ((eflags &EF_MIPS_ARCH ) ==EF_MIPS_ARCH_64R6 ) { +switch (eflags &EF_MIPS_ARCH ) { +case EF_MIPS_ARCH_64R6 :return "I6400" ; +case EF_MIPS_ARCH_64R2 : +return "MIPS64R2-generic" ; +default : +break ; }return "5KEf" ; }
Signature · 1 line
2.45.2
Re: [PATCH-for-9.1 3/4] linux-user/mips: Select MIPS64R2-generic for Rel2 binaries
Quoted 6 lines · Philippe Mathieu-Daudé
Cc YunQiang Su<[email protected]>Reported-by Jiaxun Yang<[email protected]>Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- linux-user/mips64/target_elf.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
r~
PATCH 4/4 linux-user/mips: Select Loongson CPU for Loongson binaries
In reply to Philippe Mathieu-Daudé--- linux-user/mips64/target_elf.h | 6 ++++++ 1 file changed, 6 insertions(+)
linux-user/mips64/target_elf.h +6 -0
@@ -14,6 +14,12 @@ static inline const char *cpu_get_model(uint32_t eflags)case EF_MIPS_MACH_OCTEON2 :case EF_MIPS_MACH_OCTEON3 :return "Octeon68XX" ; +case EF_MIPS_MACH_LS2E : +return "Loongson-2E" ; +case EF_MIPS_MACH_LS2F : +return "Loongson-2F" ; +case EF_MIPS_MACH_LS3A : +return "Loongson-3A1000" ;default :break ; }
Signature · 1 line
2.45.2
Re: [PATCH-for-9.1? 4/4] linux-user/mips: Select Loongson CPU for Loongson binaries
Quoted 4 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- linux-user/mips64/target_elf.h | 6 ++++++ 1 file changed, 6 insertions(+)
And yes, this might as well go in with the others for 9.1.
r~
Quoted 5 lines · Philippe Mathieu-Daudé
Philippe Mathieu-Daudé (4):
linux-user/mips: Do not try to use removed R5900 CPU linux-user/mips: Select Octeon68XX CPU for Octeon binaries linux-user/mips: Select MIPS64R2-generic for Rel2 binaries linux-user/mips: Select Loongson CPU for Loongson binaries
Series queued.