[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 00/18] Stop all qemu-cpu threads on a breakpoint
From: |
Ilya Leoshkevich |
Subject: |
Re: [PATCH 00/18] Stop all qemu-cpu threads on a breakpoint |
Date: |
Wed, 25 Sep 2024 09:43:41 +0200 |
User-agent: |
Evolution 3.52.4 (3.52.4-1.fc40) |
On Tue, 2024-09-24 at 13:46 +0200, Richard Henderson wrote:
> On 9/23/24 18:12, Ilya Leoshkevich wrote:
> > Hi,
> >
> > On reporting a breakpoint in a non-non-stop mode, GDB remotes must
> > stop
> > all threads. Currently qemu-user doesn't do that, breaking the
> > debugging session for at least two reasons: concurrent access to
> > the
> > GDB socket, and an assertion within GDB [1].
> >
> > This series fixes this by importing pause_all_vcpus() from qemu-
> > system.
> > This in turn requires introducing BQL and a few stubs to qemu-user.
>
> I would have expected you to reuse (some portion of) start_exclusive,
> which is already
> part of qemu-user. Is there a reason you chose a solution which
> requires...
>
> > replay: Add replay_mutex_{lock,unlock}() stubs for qemu-user
> > qemu-timer: Provide qemu_clock_enable() stub for qemu-user
> > cpu: Use BQL in qemu-user
>
> all sorts of other infrastructure?
>
>
> r~
I don't think start_exclusive() would protect the gdb socket from
concurrent accesses (e.g., if two threads are simultaneously stopped).
I have a patch [1] that introduces a big gdbstub lock for that, but it
looks more complex than just extending BQL to qemu-user. Also, the
BQL-based pause/resume code already works for the system mode and is
well tested.
[1]
https://gitlab.com/iii-i/qemu/-/commit/0944716218820f8bdfdcf80acc6c39a48b91670c
- [PATCH 01/18] gdbstub: Make gdb_get_char() static, (continued)
- [PATCH 01/18] gdbstub: Make gdb_get_char() static, Ilya Leoshkevich, 2024/09/23
- [PATCH 09/18] qemu-timer: Provide qemu_clock_enable() stub for qemu-user, Ilya Leoshkevich, 2024/09/23
- [PATCH 06/18] qemu-thread: Introduce QEMU_MUTEX_INITIALIZER, Ilya Leoshkevich, 2024/09/23
- [PATCH 18/18] tests/tcg: Stress test thread breakpoints, Ilya Leoshkevich, 2024/09/23
- [PATCH 13/18] cpu: Implement cpu_thread_is_idle() for qemu-user, Ilya Leoshkevich, 2024/09/23
- [PATCH 07/18] qemu-thread: Introduce QEMU_COND_INITIALIZER, Ilya Leoshkevich, 2024/09/23
- [PATCH 11/18] accel/tcg: Unify user implementations of qemu_cpu_kick(), Ilya Leoshkevich, 2024/09/23
- [PATCH 17/18] gdbstub: Pause all CPUs before sending stop replies, Ilya Leoshkevich, 2024/09/23
- Re: [PATCH 00/18] Stop all qemu-cpu threads on a breakpoint, Ilya Leoshkevich, 2024/09/23
- Re: [PATCH 00/18] Stop all qemu-cpu threads on a breakpoint, Richard Henderson, 2024/09/25
- Re: [PATCH 00/18] Stop all qemu-cpu threads on a breakpoint,
Ilya Leoshkevich <=