From nobody Tue May 21 23:47:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kalray.eu ARC-Seal: i=1; a=rsa-sha256; t=1655816955; cv=none; d=zohomail.com; s=zohoarc; b=ccSeOqKrVInapnsQ8ph75rgnynonYUKVDLGVxtLEXwfkZYbeca+XF3iJ0UuoOCOznfk7t2wTEM+t49ckyAYkMllB6bltH59UQ5ZCmI8pZ7224pNnHJypWWDmep3Pz+t7rJVGw/KOyC5P910Lv5q2MGSkeoAl2uls72OYQTKSEWM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655816955; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=CHdUa5EUCvF0MuxJdZ5rZNLhaXwYjEDCGzXTOWTxyJ0=; b=fACi7AVNNy7mxZNYVmNXyIJRWVYtIWZatd/ymeyYwE8XJLlA3HrKKTttabRYQq8Wy7K1OmYRH7O4EnH3d2cLrCrlvJsNffdxel3aV2NcXlL4NXxmZjcXSTpI7GfbjikoDEdai2h1/rggfFhkUXQsdHcX51cjYwjUWDN0mRJBnC4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 16558169550611007.4256785019386; Tue, 21 Jun 2022 06:09:15 -0700 (PDT) Received: from localhost ([::1]:42816 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3dd3-0008SX-Tw for importer@patchew.org; Tue, 21 Jun 2022 09:09:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55198) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTo-0007UY-MN for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:40 -0400 Received: from smtpout30.security-mail.net ([85.31.212.38]:60586) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTl-0005Fc-Ua for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:40 -0400 Received: from localhost (localhost [127.0.0.1]) by fx308.security-mail.net (Postfix) with ESMTP id 7C5495F46EF for ; Tue, 21 Jun 2022 14:59:36 +0200 (CEST) Received: from fx308 (localhost [127.0.0.1]) by fx308.security-mail.net (Postfix) with ESMTP id BE7845F4624; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu (unknown [217.181.231.53]) by fx308.security-mail.net (Postfix) with ESMTPS id 3D7DB5F460A; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTPS id 1C1CD27E04EF; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 004D627E04E7; Tue, 21 Jun 2022 14:59:31 +0200 (CEST) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Ck7MY46QggJy; Tue, 21 Jun 2022 14:59:31 +0200 (CEST) Received: from ws2101.lin.mbt.kalray.eu (unknown [192.168.36.68]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id D22D227E04D7; Tue, 21 Jun 2022 14:59:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalray.eu; s=sec-sig-email; t=1655816376; bh=8AoLDKKMDfz7XgrOQZjn193j+3Nd9LcsodtAEQaqICs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=eIc49C1r7IZ1gTPKGfM6rX42wRPW7MHuCFyik7ra1AnSn871QbI7CroCIhca62upn 6dMxIMAn8DS31459VpobgSIV2zuOtPq555FhI2pvubLuiG0L3ppp5t+wxNGc7cpQ15 mLM0mjB/aMAoX+ljN8DzJXMGlVoxJcOb9N8MqNYo= X-Virus-Scanned: E-securemail Secumail-id: <83fd.62b1c0b4.3d086.0> DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu 004D627E04E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1655816372; bh=CHdUa5EUCvF0MuxJdZ5rZNLhaXwYjEDCGzXTOWTxyJ0=; h=From:To:Date:Message-Id; b=e5VZlIMlViugRB3Uqgg6etitTNXbasH044jOQNarMlAgFSVqg/zJj2/Hb7gv8BMzf yoXv0lfYBjjMqhW+mrfidmkelrvibyEJAG3FFZIirdCbsk7OJ/VgI96fXpMSchA6H/ HSeOH0bxnWmKsQ7ezPJG6R7ck6u8l97ZZ2pVb8mc= From: Luc Michel To: qemu-devel@nongnu.org Cc: Luc Michel , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , Markus Armbruster , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Chris Wulff , Marek Vasut , Max Filippov Subject: [PATCH v2 1/7] softmmu: add qemu_[set|get]_exit_status functions Date: Tue, 21 Jun 2022 14:59:10 +0200 Message-Id: <20220621125916.25257-2-lmichel@kalray.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220621125916.25257-1-lmichel@kalray.eu> References: <20220621125916.25257-1-lmichel@kalray.eu> X-Virus-Scanned: by Secumail Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=85.31.212.38; envelope-from=lmichel@kalray.eu; helo=smtpout30.security-mail.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @kalray.eu) X-ZM-MESSAGEID: 1655816956902100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add the two function qemu_set_exit_status() and qemu_get_exit_status(). Use qemu_get_exit_status() in main instead of 0 as the return value. This is in preparation for the semihosting exit request implementation. Signed-off-by: Luc Michel Reviewed-by: Laurent Vivier --- include/sysemu/sysemu.h | 2 ++ softmmu/main.c | 2 +- softmmu/runstate.c | 13 ++++++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h index 812f66a31a..49b6970d0e 100644 --- a/include/sysemu/sysemu.h +++ b/include/sysemu/sysemu.h @@ -103,10 +103,12 @@ void qemu_boot_set(const char *boot_order, Error **er= rp); bool defaults_enabled(void); =20 void qemu_init(int argc, char **argv, char **envp); void qemu_main_loop(void); void qemu_cleanup(void); +void qemu_set_exit_status(int status); +int qemu_get_exit_status(void); =20 extern QemuOptsList qemu_legacy_drive_opts; extern QemuOptsList qemu_common_drive_opts; extern QemuOptsList qemu_drive_opts; extern QemuOptsList bdrv_runtime_opts; diff --git a/softmmu/main.c b/softmmu/main.c index c00432ff09..67b4bb111e 100644 --- a/softmmu/main.c +++ b/softmmu/main.c @@ -34,11 +34,11 @@ int qemu_main(int argc, char **argv, char **envp) { qemu_init(argc, argv, envp); qemu_main_loop(); qemu_cleanup(); =20 - return 0; + return qemu_get_exit_status(); } =20 #ifndef CONFIG_COCOA int main(int argc, char **argv) { diff --git a/softmmu/runstate.c b/softmmu/runstate.c index fac7b63259..a86ffa91e5 100644 --- a/softmmu/runstate.c +++ b/softmmu/runstate.c @@ -336,10 +336,11 @@ void vm_state_notify(bool running, RunState state) } =20 static ShutdownCause reset_requested; static ShutdownCause shutdown_requested; static int shutdown_signal; +static int exit_status; static pid_t shutdown_pid; static int powerdown_requested; static int debug_requested; static int suspend_requested; static WakeupReason wakeup_reason; @@ -351,10 +352,20 @@ static NotifierList wakeup_notifiers =3D NOTIFIER_LIST_INITIALIZER(wakeup_notifiers); static NotifierList shutdown_notifiers =3D NOTIFIER_LIST_INITIALIZER(shutdown_notifiers); static uint32_t wakeup_reason_mask =3D ~(1 << QEMU_WAKEUP_REASON_NONE); =20 +void qemu_set_exit_status(int status) +{ + exit_status =3D status; +} + +int qemu_get_exit_status(void) +{ + return exit_status; +} + ShutdownCause qemu_shutdown_requested_get(void) { return shutdown_requested; } =20 @@ -779,11 +790,11 @@ void qemu_init_subsystems(void) } =20 =20 void qemu_cleanup(void) { - gdb_exit(0); + gdb_exit(qemu_get_exit_status()); =20 /* * cleaning up the migration object cancels any existing migration * try to do this early so that it also stops using devices. */ --=20 2.17.1 From nobody Tue May 21 23:47:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kalray.eu ARC-Seal: i=1; a=rsa-sha256; t=1655816934; cv=none; d=zohomail.com; s=zohoarc; b=J14QKcIC/N92KCiRbrv8TOT1jasg0XN77f68EsbsaJzoFNibrhJzN7k8Hv2LZf9ooaJajn6hY+Cp8XJcYtV9vqNyfAhgJJ+/UfWd6c52lopzih0cREKzCK+ImGP3J83ldws+YlnxBjbDCT9d5o2X1WaOW7N4w//j5optRH7HPrg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655816934; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=mLTrh3fiun7GkKJwThgXSRhdmxYNZJ8lsvtbYcZqR74=; b=SNHNrgC0FLKT859kxLzVihLI2H+Be2G0tdPLHbnIes/hmzVQb68ICwedh89py14P/28A1afz6UHaXDEAK/7YhwsK7Du6jIce5ez4QS7oeC4Eo3TV0H1OJLKTGvoqUVVfYjdQ8OU7POfxYY8CDm8nJLQq4WC75mJQAZbNVvaR0Bc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655816934283641.7716672229259; Tue, 21 Jun 2022 06:08:54 -0700 (PDT) Received: from localhost ([::1]:41254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3dcj-0007JG-6i for importer@patchew.org; Tue, 21 Jun 2022 09:08:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTn-0007Sc-An for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:39 -0400 Received: from smtpout30.security-mail.net ([85.31.212.38]:60438) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTl-0005FS-25 for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:38 -0400 Received: from localhost (localhost [127.0.0.1]) by fx308.security-mail.net (Postfix) with ESMTP id 746375F4687 for ; Tue, 21 Jun 2022 14:59:34 +0200 (CEST) Received: from fx308 (localhost [127.0.0.1]) by fx308.security-mail.net (Postfix) with ESMTP id BB7AD5F4620; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu (unknown [217.181.231.53]) by fx308.security-mail.net (Postfix) with ESMTPS id 487825F460C; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTPS id 26E5527E04D7; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 082AC27E04D6; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yOdLYC9SD72F; Tue, 21 Jun 2022 14:59:31 +0200 (CEST) Received: from ws2101.lin.mbt.kalray.eu (unknown [192.168.36.68]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id E4F9D27E04DA; Tue, 21 Jun 2022 14:59:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalray.eu; s=sec-sig-email; t=1655816374; bh=SfEW9suPlkpGJlWDKl3GzFUdjV5M+7KNQtrNHmkhoSo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=qi3YBFarl8Hfo4u57PbucBzwGVRLQyMBAnqBG83BBky0d0sPdod9CbkFYKMb9fX8+ RgQesnXljuYPpah2OjpM3sIEv/+uahVIHMQVuduV22rkhpbUTpth+J2oI45b3CcSIp OLFXGEwufiy6ea8Km/bSx1ZA79aR73WHWAfKr/kM= X-Virus-Scanned: E-securemail Secumail-id: <8268.62b1c0b4.47c47.0> DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu 082AC27E04D6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1655816372; bh=mLTrh3fiun7GkKJwThgXSRhdmxYNZJ8lsvtbYcZqR74=; h=From:To:Date:Message-Id; b=HXEkOp9hYB7HV8Tk/7JGz3QJQclfzO1ZuqpQNEUvoSTI7w2fbn66SO7zcbSHPgHvu M+6uJjAkuuXVzb54loHXMEp8wRIIyOZwXBcSJQlFIBlphtAmrADXTb7goB0tRj1t0B +PmnxhIaH7Z9igHexfWYvXjdfZ5S1QV4LZTi4Hjw= From: Luc Michel To: qemu-devel@nongnu.org Cc: Luc Michel , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , Markus Armbruster , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Chris Wulff , Marek Vasut , Max Filippov Subject: [PATCH v2 2/7] semihosting: add the semihosting_exit_request function Date: Tue, 21 Jun 2022 14:59:11 +0200 Message-Id: <20220621125916.25257-3-lmichel@kalray.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220621125916.25257-1-lmichel@kalray.eu> References: <20220621125916.25257-1-lmichel@kalray.eu> X-Virus-Scanned: by Secumail Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=85.31.212.38; envelope-from=lmichel@kalray.eu; helo=smtpout30.security-mail.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @kalray.eu) X-ZM-MESSAGEID: 1655816935182100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Laurent Vivier --- qapi/run-state.json | 4 +++- include/semihosting/semihost.h | 5 +++++ semihosting/config.c | 16 ++++++++++++++++ 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/qapi/run-state.json b/qapi/run-state.json index 6e2162d7b3..a4f08dd32e 100644 --- a/qapi/run-state.json +++ b/qapi/run-state.json @@ -80,20 +80,22 @@ # @guest-reset: Guest reset request, and command line turns that into # a shutdown # # @guest-panic: Guest panicked, and command line turns that into a shutdown # +# @guest-semi-exit: Guest exit request via a semi-hosted exit syscall +# # @subsystem-reset: Partial guest reset that does not trigger QMP events a= nd # ignores --no-reboot. This is useful for sanitizing # hypercalls on s390 that are used during kexec/kdump/bo= ot # ## { 'enum': 'ShutdownCause', # Beware, shutdown_caused_by_guest() depends on enumeration order 'data': [ 'none', 'host-error', 'host-qmp-quit', 'host-qmp-system-reset', 'host-signal', 'host-ui', 'guest-shutdown', 'guest-reset', - 'guest-panic', 'subsystem-reset'] } + 'guest-panic', 'guest-semi-exit', 'subsystem-reset'] } =20 ## # @StatusInfo: # # Information about VCPU run state diff --git a/include/semihosting/semihost.h b/include/semihosting/semihost.h index 0c55ade3ac..63b5641241 100644 --- a/include/semihosting/semihost.h +++ b/include/semihosting/semihost.h @@ -54,10 +54,14 @@ static inline const char *semihosting_get_cmdline(void) =20 static inline Chardev *semihosting_get_chardev(void) { return NULL; } +static inline G_NORETURN void semihosting_exit_request(int status) +{ + g_assert_not_reached(); +} static inline void qemu_semihosting_console_init(void) { } #else /* !CONFIG_USER_ONLY */ bool semihosting_enabled(void); @@ -65,10 +69,11 @@ SemihostingTarget semihosting_get_target(void); const char *semihosting_get_arg(int i); int semihosting_get_argc(void); const char *semihosting_get_cmdline(void); void semihosting_arg_fallback(const char *file, const char *cmd); Chardev *semihosting_get_chardev(void); +G_NORETURN void semihosting_exit_request(int status); /* for vl.c hooks */ void qemu_semihosting_enable(void); int qemu_semihosting_config_options(const char *opt); void qemu_semihosting_connect_chardevs(void); void qemu_semihosting_console_init(void); diff --git a/semihosting/config.c b/semihosting/config.c index 3afacf54ab..e60a32a3f7 100644 --- a/semihosting/config.c +++ b/semihosting/config.c @@ -22,10 +22,15 @@ #include "qemu/option.h" #include "qemu/config-file.h" #include "qemu/error-report.h" #include "semihosting/semihost.h" #include "chardev/char.h" +#include "sysemu/sysemu.h" +#include "sysemu/runstate.h" +#include "sysemu/cpus.h" +#include "exec/exec-all.h" +#include "exec/gdbstub.h" =20 QemuOptsList qemu_semihosting_config_opts =3D { .name =3D "semihosting-config", .merge_lists =3D true, .implied_opt_name =3D "enable", @@ -183,5 +188,16 @@ void qemu_semihosting_connect_chardevs(void) exit(1); } semihosting.chardev =3D chr; } } + +void semihosting_exit_request(int status) +{ + qemu_set_exit_status(status); + qemu_system_shutdown_request(SHUTDOWN_CAUSE_GUEST_SEMI_EXIT); + cpu_stop_current(); + + current_cpu->exception_index =3D EXCP_HLT; + current_cpu->halted =3D 1; + cpu_loop_exit(current_cpu); +} --=20 2.17.1 From nobody Tue May 21 23:47:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kalray.eu ARC-Seal: i=1; a=rsa-sha256; t=1655816666; cv=none; d=zohomail.com; s=zohoarc; b=YJKum1ixrNEwcB1dt1L8yBhWfzM3gRzZ9vCCxfex7dE5gcCVZCqkO2rBXWAPpHAdc1lOcyvkhUC3EVSYNq+0De8wE6r3idh82g4jvKffsGr+nMaX7sBobg4gTvvLN5xsJbw7Vx4lxv03rK7YBqQbuuhkU3ZrXIASk5clKN56xNY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655816666; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=lXnnbnuAZ1izT8Grm0O8SSDegE9ud6CZeXY6J795CTc=; b=BSWituySsnzLv/sgS4dO8nWilcfMAZQnxHySJpOeEVC58FOVHryhPbzmJYzWpZPnCJEh6hVGkwIIEWx48lBfMMCNw3WabT8jhQW2dc10CCh5OpvxMaQ4J4zCodpGG4rmkZyI+IvXXuLaGSA2GR/ykRudMcgAPh6hn+SHcOrnDbA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655816666437199.472566704761; Tue, 21 Jun 2022 06:04:26 -0700 (PDT) Received: from localhost ([::1]:34356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3dYM-00022Y-MT for importer@patchew.org; Tue, 21 Jun 2022 09:04:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTn-0007SI-9A for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:39 -0400 Received: from smtpout30.security-mail.net ([85.31.212.36]:33665) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTl-0005FR-14 for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:38 -0400 Received: from localhost (localhost [127.0.0.1]) by fx301.security-mail.net (Postfix) with ESMTP id 7993424BD0EE for ; Tue, 21 Jun 2022 14:59:34 +0200 (CEST) Received: from fx301 (localhost [127.0.0.1]) by fx301.security-mail.net (Postfix) with ESMTP id E58CB24BD02F; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu (unknown [217.181.231.53]) by fx301.security-mail.net (Postfix) with ESMTPS id 6348724BD034; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTPS id 402AC27E04DD; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 1A0FC27E04D9; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Ndm2hQNEER2W; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from ws2101.lin.mbt.kalray.eu (unknown [192.168.36.68]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id EE8EC27E04DD; Tue, 21 Jun 2022 14:59:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalray.eu; s=sec-sig-email; t=1655816374; bh=Vi1A8wBnLovlrTEdXogPrB/Mx/jPqmMzAtBqZuqPZn8=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=4yTZDrWhGlDt6VJFJZA+ZGI5qm7lQX9Ng4CdMvJaZ6rY2SfFkkVMdalmUd4uuYjSL KRjbz/fxj80EY381pCRIIu9aB4AV1DRHh5WaaC3N3v3YWOU8CfP2qPy4oaME3aIXgl A6W00Gt8gtGTIxtz3gyr9LUaqD5djYt6qeUYc+7k= X-Virus-Scanned: E-securemail Secumail-id: DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu 1A0FC27E04D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1655816372; bh=lXnnbnuAZ1izT8Grm0O8SSDegE9ud6CZeXY6J795CTc=; h=From:To:Date:Message-Id; b=GGGRn102NB/6MSMbhncDqQl9hqKp6IhKYKvjl/wKa+TwfloP01dzs4DtwUxuESpVy umxHF5i6oLg0oBKbcnoMBiIjL2uN59/22pg2C4Bt77HHiJJJCPtWYN644TmwRjaLyW v8cFFXPc/6p0uPJoVRzdBZ0zTYypwlfCBNLrYwOo= From: Luc Michel To: qemu-devel@nongnu.org Cc: Luc Michel , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , Markus Armbruster , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Chris Wulff , Marek Vasut , Max Filippov Subject: [PATCH v2 3/7] semihosting/arm-compat-semi: use semihosting_exit_request Date: Tue, 21 Jun 2022 14:59:12 +0200 Message-Id: <20220621125916.25257-4-lmichel@kalray.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220621125916.25257-1-lmichel@kalray.eu> References: <20220621125916.25257-1-lmichel@kalray.eu> X-Virus-Scanned: by Secumail Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=85.31.212.36; envelope-from=lmichel@kalray.eu; helo=smtpout30.security-mail.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @kalray.eu) X-ZM-MESSAGEID: 1655816669723100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel Reviewed-by: Laurent Vivier --- semihosting/arm-compat-semi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/semihosting/arm-compat-semi.c b/semihosting/arm-compat-semi.c index b6ddaf863a..fad5116f3c 100644 --- a/semihosting/arm-compat-semi.c +++ b/semihosting/arm-compat-semi.c @@ -1253,12 +1253,11 @@ target_ulong do_common_semihosting(CPUState *cs) * allow the guest to specify the exit status code. * Everything else is considered an error. */ ret =3D (args =3D=3D ADP_Stopped_ApplicationExit) ? 0 : 1; } - gdb_exit(ret); - exit(ret); + semihosting_exit_request(ret); case TARGET_SYS_ELAPSED: elapsed =3D get_clock() - clock_start; if (sizeof(target_ulong) =3D=3D 8) { SET_ARG(0, elapsed); } else { --=20 2.17.1 From nobody Tue May 21 23:47:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kalray.eu ARC-Seal: i=1; a=rsa-sha256; t=1655816684; cv=none; d=zohomail.com; s=zohoarc; b=TRrvfvGEL4R6AT47luObgVgq4PExtlFw/bSEx4j3ch+NMgYdOg+pNDCaTFixDycplw7aIJcJKoV3ly5wy0Kqf9ulDam16qpg0Z2lqGQA/njCJQ+vNxx6GoJGUh/kMIhVRmwrgtywnGQ7gPFJcmiL1/i73uhhqkn7BvO1zK+4E4I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655816684; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=pqO+2rhibMGYfEqFI+8R0ermok68nZKn3dLnJ/SKXcM=; b=TBDSUXQzkJHppfnGt156g/zMo9AWRLDEmX+8nJ/iXnYComeVvWOl4yNJmUVL4IxSiViTorRwLLgn/w3s75bBh9Sz3N5lDCJZmWWwEZrdWb90SVXMfsf/DeeZsQ+g72mh+w3PTHqqRLYqQkPPyrgWS9XmFMDi2J9F0Dujj3IQWOM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655816684391449.5677171270356; Tue, 21 Jun 2022 06:04:44 -0700 (PDT) Received: from localhost ([::1]:34590 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3dYe-0002FI-Il for importer@patchew.org; Tue, 21 Jun 2022 09:04:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55200) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTo-0007Us-Md for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:40 -0400 Received: from smtpout140.security-mail.net ([85.31.212.145]:55642) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTm-0005Fk-VV for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:40 -0400 Received: from localhost (localhost [127.0.0.1]) by fx405.security-mail.net (Postfix) with ESMTP id 7844D3237EE for ; Tue, 21 Jun 2022 14:59:37 +0200 (CEST) Received: from fx405 (localhost [127.0.0.1]) by fx405.security-mail.net (Postfix) with ESMTP id 20B763237FE; Tue, 21 Jun 2022 14:59:33 +0200 (CEST) Received: from zimbra2.kalray.eu (unknown [217.181.231.53]) by fx405.security-mail.net (Postfix) with ESMTPS id 70F923237DE; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTPS id 4A40627E04ED; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 2AA1227E04DA; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id JC5pIfsblZHt; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from ws2101.lin.mbt.kalray.eu (unknown [192.168.36.68]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id 0DAD227E04ED; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalray.eu; s=sec-sig-email; t=1655816377; bh=T95sWA5zxe4fWS53roiVVcEs3JYFnRvZjn+m8zQR/+I=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KiwOSynB/9pD5NKSeZbVf5fGdfa8j2CY0KNKBkJkyEzI5w8NBnUoxusbTUh3spK6L fg9EmMDPMvuBc9mcJ4OmfSlN314lmsbhiGU9x4Qq0JTFwwOkzBWkasshXck8Q7lxBu oT41XdFuDMMQoNxf0a7LVGbGe4YOdyIsGfTEwvHE= X-Virus-Scanned: E-securemail Secumail-id: DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu 2AA1227E04DA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1655816372; bh=pqO+2rhibMGYfEqFI+8R0ermok68nZKn3dLnJ/SKXcM=; h=From:To:Date:Message-Id; b=UfhRlLhajskIWvo78FlDaQA2qTw00tnYUifN/YidOIhzmpMsrPLgUXFTkSMWQqnK+ bMAG3ddGi6KtgzxEqmhqC1GtlJ7yrOO9ySB+Fe5C/PINb1Px95bz5xvKPUUEz/udYf r8/9iME8ndFRgo2gSKw8DE5ZALMCfgcEM+ebYfxU= From: Luc Michel To: qemu-devel@nongnu.org Cc: Luc Michel , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , Markus Armbruster , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Chris Wulff , Marek Vasut , Max Filippov Subject: [PATCH v2 4/7] target/m68k: use semihosting_exit_request on semihosted exit syscall Date: Tue, 21 Jun 2022 14:59:13 +0200 Message-Id: <20220621125916.25257-5-lmichel@kalray.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220621125916.25257-1-lmichel@kalray.eu> References: <20220621125916.25257-1-lmichel@kalray.eu> X-Virus-Scanned: by Secumail Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=85.31.212.145; envelope-from=lmichel@kalray.eu; helo=smtpout140.security-mail.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @kalray.eu) X-ZM-MESSAGEID: 1655816687197100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel Reviewed-by: Laurent Vivier --- target/m68k/m68k-semi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/m68k/m68k-semi.c b/target/m68k/m68k-semi.c index 37343d47e2..b3de3c6874 100644 --- a/target/m68k/m68k-semi.c +++ b/target/m68k/m68k-semi.c @@ -27,10 +27,11 @@ #else #include "exec/softmmu-semi.h" #include "hw/boards.h" #endif #include "qemu/log.h" +#include "semihosting/semihost.h" =20 #define HOSTED_EXIT 0 #define HOSTED_INIT_SIM 1 #define HOSTED_OPEN 2 #define HOSTED_CLOSE 3 @@ -193,12 +194,11 @@ void do_m68k_semihosting(CPUM68KState *env, int nr) uint32_t result; =20 args =3D env->dregs[1]; switch (nr) { case HOSTED_EXIT: - gdb_exit(env->dregs[0]); - exit(env->dregs[0]); + semihosting_exit_request(env->dregs[0]); case HOSTED_OPEN: GET_ARG(0); GET_ARG(1); GET_ARG(2); GET_ARG(3); --=20 2.17.1 From nobody Tue May 21 23:47:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kalray.eu ARC-Seal: i=1; a=rsa-sha256; t=1655816690; cv=none; d=zohomail.com; s=zohoarc; b=Ok2WDzPD1Zi4ViUz1MO2fEHUmwQBIoqgu7mPYY0bnHY+JAeShUZhan7sQxkHxpbJieOEoeRizx26MJEAWGpgbHl+/KZAkdxAdi0CfGGwCN0kCQslJZ0rB6PSPaYlBerS4HCy1jP1UAQZhacRLGO7B6W+0wwyXhik6IKKDjgerCE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655816690; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=noDv+i8A3nUMntl+CKPUJTHI8Qi4mLZXGmf4EwFwLlc=; b=RCtkMbp2XjNqIGEUf59G/PNggeq5K/29xSKBvGtwoEFa9xesVjpLNwVWEm30tAm5bahfwKWROJ/Dn1Otx2jaELvm9hF2OGHlZfV8W3XAIiKz4duuOmCoFN/E6yryWHrSmyjwXG7+ORMQKvOYArxSaRdngdmmc3+7aFNK3CZ2o9o= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655816690152179.60387544694788; Tue, 21 Jun 2022 06:04:50 -0700 (PDT) Received: from localhost ([::1]:34752 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3dYn-0002NK-0T for importer@patchew.org; Tue, 21 Jun 2022 09:04:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTs-0007fH-VW for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:44 -0400 Received: from smtpout140.security-mail.net ([85.31.212.143]:33219) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTr-0005GT-Ck for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:44 -0400 Received: from localhost (localhost [127.0.0.1]) by fx403.security-mail.net (Postfix) with ESMTP id BA5EF9671C2 for ; Tue, 21 Jun 2022 14:59:41 +0200 (CEST) Received: from fx403 (localhost [127.0.0.1]) by fx403.security-mail.net (Postfix) with ESMTP id 567B59670D9; Tue, 21 Jun 2022 14:59:35 +0200 (CEST) Received: from zimbra2.kalray.eu (unknown [217.181.231.53]) by fx403.security-mail.net (Postfix) with ESMTPS id 80522967042; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTPS id 6048A27E04DA; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 3EDD627E04F3; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id CLUe1MjpELFi; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from ws2101.lin.mbt.kalray.eu (unknown [192.168.36.68]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id 1A73127E04EE; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalray.eu; s=sec-sig-email; t=1655816381; bh=XVWQIrqLfbq44o7nhRpky02WJ56xIVfQPbtuiuuMCOs=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=XZnNB6jif7O/XT0d3MpSdi1tYfAG4yltW/UIH1aFcgwRw5AkmMLMHHZG7F/9Q0X+f obSzfb1yN2ouOoh0D4eGg7G3ey19fdJHeRn/UuTcyIYlV8O7t0vgiLLUOa7qIgU2wx xL9Yf7Xhz6oMGPdWijvX8KAaFd6OJsBWbeFG5D2M= X-Virus-Scanned: E-securemail Secumail-id: <400c.62b1c0b4.7ef03.0> DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu 3EDD627E04F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1655816372; bh=noDv+i8A3nUMntl+CKPUJTHI8Qi4mLZXGmf4EwFwLlc=; h=From:To:Date:Message-Id; b=rGriRCxXG3ZC4w/7NtbqxCTMzcmsmut6bsLOzgw5+XaO6JnOF8dUQOGvoBhxxC4cV r0UB/NWpA3J0yoLJeOPsTWfrGU6CVoWVOlktjmvNNBY6HOZVM5R+pDeDtLBv/V6OQq Vd1FAzpkjP83A3GBD9/RZjH5Yt/1KjhOOTYwJZTc= From: Luc Michel To: qemu-devel@nongnu.org Cc: Luc Michel , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , Markus Armbruster , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Chris Wulff , Marek Vasut , Max Filippov Subject: [PATCH v2 5/7] target/mips: use semihosting_exit_request on semihosted exit syscall Date: Tue, 21 Jun 2022 14:59:14 +0200 Message-Id: <20220621125916.25257-6-lmichel@kalray.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220621125916.25257-1-lmichel@kalray.eu> References: <20220621125916.25257-1-lmichel@kalray.eu> X-Virus-Scanned: by Secumail Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=85.31.212.143; envelope-from=lmichel@kalray.eu; helo=smtpout140.security-mail.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @kalray.eu) X-ZM-MESSAGEID: 1655816693234100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel Reviewed-by: Laurent Vivier --- target/mips/tcg/sysemu/mips-semi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/mips/tcg/sysemu/mips-semi.c b/target/mips/tcg/sysemu/mi= ps-semi.c index b4a383ae90..94be486925 100644 --- a/target/mips/tcg/sysemu/mips-semi.c +++ b/target/mips/tcg/sysemu/mips-semi.c @@ -245,11 +245,11 @@ void helper_do_semihosting(CPUMIPSState *env) char *p, *p2; =20 switch (op) { case UHI_exit: qemu_log("UHI(%d): exit(%d)\n", op, (int)gpr[4]); - exit(gpr[4]); + semihosting_exit_request(gpr[4]); case UHI_open: GET_TARGET_STRING(p, gpr[4]); if (!strcmp("/dev/stdin", p)) { gpr[2] =3D 0; } else if (!strcmp("/dev/stdout", p)) { --=20 2.17.1 From nobody Tue May 21 23:47:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kalray.eu ARC-Seal: i=1; a=rsa-sha256; t=1655817122; cv=none; d=zohomail.com; s=zohoarc; b=f5+s1W4AXcot/jzZR4Em8zzEtHUmiTOzHlZs+gAt0l+qgv9DJ9hWqul+hySZN5giugHlCakWFMSjYyBoDZbYBO6pQRzWOe/GAMEerhkeYXVl9gr9nj7YJwDz5a0Ey8dUzomIRLGSWzZ3RxrQUxquK1xF6dSy+gERbG9I4TZY6iQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655817122; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=Wjr9hLCi68aBpSzJANk0E0vII78adVAOp9ndS9oOkGM=; b=dkudqSy5MfM5yvG68p7URAr0FnQJevoTOKi5kBzicWKTXNoSkvOvgLQqAZuTtC1f7scp5sYc4nrjpkz40b0os1voENruMB5RnVmdy5jMb6O8QRzLj6KrDBBupkU6Au4Tfd/h+UG+l/WXVZjQTdDohIfrWZ0Y2aYilOkgVEsdLWE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655817121865830.8152779117978; Tue, 21 Jun 2022 06:12:01 -0700 (PDT) Received: from localhost ([::1]:49688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3dfk-00051b-Iz for importer@patchew.org; Tue, 21 Jun 2022 09:12:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dU1-0007wQ-4n for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:53 -0400 Received: from smtpout140.security-mail.net ([85.31.212.143]:33466) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTw-0005Gy-4t for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:52 -0400 Received: from localhost (localhost [127.0.0.1]) by fx403.security-mail.net (Postfix) with ESMTP id D73D19672BA for ; Tue, 21 Jun 2022 14:59:46 +0200 (CEST) Received: from fx403 (localhost [127.0.0.1]) by fx403.security-mail.net (Postfix) with ESMTP id 4D4C296712A; Tue, 21 Jun 2022 14:59:36 +0200 (CEST) Received: from zimbra2.kalray.eu (unknown [217.181.231.53]) by fx403.security-mail.net (Postfix) with ESMTPS id 8F8E1967044; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTPS id 6CE0E27E04EC; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 4A1B127E04D9; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id xPs4WDcr7fSg; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from ws2101.lin.mbt.kalray.eu (unknown [192.168.36.68]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id 301DD27E04D6; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalray.eu; s=sec-sig-email; t=1655816386; bh=nsKkUaK2EK93OxjIqiHJcl/VbHmAJCurFQv5cCOIbOo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=kWyz6nqlOWEhieovYagc0eIt7er25ZOotocgZz14qzuihEloyxpZmj40oiC66z0rK 46YpGh56fds9rficsGzGdzMUZhP5EQOjmgqd6xbWUdYikL4dAErhS8VgptP0h2zBdW gvYjTFXkOj/n81OEQP16T8cim9mqvmnt3QTlIZSo= X-Virus-Scanned: E-securemail Secumail-id: <9423.62b1c0b4.8c481.0> DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu 4A1B127E04D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1655816372; bh=Wjr9hLCi68aBpSzJANk0E0vII78adVAOp9ndS9oOkGM=; h=From:To:Date:Message-Id; b=Aad0SbCVaeJyg1Ja154NqIDM0ED6k8Em+FQn/32bgsz+YiWdUTKadzUpIh4/P0c/M GdBSQdGjfu/WcsZr5IB7Oe8zXn2gYen+Vt45S7LaJy8WGkbfnl6qCnQV9IOZJsee7E u7uYaG6v92tqqM2LhLxZXo9gyGxM0sJ9Cg3888hE= From: Luc Michel To: qemu-devel@nongnu.org Cc: Luc Michel , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , Markus Armbruster , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Chris Wulff , Marek Vasut , Max Filippov Subject: [PATCH v2 6/7] target/nios2: use semihosting_exit_request on semihosted exit syscall Date: Tue, 21 Jun 2022 14:59:15 +0200 Message-Id: <20220621125916.25257-7-lmichel@kalray.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220621125916.25257-1-lmichel@kalray.eu> References: <20220621125916.25257-1-lmichel@kalray.eu> X-Virus-Scanned: by Secumail Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=85.31.212.143; envelope-from=lmichel@kalray.eu; helo=smtpout140.security-mail.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_HELO_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @kalray.eu) X-ZM-MESSAGEID: 1655817123405100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel Reviewed-by: Laurent Vivier --- target/nios2/nios2-semi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/nios2/nios2-semi.c b/target/nios2/nios2-semi.c index ec88474a73..2624ef1539 100644 --- a/target/nios2/nios2-semi.c +++ b/target/nios2/nios2-semi.c @@ -29,10 +29,11 @@ #include "qemu.h" #else #include "exec/softmmu-semi.h" #endif #include "qemu/log.h" +#include "semihosting/semihost.h" =20 #define HOSTED_EXIT 0 #define HOSTED_INIT_SIM 1 #define HOSTED_OPEN 2 #define HOSTED_CLOSE 3 @@ -212,12 +213,11 @@ void do_nios2_semihosting(CPUNios2State *env) =20 nr =3D env->regs[R_ARG0]; args =3D env->regs[R_ARG1]; switch (nr) { case HOSTED_EXIT: - gdb_exit(env->regs[R_ARG0]); - exit(env->regs[R_ARG0]); + semihosting_exit_request(env->regs[R_ARG0]); case HOSTED_OPEN: GET_ARG(0); GET_ARG(1); GET_ARG(2); GET_ARG(3); --=20 2.17.1 From nobody Tue May 21 23:47:05 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=kalray.eu ARC-Seal: i=1; a=rsa-sha256; t=1655817165; cv=none; d=zohomail.com; s=zohoarc; b=ccjQApBT5RZjYJcIHHwo3Fx9z9g/U7PpmPLbZmvRIiG7m4PQ3JXSiyTaNTLz5H9pVcCBaiH4+dZgfhKd+Gz6PUBubu5W8xO1nEXoObFJRs41IdnnYaAzf7aKRNd2sD/P93ivXDj6IzOiX8+26XMcBANp2fx54uelWrcyCl+s9sA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1655817165; h=Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=UFtLVozgBS0dkS8J4BPcVSnxdpIL2DB03Lqlu1GZWG8=; b=UluI8GoNDCUET43VK65ZUAZXfoCT3J2T0jGUuKHccD6YPKTHDScGAAnM7yQfGPnFa2ZG9GX3diUtc3rN/KtyD1Sa0bABOqOddG7Kq4/EUYWpMab58zSAQkxE0HD8jiXOIgI8TeC1j0i6O/r0j2gfOIKR2KWCmOGUkO/WAq4GI5I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1655817165334275.95191506265996; Tue, 21 Jun 2022 06:12:45 -0700 (PDT) Received: from localhost ([::1]:51472 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o3dgR-0006H8-Qa for importer@patchew.org; Tue, 21 Jun 2022 09:12:43 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTy-0007r8-Ie for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:50 -0400 Received: from smtpout140.security-mail.net ([85.31.212.143]:33380) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o3dTu-0005Gj-I1 for qemu-devel@nongnu.org; Tue, 21 Jun 2022 08:59:48 -0400 Received: from localhost (localhost [127.0.0.1]) by fx403.security-mail.net (Postfix) with ESMTP id AF26D967274 for ; Tue, 21 Jun 2022 14:59:44 +0200 (CEST) Received: from fx403 (localhost [127.0.0.1]) by fx403.security-mail.net (Postfix) with ESMTP id F31109670FC; Tue, 21 Jun 2022 14:59:35 +0200 (CEST) Received: from zimbra2.kalray.eu (unknown [217.181.231.53]) by fx403.security-mail.net (Postfix) with ESMTPS id 9717A967048; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTPS id 743B627E04D6; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 5869127E04D7; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id c4KXiAihb4-R; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) Received: from ws2101.lin.mbt.kalray.eu (unknown [192.168.36.68]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id 390CE27E04E7; Tue, 21 Jun 2022 14:59:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalray.eu; s=sec-sig-email; t=1655816384; bh=GqCxVep9Y9SCs6OZcP2iHKSUNelMjkOtHmZ+WaLY0Ow=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=yNBzm/QSQDfCOiEZcPh4Fi+sT0rtHbZxEnBKkLaRpCsI8t1hFIrzeKXZDbEGe9jZr etHCaUbrLYiI6rh9SVb9SIjtBTBsd0Y2tF6NjodIXeE8ISDcv4Tbob4TKT+FQDcBMb +cakwx99HGOFZIohfJ7I+wQSJH+ZNK0bRwds+2Cc= X-Virus-Scanned: E-securemail Secumail-id: <3f68.62b1c0b4.93eeb.0> DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu 5869127E04D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1655816372; bh=UFtLVozgBS0dkS8J4BPcVSnxdpIL2DB03Lqlu1GZWG8=; h=From:To:Date:Message-Id; b=ZwSeVQpWAz92e7SAb2aW+nfhD1lSAhYnG4clqOT844aGGgFZdOK1Z1Te/ZCrTvdQS HMCih70Z7JO8rg1CEgQiJA8BN+ar0bpB0Rif4mqWy0VJKGc97aYRO+SDSvDiS8xN8V dsFvpfy1/DhFOna1AeOIfszIkpk4jYNfnP5dNfUg= From: Luc Michel To: qemu-devel@nongnu.org Cc: Luc Michel , Richard Henderson , Peter Maydell , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , Markus Armbruster , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Chris Wulff , Marek Vasut , Max Filippov Subject: [PATCH v2 7/7] target/xtensa: use semihosting_exit_request on semihosted exit syscall Date: Tue, 21 Jun 2022 14:59:16 +0200 Message-Id: <20220621125916.25257-8-lmichel@kalray.eu> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220621125916.25257-1-lmichel@kalray.eu> References: <20220621125916.25257-1-lmichel@kalray.eu> X-Virus-Scanned: by Secumail Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=85.31.212.143; envelope-from=lmichel@kalray.eu; helo=smtpout140.security-mail.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @kalray.eu) X-ZM-MESSAGEID: 1655817167741100001 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Use the new semihosting_exit_request instead of a call to exit when handling a semihosted exit syscall. Signed-off-by: Luc Michel Reviewed-by: Laurent Vivier --- target/xtensa/xtensa-semi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/xtensa/xtensa-semi.c b/target/xtensa/xtensa-semi.c index fa21b7e11f..0e9a9edc16 100644 --- a/target/xtensa/xtensa-semi.c +++ b/target/xtensa/xtensa-semi.c @@ -193,11 +193,11 @@ void HELPER(simcall)(CPUXtensaState *env) CPUState *cs =3D env_cpu(env); uint32_t *regs =3D env->regs; =20 switch (regs[2]) { case TARGET_SYS_exit: - exit(regs[3]); + semihosting_exit_request(regs[3]); break; =20 case TARGET_SYS_read: case TARGET_SYS_write: { --=20 2.17.1