* [PULL 0/2] linux-user patch queue
@ 2024-11-23 15:07 Richard Henderson
2024-11-23 15:07 ` [PULL 1/2] linux-user: Print tid not pid with strace Richard Henderson
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Richard Henderson @ 2024-11-23 15:07 UTC (permalink / raw)
To: qemu-devel
The following changes since commit 34754a3a627e1937be7f3daaa0c5e73d91c7d9b5:
Update version for v9.2.0-rc1 release (2024-11-20 18:27:48 +0000)
are available in the Git repository at:
https://gitlab.com/rth7680/qemu.git tags/pull-lu-20241122
for you to fetch changes up to d95fd9838b540e69da9b07538ec8ad6ab9eab260:
linux-user: Fix strace output for s390x mmap() (2024-11-22 14:20:38 -0600)
----------------------------------------------------------------
linux-user: Fix strace output for s390x mmap()
linux-user: Print tid not pid with strace
----------------------------------------------------------------
Ilya Leoshkevich (1):
linux-user: Fix strace output for s390x mmap()
J. Neuschäfer (1):
linux-user: Print tid not pid with strace
linux-user/syscall_defs.h | 7 +++++++
linux-user/strace.c | 4 ++--
linux-user/syscall.c | 5 +----
3 files changed, 10 insertions(+), 6 deletions(-)
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PULL 1/2] linux-user: Print tid not pid with strace
2024-11-23 15:07 [PULL 0/2] linux-user patch queue Richard Henderson
@ 2024-11-23 15:07 ` Richard Henderson
2024-11-23 19:42 ` J. Neuschäfer
2024-11-23 15:07 ` [PULL 2/2] linux-user: Fix strace output for s390x mmap() Richard Henderson
2024-11-24 19:07 ` [PULL 0/2] linux-user patch queue Peter Maydell
2 siblings, 1 reply; 5+ messages in thread
From: Richard Henderson @ 2024-11-23 15:07 UTC (permalink / raw)
To: qemu-devel; +Cc: J. Neuschäfer
From: J. Neuschäfer <j.neuschaefer@gmx.net>
This aligns with strace, and is very useful when tracing multi-threaded
programs. The result is the same in single-threaded programs.
Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net>
Message-Id: 20241024-strace-v1-1-56c4161431cd@gmx.net
[rth: Use TaskState.ts_tid via get_task_state()]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/strace.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/linux-user/strace.c b/linux-user/strace.c
index b70eadc19e..f68c5cdc44 100644
--- a/linux-user/strace.c
+++ b/linux-user/strace.c
@@ -4401,7 +4401,7 @@ print_syscall(CPUArchState *cpu_env, int num,
if (!f) {
return;
}
- fprintf(f, "%d ", getpid());
+ fprintf(f, "%d ", get_task_state(env_cpu(cpu_env))->ts_tid);
for (i = 0; i < nsyscalls; i++) {
if (scnames[i].nr == num) {
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PULL 2/2] linux-user: Fix strace output for s390x mmap()
2024-11-23 15:07 [PULL 0/2] linux-user patch queue Richard Henderson
2024-11-23 15:07 ` [PULL 1/2] linux-user: Print tid not pid with strace Richard Henderson
@ 2024-11-23 15:07 ` Richard Henderson
2024-11-24 19:07 ` [PULL 0/2] linux-user patch queue Peter Maydell
2 siblings, 0 replies; 5+ messages in thread
From: Richard Henderson @ 2024-11-23 15:07 UTC (permalink / raw)
To: qemu-devel; +Cc: Ilya Leoshkevich, qemu-stable
From: Ilya Leoshkevich <iii@linux.ibm.com>
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>
Message-ID: <20241120212717.246186-1-iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
linux-user/syscall_defs.h | 7 +++++++
linux-user/strace.c | 2 +-
linux-user/syscall.c | 5 +----
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h
index 0e08dfae3e..faad9147c9 100644
--- a/linux-user/syscall_defs.h
+++ b/linux-user/syscall_defs.h
@@ -2766,4 +2766,11 @@ struct target_open_how_ver0 {
#define RESOLVE_NO_SYMLINKS 0x04
#endif
+#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || \
+ (defined(TARGET_ARM) && defined(TARGET_ABI32)) || \
+ defined(TARGET_M68K) || defined(TARGET_MICROBLAZE) || \
+ defined(TARGET_S390X)
+#define TARGET_ARCH_WANT_SYS_OLD_MMAP
+#endif
+
#endif
diff --git a/linux-user/strace.c b/linux-user/strace.c
index f68c5cdc44..3b744ccd4a 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
true
#else
false
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 0279f23576..1ce4c79784 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -10588,10 +10588,7 @@ static abi_long do_syscall1(CPUArchState *cpu_env, int num, abi_long arg1,
return ret;
#ifdef TARGET_NR_mmap
case TARGET_NR_mmap:
-#if (defined(TARGET_I386) && defined(TARGET_ABI32)) || \
- (defined(TARGET_ARM) && defined(TARGET_ABI32)) || \
- defined(TARGET_M68K) || defined(TARGET_MICROBLAZE) \
- || defined(TARGET_S390X)
+#ifdef TARGET_ARCH_WANT_SYS_OLD_MMAP
{
abi_ulong *v;
abi_ulong v1, v2, v3, v4, v5, v6;
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PULL 1/2] linux-user: Print tid not pid with strace
2024-11-23 15:07 ` [PULL 1/2] linux-user: Print tid not pid with strace Richard Henderson
@ 2024-11-23 19:42 ` J. Neuschäfer
0 siblings, 0 replies; 5+ messages in thread
From: J. Neuschäfer @ 2024-11-23 19:42 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel, J. Neuschäfer
On Sat, Nov 23, 2024 at 09:07:05AM -0600, Richard Henderson wrote:
> From: J. Neuschäfer <j.neuschaefer@gmx.net>
>
> This aligns with strace, and is very useful when tracing multi-threaded
> programs. The result is the same in single-threaded programs.
>
> Signed-off-by: J. Neuschäfer <j.neuschaefer@gmx.net>
> Message-Id: 20241024-strace-v1-1-56c4161431cd@gmx.net
> [rth: Use TaskState.ts_tid via get_task_state()]
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
> linux-user/strace.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/linux-user/strace.c b/linux-user/strace.c
> index b70eadc19e..f68c5cdc44 100644
> --- a/linux-user/strace.c
> +++ b/linux-user/strace.c
> @@ -4401,7 +4401,7 @@ print_syscall(CPUArchState *cpu_env, int num,
> if (!f) {
> return;
> }
> - fprintf(f, "%d ", getpid());
> + fprintf(f, "%d ", get_task_state(env_cpu(cpu_env))->ts_tid);
Ah, that works too. Thanks for taking care of this patch!
J.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PULL 0/2] linux-user patch queue
2024-11-23 15:07 [PULL 0/2] linux-user patch queue Richard Henderson
2024-11-23 15:07 ` [PULL 1/2] linux-user: Print tid not pid with strace Richard Henderson
2024-11-23 15:07 ` [PULL 2/2] linux-user: Fix strace output for s390x mmap() Richard Henderson
@ 2024-11-24 19:07 ` Peter Maydell
2 siblings, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2024-11-24 19:07 UTC (permalink / raw)
To: Richard Henderson; +Cc: qemu-devel
On Sat, 23 Nov 2024 at 15:08, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> The following changes since commit 34754a3a627e1937be7f3daaa0c5e73d91c7d9b5:
>
> Update version for v9.2.0-rc1 release (2024-11-20 18:27:48 +0000)
>
> are available in the Git repository at:
>
> https://gitlab.com/rth7680/qemu.git tags/pull-lu-20241122
>
> for you to fetch changes up to d95fd9838b540e69da9b07538ec8ad6ab9eab260:
>
> linux-user: Fix strace output for s390x mmap() (2024-11-22 14:20:38 -0600)
>
> ----------------------------------------------------------------
> linux-user: Fix strace output for s390x mmap()
> linux-user: Print tid not pid with strace
Applied, thanks.
Please update the changelog at https://wiki.qemu.org/ChangeLog/9.2
for any user-visible changes.
-- PMM
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-11-24 19:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-23 15:07 [PULL 0/2] linux-user patch queue Richard Henderson
2024-11-23 15:07 ` [PULL 1/2] linux-user: Print tid not pid with strace Richard Henderson
2024-11-23 19:42 ` J. Neuschäfer
2024-11-23 15:07 ` [PULL 2/2] linux-user: Fix strace output for s390x mmap() Richard Henderson
2024-11-24 19:07 ` [PULL 0/2] linux-user patch queue Peter Maydell
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.