qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: Luc Michel <lmichel@kalray.eu>, qemu-devel@nongnu.org
Cc: "Richard Henderson" <richard.henderson@linaro.org>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Eric Blake" <eblake@redhat.com>,
	"Markus Armbruster" <armbru@redhat.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"Chris Wulff" <crwulff@gmail.com>, "Marek Vasut" <marex@denx.de>,
	"Max Filippov" <jcmvbkbc@gmail.com>
Subject: Re: [PATCH v2 2/7] semihosting: add the semihosting_exit_request function
Date: Tue, 21 Jun 2022 15:33:41 +0200	[thread overview]
Message-ID: <a1925dc1-44c3-0729-9ed7-0d6e58d3bbbf@vivier.eu> (raw)
In-Reply-To: <20220621125916.25257-3-lmichel@kalray.eu>

Le 21/06/2022 à 14:59, Luc Michel a écrit :
> Add the semihosting_exit_request function to be used by targets when
> handling an `exit' semihosted syscall. This function calls gdb_exit to
> close existing GDB connections, and qemu_system_shutdown_request with
> the new `guest-semi-exit' exit reason. It sets the QEMU exit status
> given by the exit syscall parameter. Finally it stops the CPU to prevent
> further execution, and exit the CPU loop as the syscall caller expects
> this syscall to not return.
> 
> This function is meant to be used in place of a raw exit() call when
> handling semihosted `exit' syscalls. Such a call is not safe because
> it does not allow other CPU threads to exit properly, leading to e.g.
> at_exit callbacks being called while other CPUs still run. This can lead
> to strange bugs, especially in plugins with a registered at_exit function.
> 
> Signed-off-by: Luc Michel <lmichel@kalray.eu>
> ---
>   qapi/run-state.json            |  4 +++-
>   include/semihosting/semihost.h |  5 +++++
>   semihosting/config.c           | 16 ++++++++++++++++
>   3 files changed, 24 insertions(+), 1 deletion(-)
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>


  reply	other threads:[~2022-06-21 13:36 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-21 12:59 [PATCH v2 0/7] semihosting: proper QEMU exit on semihosted exit syscall Luc Michel
2022-06-21 12:59 ` [PATCH v2 1/7] softmmu: add qemu_[set|get]_exit_status functions Luc Michel
2022-06-21 13:22   ` Laurent Vivier
2022-06-21 12:59 ` [PATCH v2 2/7] semihosting: add the semihosting_exit_request function Luc Michel
2022-06-21 13:33   ` Laurent Vivier [this message]
2022-06-22 16:19   ` Eric Blake
2022-06-22 19:09   ` Peter Maydell
2022-06-23  7:16     ` Luc Michel
2022-06-21 12:59 ` [PATCH v2 3/7] semihosting/arm-compat-semi: use semihosting_exit_request Luc Michel
2022-06-21 13:34   ` Laurent Vivier
2022-06-21 12:59 ` [PATCH v2 4/7] target/m68k: use semihosting_exit_request on semihosted exit syscall Luc Michel
2022-06-21 13:37   ` Laurent Vivier
2022-06-21 12:59 ` [PATCH v2 5/7] target/mips: " Luc Michel
2022-06-21 13:35   ` Laurent Vivier
2022-06-21 12:59 ` [PATCH v2 6/7] target/nios2: " Luc Michel
2022-06-21 13:35   ` Laurent Vivier
2022-06-21 12:59 ` [PATCH v2 7/7] target/xtensa: " Luc Michel
2022-06-21 13:36   ` Laurent Vivier
2022-06-21 14:37 ` [PATCH v2 0/7] semihosting: proper QEMU exit " Richard Henderson
2022-06-22  7:11   ` Luc Michel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a1925dc1-44c3-0729-9ed7-0d6e58d3bbbf@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=alex.bennee@linaro.org \
    --cc=armbru@redhat.com \
    --cc=aurelien@aurel32.net \
    --cc=crwulff@gmail.com \
    --cc=eblake@redhat.com \
    --cc=f4bug@amsat.org \
    --cc=jcmvbkbc@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=lmichel@kalray.eu \
    --cc=marex@denx.de \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=richard.henderson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).