All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs
@ 2020-11-19 16:17 Philippe Mathieu-Daudé
  2020-11-19 16:17 ` [PATCH 1/4] linux-user/mips64: Restore setup_frame() for o32 ABI Philippe Mathieu-Daudé
                   ` (5 more replies)
  0 siblings, 6 replies; 23+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-19 16:17 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, Laurent Vivier, Aurelien Jarno,
	Philippe Mathieu-Daudé

This series allow building linux-user emulator to run ELF
binaries built for the MIPS o32 ABI on 64-bit CPUs (binaries
produced by Sony Linux Toolkit for Playstation 2 for the
R5900 CPU).

The new QEMU binary is named 'qemu-mips64o32'.

The binfmt config isn't correct, as it matches mipsel/mipsn32el.
I missed to understand how mipsel (o32) and mipsn32el (n32) are
differenciated.

Based-on: <20201119160838.1981709-1-f4bug@amsat.org>

Philippe Mathieu-Daudé (4):
  linux-user/mips64: Restore setup_frame() for o32 ABI
  linux-user/mips64: Support o32 ABI syscalls
  default-configs: Support o32 ABI with 64-bit MIPS CPUs
  RFC qemu-binfmt-conf.sh: Add MIPS64 o32 ABI

 docs/user/main.rst                                 | 3 +++
 default-configs/targets/mips64o32el-linux-user.mak | 7 +++++++
 linux-user/mips64/syscall_nr.h                     | 5 ++++-
 linux-user/mips64/target_signal.h                  | 4 ++++
 scripts/qemu-binfmt-conf.sh                        | 4 ++++
 5 files changed, 22 insertions(+), 1 deletion(-)
 create mode 100644 default-configs/targets/mips64o32el-linux-user.mak

-- 
2.26.2



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

