qemu-stable
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] linux-user: Fix strace output for s390x mmap()


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v2] linux-user: Fix strace output for s390x mmap()
Date: Thu, 21 Nov 2024 11:07:44 +0100
User-agent: Mozilla Thunderbird

On 21/11/24 10:26, iii wrote:
On 2024-11-21 10:00, Philippe Mathieu-Daudé wrote:
On 20/11/24 22:26, Ilya Leoshkevich wrote:
print_mmap() assumes that mmap() receives arguments via memory if
mmap2() is present. s390x (as opposed to s390) does not fit this
pattern: it does not have mmap2(), but mmap() still receives arguments
via memory.

Fix by sharing the detection logic between syscall.c and strace.c.

Cc: qemu-stable@nongnu.org
Fixes: d971040c2d16 ("linux-user: Fix strace output for old_mmap")
Suggested-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
---

v1: https://lore.kernel.org/qemu-devel/20241119211138.148806-1-iii@linux.ibm.com/
v1 -> v2: Share the detection logic between syscall.c and strace.c
           (Richard).

  linux-user/strace.c       | 2 +-
  linux-user/syscall.c      | 5 +----
  linux-user/syscall_defs.h | 7 +++++++
  3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/linux-user/strace.c b/linux-user/strace.c
index b70eadc19ef..9c55f39b095 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -3971,7 +3971,7 @@ print_mmap(CPUArchState *cpu_env, const struct syscallname *name,
  {
      return print_mmap_both(cpu_env, name, arg0, arg1, arg2, arg3,
                             arg4, arg5,
-#if defined(TARGET_NR_mmap2)
+#ifdef TARGET_ARCH_WANT_SYS_OLD_MMAP

We still want to print for mmap2, so:

  #if defined(TARGET_NR_mmap2) || defined(TARGET_ARCH_WANT_SYS_OLD_MMAP)

                              true
  #else
                              false

mmap2() has its own flow from what I can see:

print_mmap2()
   print_mmap_both(..., is_old_mmap=false)

It should not call print_mmap(), which I'm changing here.

[...]

If so, better to clean that in a previous patch.

Cc'ing Helge since I'm a bit confused by commit d971040c2d intent
("linux-user: Fix strace output for old_mmap").




reply via email to

[Prev in Thread] Current Thread [Next in Thread]