qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] linux-user: Add support for MIPS Loongson 2F/3E
@ 2020-12-01  8:39 Philippe Mathieu-Daudé
  2020-12-01  8:39 ` [PATCH 1/2] linux-user: Update HWCAP bits from linux 5.7 Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-12-01  8:39 UTC (permalink / raw)
  To: qemu-devel, Huacai Chen, Jiaxun Yang
  Cc: Aleksandar Rikalo, Richard Henderson, Philippe Mathieu-Daudé,
	Laurent Vivier, Meng Zhuo, Aurelien Jarno

Update the ELF HWCAP bits and set the Loongson instructions
so we can run 2F/3E userland binaries.

Philippe Mathieu-Daudé (2):
  linux-user: Update HWCAP bits from linux 5.7
  linux-user: Add support for MIPS Loongson 2F/3E

 linux-user/elfload.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

-- 
2.26.2



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

* [PATCH 1/2] linux-user: Update HWCAP bits from linux 5.7
  2020-12-01  8:39 [PATCH 0/2] linux-user: Add support for MIPS Loongson 2F/3E Philippe Mathieu-Daudé
@ 2020-12-01  8:39 ` Philippe Mathieu-Daudé
  2020-12-01  8:39 ` [PATCH 2/2] linux-user: Add support for MIPS Loongson 2F/3E Philippe Mathieu-Daudé
  2020-12-01 12:20 ` [PATCH 0/2] " Richard Henderson
  2 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-12-01  8:39 UTC (permalink / raw)
  To: qemu-devel, Huacai Chen, Jiaxun Yang
  Cc: Aleksandar Rikalo, Richard Henderson, Philippe Mathieu-Daudé,
	Laurent Vivier, Meng Zhuo, Aurelien Jarno

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 linux-user/elfload.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 0b02a926025..17371f8b8cd 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -985,6 +985,19 @@ static void elf_core_copy_regs(target_elf_gregset_t *regs, const CPUMIPSState *e
 enum {
     HWCAP_MIPS_R6           = (1 << 0),
     HWCAP_MIPS_MSA          = (1 << 1),
+    HWCAP_MIPS_CRC32        = (1 << 2),
+    HWCAP_MIPS_MIPS16       = (1 << 3),
+    HWCAP_MIPS_MDMX         = (1 << 4),
+    HWCAP_MIPS_MIPS3D       = (1 << 5),
+    HWCAP_MIPS_SMARTMIPS    = (1 << 6),
+    HWCAP_MIPS_DSP          = (1 << 7),
+    HWCAP_MIPS_DSP2         = (1 << 8),
+    HWCAP_MIPS_DSP3         = (1 << 9),
+    HWCAP_MIPS_MIPS16E2     = (1 << 10),
+    HWCAP_LOONGSON_MMI      = (1 << 11),
+    HWCAP_LOONGSON_EXT      = (1 << 12),
+    HWCAP_LOONGSON_EXT2     = (1 << 13),
+    HWCAP_LOONGSON_CPUCFG   = (1 << 14),
 };
 
 #define ELF_HWCAP get_elf_hwcap()
-- 
2.26.2



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

* [PATCH 2/2] linux-user: Add support for MIPS Loongson 2F/3E
  2020-12-01  8:39 [PATCH 0/2] linux-user: Add support for MIPS Loongson 2F/3E Philippe Mathieu-Daudé
  2020-12-01  8:39 ` [PATCH 1/2] linux-user: Update HWCAP bits from linux 5.7 Philippe Mathieu-Daudé
@ 2020-12-01  8:39 ` Philippe Mathieu-Daudé
  2020-12-01  8:45   ` Philippe Mathieu-Daudé
  2020-12-01 12:20 ` [PATCH 0/2] " Richard Henderson
  2 siblings, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-12-01  8:39 UTC (permalink / raw)
  To: qemu-devel, Huacai Chen, Jiaxun Yang
  Cc: Aleksandar Rikalo, Richard Henderson, Philippe Mathieu-Daudé,
	Laurent Vivier, Meng Zhuo, Aurelien Jarno

Userland EFL binaries using Longsoon SIMD instructions have the
HWCAP_LOONGSON_MMI bit set. Binaries compiled for Longsoon 3E
have the HWCAP_LOONGSON_EXT bit set for the LQ / SQ instructions.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 linux-user/elfload.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/linux-user/elfload.c b/linux-user/elfload.c
index 17371f8b8cd..be82fcb2c0a 100644
--- a/linux-user/elfload.c
+++ b/linux-user/elfload.c
@@ -1012,6 +1012,8 @@ static uint32_t get_elf_hwcap(void)
 
     GET_FEATURE(ISA_MIPS32R6 | ISA_MIPS64R6, HWCAP_MIPS_R6);
     GET_FEATURE(ASE_MSA, HWCAP_MIPS_MSA);
+    GET_FEATURE(ASE_LMMI, HWCAP_LOONGSON_MMI);
+    GET_FEATURE(ASE_LEXT, HWCAP_LOONGSON_EXT);
 
 #undef GET_FEATURE
 
-- 
2.26.2



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

* Re: [PATCH 2/2] linux-user: Add support for MIPS Loongson 2F/3E
  2020-12-01  8:39 ` [PATCH 2/2] linux-user: Add support for MIPS Loongson 2F/3E Philippe Mathieu-Daudé
@ 2020-12-01  8:45   ` Philippe Mathieu-Daudé
  2020-12-01 13:01     ` Philippe Mathieu-Daudé
  0 siblings, 1 reply; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-12-01  8:45 UTC (permalink / raw)
  To: qemu-devel@nongnu.org Developers, Huacai Chen, Jiaxun Yang
  Cc: Aurelien Jarno, Aleksandar Rikalo, Richard Henderson,
	Laurent Vivier, Meng Zhuo

On Tue, Dec 1, 2020 at 9:40 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>
> Userland EFL binaries using Longsoon SIMD instructions have the
> HWCAP_LOONGSON_MMI bit set. Binaries compiled for Longsoon 3E
> have the HWCAP_LOONGSON_EXT bit set for the LQ / SQ instructions.
>

Eventually I can respin with references:

2F since 8e2d5831e4b ("target/mips: Legalize Loongson insn flags").
3E since af868995e1b ("target/mips: Add Loongson-3 CPU definition").

> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  linux-user/elfload.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
> index 17371f8b8cd..be82fcb2c0a 100644
> --- a/linux-user/elfload.c
> +++ b/linux-user/elfload.c
> @@ -1012,6 +1012,8 @@ static uint32_t get_elf_hwcap(void)
>
>      GET_FEATURE(ISA_MIPS32R6 | ISA_MIPS64R6, HWCAP_MIPS_R6);
>      GET_FEATURE(ASE_MSA, HWCAP_MIPS_MSA);
> +    GET_FEATURE(ASE_LMMI, HWCAP_LOONGSON_MMI);
> +    GET_FEATURE(ASE_LEXT, HWCAP_LOONGSON_EXT);
>
>  #undef GET_FEATURE
>
> --
> 2.26.2
>


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

* Re: [PATCH 0/2] linux-user: Add support for MIPS Loongson 2F/3E
  2020-12-01  8:39 [PATCH 0/2] linux-user: Add support for MIPS Loongson 2F/3E Philippe Mathieu-Daudé
  2020-12-01  8:39 ` [PATCH 1/2] linux-user: Update HWCAP bits from linux 5.7 Philippe Mathieu-Daudé
  2020-12-01  8:39 ` [PATCH 2/2] linux-user: Add support for MIPS Loongson 2F/3E Philippe Mathieu-Daudé
@ 2020-12-01 12:20 ` Richard Henderson
  2 siblings, 0 replies; 6+ messages in thread
From: Richard Henderson @ 2020-12-01 12:20 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel, Huacai Chen, Jiaxun Yang
  Cc: Aurelien Jarno, Aleksandar Rikalo, Laurent Vivier, Meng Zhuo

On 12/1/20 2:39 AM, Philippe Mathieu-Daudé wrote:
> Update the ELF HWCAP bits and set the Loongson instructions
> so we can run 2F/3E userland binaries.
> 
> Philippe Mathieu-Daudé (2):
>   linux-user: Update HWCAP bits from linux 5.7
>   linux-user: Add support for MIPS Loongson 2F/3E
> 
>  linux-user/elfload.c | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
> 

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

r~


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

* Re: [PATCH 2/2] linux-user: Add support for MIPS Loongson 2F/3E
  2020-12-01  8:45   ` Philippe Mathieu-Daudé
@ 2020-12-01 13:01     ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-12-01 13:01 UTC (permalink / raw)
  To: qemu-devel@nongnu.org Developers, Huacai Chen, Jiaxun Yang
  Cc: Aleksandar Rikalo, Richard Henderson, Laurent Vivier,
	Aurelien Jarno, Meng Zhuo

On 12/1/20 9:45 AM, Philippe Mathieu-Daudé wrote:
> On Tue, Dec 1, 2020 at 9:40 AM Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
>>
>> Userland EFL binaries using Longsoon SIMD instructions have the

Well I'll respin to fix the EFL -> ELF typo.

>> HWCAP_LOONGSON_MMI bit set. Binaries compiled for Longsoon 3E
>> have the HWCAP_LOONGSON_EXT bit set for the LQ / SQ instructions.
>>
> 
> Eventually I can respin with references:
> 
> 2F since 8e2d5831e4b ("target/mips: Legalize Loongson insn flags").
> 3E since af868995e1b ("target/mips: Add Loongson-3 CPU definition").
> 
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  linux-user/elfload.c | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/linux-user/elfload.c b/linux-user/elfload.c
>> index 17371f8b8cd..be82fcb2c0a 100644
>> --- a/linux-user/elfload.c
>> +++ b/linux-user/elfload.c
>> @@ -1012,6 +1012,8 @@ static uint32_t get_elf_hwcap(void)
>>
>>      GET_FEATURE(ISA_MIPS32R6 | ISA_MIPS64R6, HWCAP_MIPS_R6);
>>      GET_FEATURE(ASE_MSA, HWCAP_MIPS_MSA);
>> +    GET_FEATURE(ASE_LMMI, HWCAP_LOONGSON_MMI);
>> +    GET_FEATURE(ASE_LEXT, HWCAP_LOONGSON_EXT);
>>
>>  #undef GET_FEATURE
>>
>> --
>> 2.26.2
>>
> 


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

end of thread, other threads:[~2020-12-01 13:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-01  8:39 [PATCH 0/2] linux-user: Add support for MIPS Loongson 2F/3E Philippe Mathieu-Daudé
2020-12-01  8:39 ` [PATCH 1/2] linux-user: Update HWCAP bits from linux 5.7 Philippe Mathieu-Daudé
2020-12-01  8:39 ` [PATCH 2/2] linux-user: Add support for MIPS Loongson 2F/3E Philippe Mathieu-Daudé
2020-12-01  8:45   ` Philippe Mathieu-Daudé
2020-12-01 13:01     ` Philippe Mathieu-Daudé
2020-12-01 12:20 ` [PATCH 0/2] " Richard Henderson

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).