* [PATCH 1/4] linux-user/mips64: Restore setup_frame() for o32 ABI
  2020-11-19 16:17 [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs Philippe Mathieu-Daudé
@ 2020-11-19 16:17 ` Philippe Mathieu-Daudé
  2020-11-19 23:07   ` Richard Henderson
                     ` (2 more replies)
  2020-11-19 16:17 ` [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls Philippe Mathieu-Daudé
                   ` (4 subsequent siblings)
  5 siblings, 3 replies; 23+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-19 16:17 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, Laurent Vivier, Aurelien Jarno,
	Philippe Mathieu-Daudé

64-bit MIPS targets lost setup_frame() during the refactor in commit
8949bef18b9. Restore it declaring TARGET_ARCH_HAS_SETUP_FRAME, to be
able to build the o32 ABI target.

Fixes: 8949bef18b9 ("linux-user: move mips/mips64 signal.c parts to mips directory")
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 linux-user/mips64/target_signal.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linux-user/mips64/target_signal.h b/linux-user/mips64/target_signal.h
index 799f7a668cd..f1f0ed7f706 100644
--- a/linux-user/mips64/target_signal.h
+++ b/linux-user/mips64/target_signal.h
@@ -67,4 +67,8 @@ typedef struct target_sigaltstack {
 #define TARGET_MINSIGSTKSZ    2048
 #define TARGET_SIGSTKSZ       8192
 
+#if defined(TARGET_ABI_MIPSO32)
+/* compare linux/arch/mips/kernel/signal.c:setup_frame() */
+#define TARGET_ARCH_HAS_SETUP_FRAME
+#endif
 #endif /* MIPS64_TARGET_SIGNAL_H */
-- 
2.26.2



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

* [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls
  2020-11-19 16:17 [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs Philippe Mathieu-Daudé
  2020-11-19 16:17 ` [PATCH 1/4] linux-user/mips64: Restore setup_frame() for o32 ABI Philippe Mathieu-Daudé
@ 2020-11-19 16:17 ` Philippe Mathieu-Daudé
  2020-11-19 23:08   ` Richard Henderson
                     ` (2 more replies)
  2020-11-19 16:17 ` [PATCH 3/4] default-configs: Support o32 ABI with 64-bit MIPS CPUs Philippe Mathieu-Daudé
                   ` (3 subsequent siblings)
  5 siblings, 3 replies; 23+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-19 16:17 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, Laurent Vivier, Aurelien Jarno,
	Philippe Mathieu-Daudé

o32 ABI syscalls start at offset 4000.

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 linux-user/mips64/syscall_nr.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/linux-user/mips64/syscall_nr.h b/linux-user/mips64/syscall_nr.h
index 672f2fa51cb..6579421fa63 100644
--- a/linux-user/mips64/syscall_nr.h
+++ b/linux-user/mips64/syscall_nr.h
@@ -1,4 +1,7 @@
-#ifdef TARGET_ABI_MIPSN32
+#if defined(TARGET_ABI_MIPSO32)
+#define TARGET_SYSCALL_OFFSET 4000
+#include "syscall_o32_nr.h"
+#elif defined(TARGET_ABI_MIPSN32)
 #define TARGET_SYSCALL_OFFSET 6000
 #include "syscall_n32_nr.h"
 #else
-- 
2.26.2



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

* [PATCH 3/4] default-configs: Support o32 ABI with 64-bit MIPS CPUs
  2020-11-19 16:17 [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs Philippe Mathieu-Daudé
  2020-11-19 16:17 ` [PATCH 1/4] linux-user/mips64: Restore setup_frame() for o32 ABI Philippe Mathieu-Daudé
  2020-11-19 16:17 ` [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls Philippe Mathieu-Daudé
@ 2020-11-19 16:17 ` Philippe Mathieu-Daudé
  2020-11-19 16:45   ` Maciej W. Rozycki
  2020-11-19 16:17 ` [PATCH 4/4] RFC qemu-binfmt-conf.sh: Add MIPS64 o32 ABI Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 23+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-19 16:17 UTC (permalink / raw)
  To: qemu-devel
  Cc: Fredrik Noring, David Daney, Mathieu Malaterre,
	Richard Henderson, Laurent Vivier, Philippe Mathieu-Daudé,
	YunQiang Su, James Cowgill, Maciej W . Rozycki,
	Jürgen Urban, Aurelien Jarno, Richard Henderson

MIPS o32 ABI on 64-bit CPUs looks like a ILP32-on-64bit data
model, allowing 64-bit arithmetic and data movement instructions.

This is the default ABI used by the "Sony Linux Toolkit for
Playstation 2".

As we don't know big-endian uses, we only introduce the
little-endian variant.

Inspired-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
Cc: Fredrik Noring <noring@nocrew.org>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Jürgen Urban <JuergenUrban@gmx.de>

Cc from https://lists.debian.org/debian-mips/2015/05/msg00014.html:
Cc: Mathieu Malaterre <malat@debian.org>
Cc: James Cowgill <james410@cowgill.org.uk>
Cc: YunQiang Su <wzssyqa@gmail.com>
Cc: David Daney <ddaney.cavm@gmail.com>
---
 docs/user/main.rst                                 | 3 +++
 default-configs/targets/mips64o32el-linux-user.mak | 7 +++++++
 2 files changed, 10 insertions(+)
 create mode 100644 default-configs/targets/mips64o32el-linux-user.mak

diff --git a/docs/user/main.rst b/docs/user/main.rst
index 8dfe232a3af..2cef1320ff3 100644
--- a/docs/user/main.rst
+++ b/docs/user/main.rst
@@ -211,6 +211,9 @@ Other binaries
 
    * ``qemu-mipsel`` executes 32-bit little endian MIPS binaries (MIPS O32 ABI).
 
+   * ``qemu-mips64o32el`` executes 64-bit little endian MIPS binaries (MIPS O32
+     ABI).
+
    * ``qemu-mips64`` executes 64-bit big endian MIPS binaries (MIPS N64 ABI).
 
    * ``qemu-mips64el`` executes 64-bit little endian MIPS binaries (MIPS N64
diff --git a/default-configs/targets/mips64o32el-linux-user.mak b/default-configs/targets/mips64o32el-linux-user.mak
new file mode 100644
index 00000000000..ecd57ff949f
--- /dev/null
+++ b/default-configs/targets/mips64o32el-linux-user.mak
@@ -0,0 +1,7 @@
+TARGET_ARCH=mips64
+TARGET_BASE_ARCH=mips
+TARGET_ABI_MIPSO32=y
+TARGET_ABI32=y
+TARGET_SYSTBL_ABI=o32
+TARGET_SYSTBL=../mips/syscall_o32.tbl
+TARGET_ALIGNED_ONLY=y
-- 
2.26.2



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

* [PATCH 4/4] RFC qemu-binfmt-conf.sh: Add MIPS64 o32 ABI
  2020-11-19 16:17 [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2020-11-19 16:17 ` [PATCH 3/4] default-configs: Support o32 ABI with 64-bit MIPS CPUs Philippe Mathieu-Daudé
@ 2020-11-19 16:17 ` Philippe Mathieu-Daudé
  2020-11-19 23:14   ` Richard Henderson
  2020-11-19 16:27 ` [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs no-reply
  2020-12-13 15:14 ` Philippe Mathieu-Daudé
  5 siblings, 1 reply; 23+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-19 16:17 UTC (permalink / raw)
  To: qemu-devel
  Cc: Richard Henderson, Laurent Vivier, Aurelien Jarno,
	Philippe Mathieu-Daudé

... but this is wrong as the same header matches MIPS32 o32 ELFs...

Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
checkpatch errors:

 ERROR: line over 90 characters
 #9: FILE: scripts/qemu-binfmt-conf.sh:71:
 +mips64o32el_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00'
 ERROR: line over 90 characters
 #10: FILE: scripts/qemu-binfmt-conf.sh:72:
 +mips64o32el_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
---
 scripts/qemu-binfmt-conf.sh | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/scripts/qemu-binfmt-conf.sh b/scripts/qemu-binfmt-conf.sh
index 9f1580a91c7..ee86345ff8a 100755
--- a/scripts/qemu-binfmt-conf.sh
+++ b/scripts/qemu-binfmt-conf.sh
@@ -68,6 +68,10 @@ mipsel_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x0
 mipsel_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
 mipsel_family=mips
 
+mips64o32el_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00'
+mips64o32el_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'
+mips64o32el_family=mips
+
 mipsn32_magic='\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08'
 mipsn32_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff'
 mipsn32_family=mips
-- 
2.26.2



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

* Re: [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs
  2020-11-19 16:17 [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs Philippe Mathieu-Daudé
                   ` (3 preceding siblings ...)
  2020-11-19 16:17 ` [PATCH 4/4] RFC qemu-binfmt-conf.sh: Add MIPS64 o32 ABI Philippe Mathieu-Daudé
@ 2020-11-19 16:27 ` no-reply
  2020-12-13 15:14 ` Philippe Mathieu-Daudé
  5 siblings, 0 replies; 23+ messages in thread
From: no-reply @ 2020-11-19 16:27 UTC (permalink / raw)
  To: f4bug; +Cc: f4bug, richard.henderson, qemu-devel, aurelien, laurent

Patchew URL: https://patchew.org/QEMU/20201119161710.1985083-1-f4bug@amsat.org/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Message-id: 20201119161710.1985083-1-f4bug@amsat.org
Subject: [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
 * [new tag]         patchew/20201119161710.1985083-1-f4bug@amsat.org -> patchew/20201119161710.1985083-1-f4bug@amsat.org
Switched to a new branch 'test'
a58e561 RFC qemu-binfmt-conf.sh: Add MIPS64 o32 ABI
dd1918b default-configs: Support o32 ABI with 64-bit MIPS CPUs
89b6078 linux-user/mips64: Support o32 ABI syscalls
5eacc3e linux-user/mips64: Restore setup_frame() for o32 ABI

=== OUTPUT BEGIN ===
1/4 Checking commit 5eacc3e0fcb8 (linux-user/mips64: Restore setup_frame() for o32 ABI)
2/4 Checking commit 89b6078d6798 (linux-user/mips64: Support o32 ABI syscalls)
3/4 Checking commit dd1918bdda51 (default-configs: Support o32 ABI with 64-bit MIPS CPUs)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#22: 
new file mode 100644

total: 0 errors, 1 warnings, 16 lines checked

Patch 3/4 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
4/4 Checking commit a58e5610b2e7 (RFC qemu-binfmt-conf.sh: Add MIPS64 o32 ABI)
ERROR: line over 90 characters
#21: FILE: scripts/qemu-binfmt-conf.sh:71:
+mips64o32el_magic='\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00'

ERROR: line over 90 characters
#22: FILE: scripts/qemu-binfmt-conf.sh:72:
+mips64o32el_mask='\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff'

total: 2 errors, 0 warnings, 10 lines checked

Patch 4/4 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20201119161710.1985083-1-f4bug@amsat.org/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com

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

* Re: [PATCH 3/4] default-configs: Support o32 ABI with 64-bit MIPS CPUs
  2020-11-19 16:17 ` [PATCH 3/4] default-configs: Support o32 ABI with 64-bit MIPS CPUs Philippe Mathieu-Daudé
@ 2020-11-19 16:45   ` Maciej W. Rozycki
  2020-11-19 17:13     ` Philippe Mathieu-Daudé
  2020-12-12 17:03     ` Fredrik Noring
  0 siblings, 2 replies; 23+ messages in thread
From: Maciej W. Rozycki @ 2020-11-19 16:45 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Fredrik Noring, Mathieu Malaterre, Richard Henderson, qemu-devel,
	Laurent Vivier, YunQiang Su, James Cowgill, David Daney,
	Jürgen Urban, Aurelien Jarno, Richard Henderson

On Thu, 19 Nov 2020, Philippe Mathieu-Daudé wrote:

> MIPS o32 ABI on 64-bit CPUs looks like a ILP32-on-64bit data
> model, allowing 64-bit arithmetic and data movement instructions.
> 
> This is the default ABI used by the "Sony Linux Toolkit for
> Playstation 2".

 Please don't, not at least with a generic configuration (i.e. make it 
unambiguous that this is R5900-specific).  This only works with R5900 
because it does not implement the MIPS ISA correctly (e.g. see what $ra is 
set to with JAL/JALR/etc. in the kernel mode), and it is not supported by 
the standard Linux ABI.  Use n32 instead, which has the same functionality 
and is standard (and is also a better ABI in terms of performance).

 You'd probably need to implement all the R5900 addressing quirks for your 
proposed hack to match hardware, or otherwise you'll end up with emulation 
that creates its own reality.

  Maciej


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

* Re: [PATCH 3/4] default-configs: Support o32 ABI with 64-bit MIPS CPUs
  2020-11-19 16:45   ` Maciej W. Rozycki
@ 2020-11-19 17:13     ` Philippe Mathieu-Daudé
  2020-12-12  8:29       ` Fredrik Noring
  2020-12-12 17:03     ` Fredrik Noring
  1 sibling, 1 reply; 23+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-11-19 17:13 UTC (permalink / raw)
  To: Maciej W. Rozycki
  Cc: Fredrik Noring, Mathieu Malaterre, Richard Henderson, qemu-devel,
	Laurent Vivier, YunQiang Su, James Cowgill, David Daney,
	Jürgen Urban, Aurelien Jarno, Richard Henderson

Hi Maciej,

On 11/19/20 5:45 PM, Maciej W. Rozycki wrote:
> On Thu, 19 Nov 2020, Philippe Mathieu-Daudé wrote:
> 
>> MIPS o32 ABI on 64-bit CPUs looks like a ILP32-on-64bit data
>> model, allowing 64-bit arithmetic and data movement instructions.
>>
>> This is the default ABI used by the "Sony Linux Toolkit for
>> Playstation 2".
> 
>  Please don't, not at least with a generic configuration (i.e. make it 
> unambiguous that this is R5900-specific).  This only works with R5900 
> because it does not implement the MIPS ISA correctly (e.g. see what $ra is 
> set to with JAL/JALR/etc. in the kernel mode), and it is not supported by 
> the standard Linux ABI.  Use n32 instead, which has the same functionality 
> and is standard (and is also a better ABI in terms of performance).

I think there are 2 different interests with the R5900. Fredrik sent a
series to run recent userland/kernel on a PS2. For QEMU, it would be
easier if these uses the n32 ABI indeed.

This series allows me to run unmodified binaries from the PS2 (built
maybe 20 years ago, apparently for a kernel 2.2).

>  You'd probably need to implement all the R5900 addressing quirks for your 
> proposed hack to match hardware, or otherwise you'll end up with emulation 
> that creates its own reality.

QEMU doesn't model well non-MIPS32 ISA, so the R5900 needs work indeed.

Laurent, maybe instead of 'mips64o32el-linux-user' we can call this
target 'r5900o32-linux-user', 'ps2-linux-user' or even 'r5900-ps2-user'
as Maciej said "it is not supported by the standard Linux ABI."

Also I'll see to mark it deprecated so it isn't built by default.

Thanks Maciej for your interest,

Phil.


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

* Re: [PATCH 1/4] linux-user/mips64: Restore setup_frame() for o32 ABI
  2020-11-19 16:17 ` [PATCH 1/4] linux-user/mips64: Restore setup_frame() for o32 ABI Philippe Mathieu-Daudé
@ 2020-11-19 23:07   ` Richard Henderson
  2020-12-17 10:18   ` Laurent Vivier
  2021-02-11 21:33   ` Laurent Vivier
  2 siblings, 0 replies; 23+ messages in thread
From: Richard Henderson @ 2020-11-19 23:07 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Laurent Vivier, Aurelien Jarno

On 11/19/20 8:17 AM, Philippe Mathieu-Daudé wrote:
> 64-bit MIPS targets lost setup_frame() during the refactor in commit
> 8949bef18b9. Restore it declaring TARGET_ARCH_HAS_SETUP_FRAME, to be
> able to build the o32 ABI target.
> 
> Fixes: 8949bef18b9 ("linux-user: move mips/mips64 signal.c parts to mips directory")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  linux-user/mips64/target_signal.h | 4 ++++
>  1 file changed, 4 insertions(+)

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

r~



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

* Re: [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls
  2020-11-19 16:17 ` [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls Philippe Mathieu-Daudé
@ 2020-11-19 23:08   ` Richard Henderson
  2020-11-19 23:09     ` Richard Henderson
  2020-12-17 10:40   ` Laurent Vivier
  2021-02-11 21:33   ` Laurent Vivier
  2 siblings, 1 reply; 23+ messages in thread
From: Richard Henderson @ 2020-11-19 23:08 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Laurent Vivier, Aurelien Jarno

On 11/19/20 8:17 AM, Philippe Mathieu-Daudé wrote:
> +#if defined(TARGET_ABI_MIPSO32)
> +#define TARGET_SYSCALL_OFFSET 4000
> +#include "syscall_o32_nr.h"

Where does this get built?


r~



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

* Re: [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls
  2020-11-19 23:08   ` Richard Henderson
@ 2020-11-19 23:09     ` Richard Henderson
  0 siblings, 0 replies; 23+ messages in thread
From: Richard Henderson @ 2020-11-19 23:09 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Laurent Vivier, Aurelien Jarno

On 11/19/20 3:08 PM, Richard Henderson wrote:
> On 11/19/20 8:17 AM, Philippe Mathieu-Daudé wrote:
>> +#if defined(TARGET_ABI_MIPSO32)
>> +#define TARGET_SYSCALL_OFFSET 4000
>> +#include "syscall_o32_nr.h"
> 
> Where does this get built?

Ah, I see, next patch.

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

r~





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

* Re: [PATCH 4/4] RFC qemu-binfmt-conf.sh: Add MIPS64 o32 ABI
  2020-11-19 16:17 ` [PATCH 4/4] RFC qemu-binfmt-conf.sh: Add MIPS64 o32 ABI Philippe Mathieu-Daudé
@ 2020-11-19 23:14   ` Richard Henderson
  0 siblings, 0 replies; 23+ messages in thread
From: Richard Henderson @ 2020-11-19 23:14 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Laurent Vivier, Aurelien Jarno

On 11/19/20 8:17 AM, Philippe Mathieu-Daudé wrote:
> ... but this is wrong as the same header matches MIPS32 o32 ELFs...
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---

Yeah, I don't think you'll be able to include this.


r~


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

* Re: [PATCH 3/4] default-configs: Support o32 ABI with 64-bit MIPS CPUs
  2020-11-19 17:13     ` Philippe Mathieu-Daudé
@ 2020-12-12  8:29       ` Fredrik Noring
  0 siblings, 0 replies; 23+ messages in thread
From: Fredrik Noring @ 2020-12-12  8:29 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: David Daney, Mathieu Malaterre, Richard Henderson, qemu-devel,
	Laurent Vivier, YunQiang Su, James Cowgill, Maciej W. Rozycki,
	Jürgen Urban, Aurelien Jarno, Richard Henderson

Hi Philippe,

[ My apologies for the late reply, somehow this thread was treated as spam. ]

On Thu, Nov 19, 2020 at 06:13:20PM +0100, Philippe Mathieu-Daudé wrote:
> Hi Maciej,
> 
> On 11/19/20 5:45 PM, Maciej W. Rozycki wrote:
> > On Thu, 19 Nov 2020, Philippe Mathieu-Daudé wrote:
> > 
> >> MIPS o32 ABI on 64-bit CPUs looks like a ILP32-on-64bit data
> >> model, allowing 64-bit arithmetic and data movement instructions.
> >>
> >> This is the default ABI used by the "Sony Linux Toolkit for
> >> Playstation 2".
> > 
> >  Please don't, not at least with a generic configuration (i.e. make it 
> > unambiguous that this is R5900-specific).  This only works with R5900 
> > because it does not implement the MIPS ISA correctly (e.g. see what $ra is 
> > set to with JAL/JALR/etc. in the kernel mode), and it is not supported by 
> > the standard Linux ABI.  Use n32 instead, which has the same functionality 
> > and is standard (and is also a better ABI in terms of performance).
> 
> I think there are 2 different interests with the R5900. Fredrik sent a
> series to run recent userland/kernel on a PS2. For QEMU, it would be
> easier if these uses the n32 ABI indeed.

Modern (4.x and 5.x) R5900 Linux kernels only support o32, due to R5900
complications with n32. The plan is to reintroduce n32 once o32 is usable.
The R5900 MMI set is another complication for both ABIs (not mentioning
its vector coprocessors).

> This series allows me to run unmodified binaries from the PS2 (built
> maybe 20 years ago, apparently for a kernel 2.2).

Programs in the Debian Black Rhino distribution? I have the impression that
there are at least some R5900 specific instructions in some of them, no?

The 2.x R5900 Linux kernel does (to some degree) support both o32 and n32,
but the implementation had to be reworked (almost entirely) to update it
through Linux 3.x, 4.x and 5.x, and n32 was provisionally dropped to
simplify this. The GNU C library will have to be updated for n32 too.

I'm presently implementing device drivers, that involve the companion
MIPS 3000A I/O processor.

> >  You'd probably need to implement all the R5900 addressing quirks for your 
> > proposed hack to match hardware, or otherwise you'll end up with emulation 
> > that creates its own reality.
> 
> QEMU doesn't model well non-MIPS32 ISA, so the R5900 needs work indeed.
> 
> Laurent, maybe instead of 'mips64o32el-linux-user' we can call this
> target 'r5900o32-linux-user', 'ps2-linux-user' or even 'r5900-ps2-user'
> as Maciej said "it is not supported by the standard Linux ABI."

Would "ps2" in the name imply emulating all PlayStation 2 hardware, as
opposed to "r5900" that is only its main processor? There are also two
interesting vector coprocessors (VPU0 and VPU1) to go with it. :)

> Also I'll see to mark it deprecated so it isn't built by default.

Presently o32 is the main use case for modern 5.x R5900 Linux, and so
regardless of deprecation I have a copy of QEMU supporting it here:

https://github.com/frno7/qemu

We are building modern Gentoo Linux for the R5900, as described in

https://github.com/frno7/linux/issues/33

where R5900 QEMU having o32 is a requirement.

Fredrik


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

* Re: [PATCH 3/4] default-configs: Support o32 ABI with 64-bit MIPS CPUs
  2020-11-19 16:45   ` Maciej W. Rozycki
  2020-11-19 17:13     ` Philippe Mathieu-Daudé
@ 2020-12-12 17:03     ` Fredrik Noring
  1 sibling, 0 replies; 23+ messages in thread
From: Fredrik Noring @ 2020-12-12 17:03 UTC (permalink / raw)
  To: Maciej W. Rozycki
  Cc: qemu-devel, Richard Henderson, Laurent Vivier,
	Philippe Mathieu-Daudé,
	Mathieu Malaterre, YunQiang Su, James Cowgill, David Daney,
	Jürgen Urban, Aurelien Jarno

On Thu, Nov 19, 2020 at 04:45:29PM +0000, Maciej W. Rozycki wrote:
> On Thu, 19 Nov 2020, Philippe Mathieu-Daudé wrote:
> 
> > MIPS o32 ABI on 64-bit CPUs looks like a ILP32-on-64bit data
> > model, allowing 64-bit arithmetic and data movement instructions.
> > 
> > This is the default ABI used by the "Sony Linux Toolkit for
> > Playstation 2".
> 
>  Please don't, not at least with a generic configuration (i.e. make it 
> unambiguous that this is R5900-specific).  This only works with R5900 
> because it does not implement the MIPS ISA correctly (e.g. see what $ra is 
> set to with JAL/JALR/etc. in the kernel mode), and it is not supported by 
> the standard Linux ABI.  Use n32 instead, which has the same functionality 
> and is standard (and is also a better ABI in terms of performance).
> 
>  You'd probably need to implement all the R5900 addressing quirks for your 
> proposed hack to match hardware, or otherwise you'll end up with emulation 
> that creates its own reality.

I agree. Modern Linux kernel and GCC are important too. It seems both o32
and n32, with quirks, are generally accepted, but R5900 MMIs and other
special features are less clear:

For example, given the fact that the 128-bit MMIs are unconditionally
executable on R5900 hardware, a user may be forgiven to believe that they
always work. But unless the Linux kernel restores 128-bit registers in its
operating mode switches, which could be o32, there will be silent data
corruption (and ensuing frustration).

(For this reason I favour full register restores in all operating modes.)

Fredrik


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

* Re: [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs
  2020-11-19 16:17 [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs Philippe Mathieu-Daudé
                   ` (4 preceding siblings ...)
  2020-11-19 16:27 ` [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs no-reply
@ 2020-12-13 15:14 ` Philippe Mathieu-Daudé
  2021-02-09 18:31   ` Philippe Mathieu-Daudé
  5 siblings, 1 reply; 23+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-12-13 15:14 UTC (permalink / raw)
  To: qemu-devel, Laurent Vivier; +Cc: Richard Henderson, Aurelien Jarno

Hi Laurent,

On 11/19/20 5:17 PM, Philippe Mathieu-Daudé wrote:
> This series allow building linux-user emulator to run ELF
> binaries built for the MIPS o32 ABI on 64-bit CPUs (binaries
> produced by Sony Linux Toolkit for Playstation 2 for the
> R5900 CPU).
> 
> The new QEMU binary is named 'qemu-mips64o32'.
> 
> The binfmt config isn't correct, as it matches mipsel/mipsn32el.
> I missed to understand how mipsel (o32) and mipsn32el (n32) are
> differentiated.
> 

> Philippe Mathieu-Daudé (4):
>   linux-user/mips64: Restore setup_frame() for o32 ABI
>   linux-user/mips64: Support o32 ABI syscalls

Until we figure out the issue raised by Maciej in patch 3,
can you review/queue patches 1 and 2 which are independent
of the outcome?

Thanks,

Phil.


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

* Re: [PATCH 1/4] linux-user/mips64: Restore setup_frame() for o32 ABI
  2020-11-19 16:17 ` [PATCH 1/4] linux-user/mips64: Restore setup_frame() for o32 ABI Philippe Mathieu-Daudé
  2020-11-19 23:07   ` Richard Henderson
@ 2020-12-17 10:18   ` Laurent Vivier
  2021-02-11 21:33   ` Laurent Vivier
  2 siblings, 0 replies; 23+ messages in thread
From: Laurent Vivier @ 2020-12-17 10:18 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Richard Henderson, Aurelien Jarno

Le 19/11/2020 à 17:17, Philippe Mathieu-Daudé a écrit :
> 64-bit MIPS targets lost setup_frame() during the refactor in commit
> 8949bef18b9. Restore it declaring TARGET_ARCH_HAS_SETUP_FRAME, to be
> able to build the o32 ABI target.
> 
> Fixes: 8949bef18b9 ("linux-user: move mips/mips64 signal.c parts to mips directory")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  linux-user/mips64/target_signal.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/linux-user/mips64/target_signal.h b/linux-user/mips64/target_signal.h
> index 799f7a668cd..f1f0ed7f706 100644
> --- a/linux-user/mips64/target_signal.h
> +++ b/linux-user/mips64/target_signal.h
> @@ -67,4 +67,8 @@ typedef struct target_sigaltstack {
>  #define TARGET_MINSIGSTKSZ    2048
>  #define TARGET_SIGSTKSZ       8192
>  
> +#if defined(TARGET_ABI_MIPSO32)
> +/* compare linux/arch/mips/kernel/signal.c:setup_frame() */
> +#define TARGET_ARCH_HAS_SETUP_FRAME
> +#endif
>  #endif /* MIPS64_TARGET_SIGNAL_H */
> 

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


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

* Re: [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls
  2020-11-19 16:17 ` [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls Philippe Mathieu-Daudé
  2020-11-19 23:08   ` Richard Henderson
@ 2020-12-17 10:40   ` Laurent Vivier
  2020-12-17 16:10     ` Philippe Mathieu-Daudé
  2021-02-11 21:33   ` Laurent Vivier
  2 siblings, 1 reply; 23+ messages in thread
From: Laurent Vivier @ 2020-12-17 10:40 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Richard Henderson, Aurelien Jarno

Le 19/11/2020 à 17:17, Philippe Mathieu-Daudé a écrit :
> o32 ABI syscalls start at offset 4000.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  linux-user/mips64/syscall_nr.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/linux-user/mips64/syscall_nr.h b/linux-user/mips64/syscall_nr.h
> index 672f2fa51cb..6579421fa63 100644
> --- a/linux-user/mips64/syscall_nr.h
> +++ b/linux-user/mips64/syscall_nr.h
> @@ -1,4 +1,7 @@
> -#ifdef TARGET_ABI_MIPSN32
> +#if defined(TARGET_ABI_MIPSO32)
> +#define TARGET_SYSCALL_OFFSET 4000

The value of the offset is hardcoded in linux-user/mips/meson.build, so either you remove
TARGET_SYSCALL_OFFSET here or you update meson.build to use it.

> +#include "syscall_o32_nr.h"
> +#elif defined(TARGET_ABI_MIPSN32)
>  #define TARGET_SYSCALL_OFFSET 6000
>  #include "syscall_n32_nr.h"
>  #else
> 

Thanks,
Laurent


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

* Re: [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls
  2020-12-17 10:40   ` Laurent Vivier
@ 2020-12-17 16:10     ` Philippe Mathieu-Daudé
  2020-12-17 17:20       ` Fredrik Noring
  2020-12-17 20:14       ` Laurent Vivier
  0 siblings, 2 replies; 23+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-12-17 16:10 UTC (permalink / raw)
  To: Laurent Vivier, qemu-devel
  Cc: Fredrik Noring, Richard Henderson, Maciej W. Rozycki, Aurelien Jarno

On 12/17/20 11:40 AM, Laurent Vivier wrote:
> Le 19/11/2020 à 17:17, Philippe Mathieu-Daudé a écrit :
>> o32 ABI syscalls start at offset 4000.
>>
>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>> ---
>>  linux-user/mips64/syscall_nr.h | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/linux-user/mips64/syscall_nr.h b/linux-user/mips64/syscall_nr.h
>> index 672f2fa51cb..6579421fa63 100644
>> --- a/linux-user/mips64/syscall_nr.h
>> +++ b/linux-user/mips64/syscall_nr.h
>> @@ -1,4 +1,7 @@
>> -#ifdef TARGET_ABI_MIPSN32
>> +#if defined(TARGET_ABI_MIPSO32)
>> +#define TARGET_SYSCALL_OFFSET 4000
> 
> The value of the offset is hardcoded in linux-user/mips/meson.build, so either you remove
> TARGET_SYSCALL_OFFSET here or you update meson.build to use it.

I don't understand what this Meson rule does, as this
doesn't work without this patch...

You can download PS2 64-bit O32 binaries from 2002 (before
the official MIPS TLS ABI) there:
https://sourceforge.net/projects/kernelloader/files/

> 
>> +#include "syscall_o32_nr.h"
>> +#elif defined(TARGET_ABI_MIPSN32)
>>  #define TARGET_SYSCALL_OFFSET 6000
>>  #include "syscall_n32_nr.h"
>>  #else
>>
> 
> Thanks,
> Laurent
> 


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

* Re: [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls
  2020-12-17 16:10     ` Philippe Mathieu-Daudé
@ 2020-12-17 17:20       ` Fredrik Noring
  2020-12-17 20:14       ` Laurent Vivier
  1 sibling, 0 replies; 23+ messages in thread
From: Fredrik Noring @ 2020-12-17 17:20 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: Maciej W. Rozycki, Richard Henderson, Laurent Vivier,
	Aurelien Jarno, qemu-devel

On Thu, Dec 17, 2020 at 05:10:24PM +0100, Philippe Mathieu-Daudé wrote:
> On 12/17/20 11:40 AM, Laurent Vivier wrote:
> > Le 19/11/2020 à 17:17, Philippe Mathieu-Daudé a écrit :
> >> o32 ABI syscalls start at offset 4000.
> >>
> >> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> >> ---
> >>  linux-user/mips64/syscall_nr.h | 5 ++++-
> >>  1 file changed, 4 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/linux-user/mips64/syscall_nr.h b/linux-user/mips64/syscall_nr.h
> >> index 672f2fa51cb..6579421fa63 100644
> >> --- a/linux-user/mips64/syscall_nr.h
> >> +++ b/linux-user/mips64/syscall_nr.h
> >> @@ -1,4 +1,7 @@
> >> -#ifdef TARGET_ABI_MIPSN32
> >> +#if defined(TARGET_ABI_MIPSO32)
> >> +#define TARGET_SYSCALL_OFFSET 4000
> > 
> > The value of the offset is hardcoded in linux-user/mips/meson.build, so either you remove
> > TARGET_SYSCALL_OFFSET here or you update meson.build to use it.
> 
> I don't understand what this Meson rule does, as this
> doesn't work without this patch...
> 
> You can download PS2 64-bit O32 binaries from 2002 (before
> the official MIPS TLS ABI) there:
> https://sourceforge.net/projects/kernelloader/files/

These look rather like 128 bits, as there are R5900 MMIs. For instance,
one can find LQ, SQ, PEXTLB, PEXTLW and so on in /lib/ld.so in
ps2linux_live_v5_pal_netsurf_usb.7z.

There may be other surprises. R5900 Linux 2.x kernels are not IEEE 754
compatible, as opposed to both 5.x kernels and QEMU, for instance.

I would suggest compiling tests with a recent GCC.

Fredrik


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

* Re: [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls
  2020-12-17 16:10     ` Philippe Mathieu-Daudé
  2020-12-17 17:20       ` Fredrik Noring
@ 2020-12-17 20:14       ` Laurent Vivier
  1 sibling, 0 replies; 23+ messages in thread
From: Laurent Vivier @ 2020-12-17 20:14 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Fredrik Noring, Richard Henderson, Aurelien Jarno, Maciej W. Rozycki

Le 17/12/2020 à 17:10, Philippe Mathieu-Daudé a écrit :
> On 12/17/20 11:40 AM, Laurent Vivier wrote:
>> Le 19/11/2020 à 17:17, Philippe Mathieu-Daudé a écrit :
>>> o32 ABI syscalls start at offset 4000.
>>>
>>> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
>>> ---
>>>  linux-user/mips64/syscall_nr.h | 5 ++++-
>>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/linux-user/mips64/syscall_nr.h b/linux-user/mips64/syscall_nr.h
>>> index 672f2fa51cb..6579421fa63 100644
>>> --- a/linux-user/mips64/syscall_nr.h
>>> +++ b/linux-user/mips64/syscall_nr.h
>>> @@ -1,4 +1,7 @@
>>> -#ifdef TARGET_ABI_MIPSN32
>>> +#if defined(TARGET_ABI_MIPSO32)
>>> +#define TARGET_SYSCALL_OFFSET 4000
>>
>> The value of the offset is hardcoded in linux-user/mips/meson.build, so either you remove
>> TARGET_SYSCALL_OFFSET here or you update meson.build to use it.
> 
> I don't understand what this Meson rule does, as this
> doesn't work without this patch...

Yes, you're right, this is hardcoded in mips directory, not in mips64 directory.

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


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

* Re: [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs
  2020-12-13 15:14 ` Philippe Mathieu-Daudé
@ 2021-02-09 18:31   ` Philippe Mathieu-Daudé
  0 siblings, 0 replies; 23+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-02-09 18:31 UTC (permalink / raw)
  To: Laurent Vivier; +Cc: Richard Henderson, qemu-devel, Aurelien Jarno

ping?

On 12/13/20 4:14 PM, Philippe Mathieu-Daudé wrote:
> Hi Laurent,
> 
> On 11/19/20 5:17 PM, Philippe Mathieu-Daudé wrote:
>> This series allow building linux-user emulator to run ELF
>> binaries built for the MIPS o32 ABI on 64-bit CPUs (binaries
>> produced by Sony Linux Toolkit for Playstation 2 for the
>> R5900 CPU).
>>
>> The new QEMU binary is named 'qemu-mips64o32'.
>>
>> The binfmt config isn't correct, as it matches mipsel/mipsn32el.
>> I missed to understand how mipsel (o32) and mipsn32el (n32) are
>> differentiated.
>>
> 
>> Philippe Mathieu-Daudé (4):
>>   linux-user/mips64: Restore setup_frame() for o32 ABI
>>   linux-user/mips64: Support o32 ABI syscalls
> 
> Until we figure out the issue raised by Maciej in patch 3,
> can you review/queue patches 1 and 2 which are independent
> of the outcome?
> 
> Thanks,
> 
> Phil.
> 


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

* Re: [PATCH 1/4] linux-user/mips64: Restore setup_frame() for o32 ABI
  2020-11-19 16:17 ` [PATCH 1/4] linux-user/mips64: Restore setup_frame() for o32 ABI Philippe Mathieu-Daudé
  2020-11-19 23:07   ` Richard Henderson
  2020-12-17 10:18   ` Laurent Vivier
@ 2021-02-11 21:33   ` Laurent Vivier
  2 siblings, 0 replies; 23+ messages in thread
From: Laurent Vivier @ 2021-02-11 21:33 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Richard Henderson, Aurelien Jarno

Le 19/11/2020 à 17:17, Philippe Mathieu-Daudé a écrit :
> 64-bit MIPS targets lost setup_frame() during the refactor in commit
> 8949bef18b9. Restore it declaring TARGET_ARCH_HAS_SETUP_FRAME, to be
> able to build the o32 ABI target.
> 
> Fixes: 8949bef18b9 ("linux-user: move mips/mips64 signal.c parts to mips directory")
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  linux-user/mips64/target_signal.h | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/linux-user/mips64/target_signal.h b/linux-user/mips64/target_signal.h
> index 799f7a668cd..f1f0ed7f706 100644
> --- a/linux-user/mips64/target_signal.h
> +++ b/linux-user/mips64/target_signal.h
> @@ -67,4 +67,8 @@ typedef struct target_sigaltstack {
>  #define TARGET_MINSIGSTKSZ    2048
>  #define TARGET_SIGSTKSZ       8192
>  
> +#if defined(TARGET_ABI_MIPSO32)
> +/* compare linux/arch/mips/kernel/signal.c:setup_frame() */
> +#define TARGET_ARCH_HAS_SETUP_FRAME
> +#endif
>  #endif /* MIPS64_TARGET_SIGNAL_H */
> 

Applied to my linux-user-for-6.0 branch.

Thanks,
Laurent



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

* Re: [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls
  2020-11-19 16:17 ` [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls Philippe Mathieu-Daudé
  2020-11-19 23:08   ` Richard Henderson
  2020-12-17 10:40   ` Laurent Vivier
@ 2021-02-11 21:33   ` Laurent Vivier
  2 siblings, 0 replies; 23+ messages in thread
From: Laurent Vivier @ 2021-02-11 21:33 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel; +Cc: Richard Henderson, Aurelien Jarno

Le 19/11/2020 à 17:17, Philippe Mathieu-Daudé a écrit :
> o32 ABI syscalls start at offset 4000.
> 
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
> ---
>  linux-user/mips64/syscall_nr.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/linux-user/mips64/syscall_nr.h b/linux-user/mips64/syscall_nr.h
> index 672f2fa51cb..6579421fa63 100644
> --- a/linux-user/mips64/syscall_nr.h
> +++ b/linux-user/mips64/syscall_nr.h
> @@ -1,4 +1,7 @@
> -#ifdef TARGET_ABI_MIPSN32
> +#if defined(TARGET_ABI_MIPSO32)
> +#define TARGET_SYSCALL_OFFSET 4000
> +#include "syscall_o32_nr.h"
> +#elif defined(TARGET_ABI_MIPSN32)
>  #define TARGET_SYSCALL_OFFSET 6000
>  #include "syscall_n32_nr.h"
>  #else
> 

Applied to my linux-user-for-6.0 branch.

Thanks,
Laurent



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

end of thread, other threads:[~2021-02-11 21:37 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19 16:17 [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs Philippe Mathieu-Daudé
2020-11-19 16:17 ` [PATCH 1/4] linux-user/mips64: Restore setup_frame() for o32 ABI Philippe Mathieu-Daudé
2020-11-19 23:07   ` Richard Henderson
2020-12-17 10:18   ` Laurent Vivier
2021-02-11 21:33   ` Laurent Vivier
2020-11-19 16:17 ` [PATCH 2/4] linux-user/mips64: Support o32 ABI syscalls Philippe Mathieu-Daudé
2020-11-19 23:08   ` Richard Henderson
2020-11-19 23:09     ` Richard Henderson
2020-12-17 10:40   ` Laurent Vivier
2020-12-17 16:10     ` Philippe Mathieu-Daudé
2020-12-17 17:20       ` Fredrik Noring
2020-12-17 20:14       ` Laurent Vivier
2021-02-11 21:33   ` Laurent Vivier
2020-11-19 16:17 ` [PATCH 3/4] default-configs: Support o32 ABI with 64-bit MIPS CPUs Philippe Mathieu-Daudé
2020-11-19 16:45   ` Maciej W. Rozycki
2020-11-19 17:13     ` Philippe Mathieu-Daudé
2020-12-12  8:29       ` Fredrik Noring
2020-12-12 17:03     ` Fredrik Noring
2020-11-19 16:17 ` [PATCH 4/4] RFC qemu-binfmt-conf.sh: Add MIPS64 o32 ABI Philippe Mathieu-Daudé
2020-11-19 23:14   ` Richard Henderson
2020-11-19 16:27 ` [PATCH 0/4] linux-user: Support o32 ABI with 64-bit MIPS CPUs no-reply
2020-12-13 15:14 ` Philippe Mathieu-Daudé
2021-02-09 18:31   ` Philippe Mathieu-Daudé

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.