[PATCH v4 0/5] Risc-V/gdb: replace exit calls with proper shutdown

Clément Chigot posted 5 patches 7 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20231003071427.188697-1-chigot@adacore.com
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Alistair Francis <Alistair.Francis@wdc.com>, Bin Meng <bin.meng@windriver.com>, Palmer Dabbelt <palmer@dabbelt.com>
gdbstub/gdbstub.c          |  5 +++--
gdbstub/softmmu.c          |  6 ++++++
gdbstub/user.c             |  6 ++++++
hw/char/riscv_htif.c       |  5 ++++-
hw/misc/sifive_test.c      |  9 +++++++--
include/gdbstub/syscalls.h |  9 +++++++++
include/sysemu/runstate.h  |  2 ++
include/sysemu/sysemu.h    |  2 +-
softmmu/main.c             |  2 +-
softmmu/runstate.c         | 16 +++++++++++++---
10 files changed, 52 insertions(+), 10 deletions(-)
[PATCH v4 0/5] Risc-V/gdb: replace exit calls with proper shutdown
Posted by Clément Chigot 7 months ago
This series replaces some of the call to exit in hardware used by
Risc-V boards. Otherwise, the gdb connection can be abruptly
disconnected resulting in the last gdb packet "Wxx" being not sent.

For the gdbstub modification, gdb_exit calls ensure that the "Wxx"
packet is sent before exiting. However, some features (see
net/vhost-vdpa.c: vhost_vdpa_cleanup for example) are expecting
that a cleanup is being made before exiting. This, it's probably
safer to follow the same logic here as well.

Difference with v3:
 - Rebase on riscv-to-apply

Clément Chigot (5):
  softmmu: add means to pass an exit code when requesting a shutdown
  softmmu: pass the main loop status to gdb "Wxx" packet
  hw/misc/sifive_test.c: replace exit calls with proper shutdown
  hw/char: riscv_htif: replace exit calls with proper shutdown
  gdbstub: replace exit calls with proper shutdown for softmmu

 gdbstub/gdbstub.c          |  5 +++--
 gdbstub/softmmu.c          |  6 ++++++
 gdbstub/user.c             |  6 ++++++
 hw/char/riscv_htif.c       |  5 ++++-
 hw/misc/sifive_test.c      |  9 +++++++--
 include/gdbstub/syscalls.h |  9 +++++++++
 include/sysemu/runstate.h  |  2 ++
 include/sysemu/sysemu.h    |  2 +-
 softmmu/main.c             |  2 +-
 softmmu/runstate.c         | 16 +++++++++++++---
 10 files changed, 52 insertions(+), 10 deletions(-)

-- 
2.25.1


Re: [PATCH v4 0/5] Risc-V/gdb: replace exit calls with proper shutdown
Posted by Alistair Francis 7 months ago
On Tue, Oct 3, 2023 at 5:14 PM Clément Chigot <chigot@adacore.com> wrote:
>
> This series replaces some of the call to exit in hardware used by
> Risc-V boards. Otherwise, the gdb connection can be abruptly
> disconnected resulting in the last gdb packet "Wxx" being not sent.
>
> For the gdbstub modification, gdb_exit calls ensure that the "Wxx"
> packet is sent before exiting. However, some features (see
> net/vhost-vdpa.c: vhost_vdpa_cleanup for example) are expecting
> that a cleanup is being made before exiting. This, it's probably
> safer to follow the same logic here as well.
>
> Difference with v3:
>  - Rebase on riscv-to-apply
>
> Clément Chigot (5):
>   softmmu: add means to pass an exit code when requesting a shutdown
>   softmmu: pass the main loop status to gdb "Wxx" packet
>   hw/misc/sifive_test.c: replace exit calls with proper shutdown
>   hw/char: riscv_htif: replace exit calls with proper shutdown
>   gdbstub: replace exit calls with proper shutdown for softmmu

Thanks!

Applied to riscv-to-apply.next

Alistair

>
>  gdbstub/gdbstub.c          |  5 +++--
>  gdbstub/softmmu.c          |  6 ++++++
>  gdbstub/user.c             |  6 ++++++
>  hw/char/riscv_htif.c       |  5 ++++-
>  hw/misc/sifive_test.c      |  9 +++++++--
>  include/gdbstub/syscalls.h |  9 +++++++++
>  include/sysemu/runstate.h  |  2 ++
>  include/sysemu/sysemu.h    |  2 +-
>  softmmu/main.c             |  2 +-
>  softmmu/runstate.c         | 16 +++++++++++++---
>  10 files changed, 52 insertions(+), 10 deletions(-)
>
> --
> 2.25.1
>