qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 5b0c27: linux-user/elfload: Fix pr_pid values


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] 5b0c27: linux-user/elfload: Fix pr_pid values in core files
Date: Sun, 04 Aug 2024 17:32:58 -0700

  Branch: refs/heads/staging
  Home:   https://github.com/qemu/qemu
  Commit: 5b0c2742c839376b7e03c4654914aaec6a8a7b09
      
https://github.com/qemu/qemu/commit/5b0c2742c839376b7e03c4654914aaec6a8a7b09
  Author: Ilya Leoshkevich <iii@linux.ibm.com>
  Date:   2024-08-05 (Mon, 05 Aug 2024)

  Changed paths:
    M linux-user/elfload.c

  Log Message:
  -----------
  linux-user/elfload: Fix pr_pid values in core files

Analyzing qemu-produced core dumps of multi-threaded apps runs into:

    (gdb) info threads
      [...]
      21   Thread 0x3ff83cc0740 (LWP 9295) warning: Couldn't find 
general-purpose registers in core file.
    <unavailable> in ?? ()

The reason is that all pr_pid values are the same, because the same
TaskState is used for all CPUs when generating NT_PRSTATUS notes.

Fix by using TaskStates associated with individual CPUs.

Cc: qemu-stable@nongnu.org
Fixes: 243c47066253 ("linux-user/elfload: Write corefile elf header in one 
block")
Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240801202340.21845-1-iii@linux.ibm.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 4ec5ebea078ed3a16d6c7e612ff9c2e04ea73931
      
https://github.com/qemu/qemu/commit/4ec5ebea078ed3a16d6c7e612ff9c2e04ea73931
  Author: Clément Léger <cleger@rivosinc.com>
  Date:   2024-08-05 (Mon, 05 Aug 2024)

  Changed paths:
    M include/qemu/osdep.h
    M system/async-teardown.c
    M util/oslib-posix.c

  Log Message:
  -----------
  qemu/osdep: Move close_all_open_fds() to oslib-posix

Move close_all_open_fds() in oslib-posix, rename it
qemu_close_all_open_fds() and export it.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240802145423.3232974-2-cleger@rivosinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: ffa28f9cf503e22bfe621b062d29cbdb9a0aa786
      
https://github.com/qemu/qemu/commit/ffa28f9cf503e22bfe621b062d29cbdb9a0aa786
  Author: Clément Léger <cleger@rivosinc.com>
  Date:   2024-08-05 (Mon, 05 Aug 2024)

  Changed paths:
    M util/oslib-posix.c

  Log Message:
  -----------
  qemu/osdep: Split qemu_close_all_open_fd() and add fallback

In order to make it cleaner, split qemu_close_all_open_fd() logic into
multiple subfunctions (close with close_range(), with /proc/self/fd and
fallback).

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240802145423.3232974-3-cleger@rivosinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: a9b5d6e536c2c728a059b36ad434322dd9329c89
      
https://github.com/qemu/qemu/commit/a9b5d6e536c2c728a059b36ad434322dd9329c89
  Author: Clément Léger <cleger@rivosinc.com>
  Date:   2024-08-05 (Mon, 05 Aug 2024)

  Changed paths:
    M net/tap.c

  Log Message:
  -----------
  net/tap: Factorize fd closing after forking

The same code is used twice to actually close all open file descriptors
after forking. Factorize it in a single place.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240802145423.3232974-4-cleger@rivosinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 7532ca570a449bafe990a00f21ae41bff7709845
      
https://github.com/qemu/qemu/commit/7532ca570a449bafe990a00f21ae41bff7709845
  Author: Clément Léger <cleger@rivosinc.com>
  Date:   2024-08-05 (Mon, 05 Aug 2024)

  Changed paths:
    M include/qemu/osdep.h
    M system/async-teardown.c
    M util/oslib-posix.c

  Log Message:
  -----------
  qemu/osdep: Add excluded fd parameter to qemu_close_all_open_fd()

In order for this function to be usable by tap.c code, add a list of
file descriptors that should not be closed.

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Message-ID: <20240802145423.3232974-5-cleger@rivosinc.com>
[rth: Use max_fd in qemu_close_all_open_fd_close_range]
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 9996a35c6433c0e019a1c05791299db5e63a5db7
      
https://github.com/qemu/qemu/commit/9996a35c6433c0e019a1c05791299db5e63a5db7
  Author: Clément Léger <cleger@rivosinc.com>
  Date:   2024-08-05 (Mon, 05 Aug 2024)

  Changed paths:
    M net/tap.c

  Log Message:
  -----------
  net/tap: Use qemu_close_all_open_fd()

Instead of using a slow implementation to close all open fd after
forking, use qemu_close_all_open_fd().

Signed-off-by: Clément Léger <cleger@rivosinc.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20240802145423.3232974-6-cleger@rivosinc.com>
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


  Commit: 8db6e33d9b6b24b39281dc9e5a2a668f09f4ad7d
      
https://github.com/qemu/qemu/commit/8db6e33d9b6b24b39281dc9e5a2a668f09f4ad7d
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2024-08-05 (Mon, 05 Aug 2024)

  Changed paths:
    M include/qemu/osdep.h
    M linux-user/elfload.c
    M net/tap.c
    M system/async-teardown.c
    M util/oslib-posix.c

  Log Message:
  -----------
  Merge tag 'pull-misc-20240805' of https://gitlab.com/rth7680/qemu into staging

linux-user/elfload: Fix pr_pid values in core files
util: Add qemu_close_all_open_fd
net/tap: Use qemu_close_all_open_fd

# -----BEGIN PGP SIGNATURE-----
#
# iQFRBAABCgA7FiEEekgeeIaLTbaoWgXAZN846K9+IV8FAmawHSsdHHJpY2hhcmQu
# aGVuZGVyc29uQGxpbmFyby5vcmcACgkQZN846K9+IV8mhQgAlNjO1eeeQmgJvKpk
# BwXx7NnXi9d8UZCA5EASK9SQVJC3eYIlMayX9byPmZZ6XJaOBRzgIzm612HkKLYn
# yIqmLb0UhUTT+VKW7Kob/wGslB/PJWSKQ3dvZFaaLMfB6L3BtpwUAFFU5hwkODU/
# TS4qici1W+eW7hInNSH5dgA68UGPcfDBEo4ITW91DbTSZRNz9RP4b2Ak+Wgv30Ux
# 2yEVsP6rBqBSxglbafcywWbYs5sX3EvSUJo4mVm8Ku4zriAf87Y9Da3irpZ4WYgi
# 02f+/GGAv9kiGbf9jPrQTD0O8tmp4Z6JMWxEOfMsCj+KCT2fHSSqcBHTU3RN0guB
# uaxx6w==
# =U5cs
# -----END PGP SIGNATURE-----
# gpg: Signature made Mon 05 Aug 2024 10:30:35 AM AEST
# gpg:                using RSA key 7A481E78868B4DB6A85A05C064DF38E8AF7E215F
# gpg:                issuer "richard.henderson@linaro.org"
# gpg: Good signature from "Richard Henderson <richard.henderson@linaro.org>" 
[ultimate]

* tag 'pull-misc-20240805' of https://gitlab.com/rth7680/qemu:
  net/tap: Use qemu_close_all_open_fd()
  qemu/osdep: Add excluded fd parameter to qemu_close_all_open_fd()
  net/tap: Factorize fd closing after forking
  qemu/osdep: Split qemu_close_all_open_fd() and add fallback
  qemu/osdep: Move close_all_open_fds() to oslib-posix
  linux-user/elfload: Fix pr_pid values in core files

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


Compare: https://github.com/qemu/qemu/compare/f9851d2ffef5...8db6e33d9b6b

To unsubscribe from these emails, change your notification settings at 
https://github.com/qemu/qemu/settings/notifications



reply via email to

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