From: Tom Rini <trini@konsulko.com>
To: Sean Anderson <sean.anderson@seco.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Liviu Dudau <liviu.dudau@foss.arm.com>,
Andre Przywara <andre.przywara@arm.com>,
Simon Glass <sjg@chromium.org>,
u-boot@lists.denx.de
Subject: Re: [PATCH v3 23/29] arm64: Catch non-emulated semihosting calls
Date: Sat, 2 Apr 2022 20:16:37 -0400 [thread overview]
Message-ID: <20220403001637.GF14476@bill-the-cat> (raw)
In-Reply-To: <20220322205938.1721846-24-sean.anderson@seco.com>
[-- Attachment #1: Type: text/plain, Size: 1242 bytes --]
On Tue, Mar 22, 2022 at 04:59:31PM -0400, Sean Anderson wrote:
> If a debugger is not attached to U-Boot, semihosting calls will raise a
> synchronous abort exception. Try to catch this and disable semihosting
> so we can e.g. use another uart if one is available. In the immediate
> case, we return an error, since it is not always possible to check for
> semihosting beforehand (debug uart, user-initiated load command, etc.)
>
> We handle all possible semihosting instructions, which is probably
> overkill. However, we do need to keep track of what instruction set
> we're using so that we don't suppress an actual error.
>
> A future enhancement could try to determine semihosting capability by
> inspecting the processor state. There's an example of this at [1] for
> RISC-V. The equivalent for ARM would inspect the monitor modei
> enable/select bits of the DSCR. However, as the article notes, an
> exception handler is still helpful in order to catch disconnected
> debuggers.
>
> [1] https://tomverbeure.github.io/2021/12/30/Semihosting-on-RISCV.html#avoiding-hangs-when-a-debugger-is-not-connected
>
> Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Applied to u-boot/next, thanks!
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
next prev parent reply other threads:[~2022-04-03 0:22 UTC|newest]
Thread overview: 71+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-22 20:59 [PATCH v3 00/29] arm: semihosting: Cleanups and new features Sean Anderson
2022-03-22 20:59 ` [PATCH v3 01/29] doc: Convert semihosting readme to rST Sean Anderson
2022-03-22 22:05 ` Heinrich Schuchardt
2022-03-22 23:16 ` Sean Anderson
2022-04-03 0:14 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 02/29] nxp: ls1046ardb: Convert README " Sean Anderson
2022-04-03 0:14 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 03/29] doc: ls1046ardb: Expand boot mode section Sean Anderson
2022-04-03 0:14 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 04/29] doc: ls1046ardb: Document debug uart Sean Anderson
2022-04-03 0:15 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 05/29] arm: smh: Add semihosting entry to MAINTAINERS Sean Anderson
2022-04-03 0:15 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 06/29] arm: smh: Export semihosting functions Sean Anderson
2022-04-03 0:15 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 07/29] arm: smh: Use numeric modes for smh_open Sean Anderson
2022-04-03 0:15 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 08/29] arm: smh: Return errno on error Sean Anderson
2022-04-03 0:15 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 09/29] arm: smh: Document functions in header Sean Anderson
2022-04-03 0:15 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 10/29] arm: smh: Add some file manipulation commands Sean Anderson
2022-04-03 0:15 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 11/29] spl: Add semihosting boot method Sean Anderson
2022-04-03 0:15 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 12/29] fs: Add semihosting filesystem Sean Anderson
2022-04-03 0:15 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 13/29] cmd: fdt: Use start/size for chosen instead of start/end Sean Anderson
2022-04-03 0:15 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 14/29] arm: smh: Remove smhload command Sean Anderson
2022-04-03 0:16 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 15/29] arm: smh: Add some functions for working with the host console Sean Anderson
2022-04-03 0:16 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 16/29] serial: Add semihosting driver Sean Anderson
2022-03-28 6:35 ` Simon Glass
2022-03-28 6:35 ` Simon Glass
2022-03-28 15:36 ` Sean Anderson
2022-03-28 16:03 ` Tom Rini
2022-03-28 16:14 ` Layerscape DM_SERIAL (Was: Re: [PATCH v3 16/29] serial: Add semihosting driver) Sean Anderson
2022-04-03 0:16 ` [PATCH v3 16/29] serial: Add semihosting driver Tom Rini
2022-03-22 20:59 ` [PATCH v3 17/29] doc: smh: Update semihosting documentation Sean Anderson
2022-04-03 0:16 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 20/29] arm64: Save spsr in pt_regs Sean Anderson
2022-04-03 0:16 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 22/29] arm: smh: Add option to detect semihosting Sean Anderson
2022-04-03 0:16 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 23/29] arm64: Catch non-emulated semihosting calls Sean Anderson
2022-04-03 0:16 ` Tom Rini [this message]
2022-03-22 20:59 ` [PATCH v3 24/29] serial: smh: Initialize serial only if semihosting is enabled Sean Anderson
2022-04-03 0:16 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 25/29] arm64: ls1046a: Support semihosting fallback Sean Anderson
2022-04-03 0:16 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 26/29] serial: dm: Add support for puts Sean Anderson
2022-03-28 6:35 ` Simon Glass
2022-04-03 0:16 ` Tom Rini
2022-03-22 20:59 ` [PATCH v3 27/29] serial: sandbox: Implement puts Sean Anderson
2022-03-28 6:35 ` Simon Glass
2022-04-01 22:39 ` Tom Rini
2022-04-04 18:26 ` Sean Anderson
2022-03-22 20:59 ` [PATCH v3 29/29] serial: smh: Implement puts for DM Sean Anderson
2022-03-22 21:16 ` [RESEND PATCH v3 18/29] ls1046ardb: Add support for JTAG boot Sean Anderson
2022-04-03 0:17 ` Tom Rini
2022-03-22 21:17 ` [RESEND PATCH v3 19/29] arm64: Save esr in pt_regs Sean Anderson
2022-04-03 0:17 ` Tom Rini
2022-03-22 21:18 ` [RESEND PATCH v3 21/29] arm64: Import some ESR and SPSR defines from Linux Sean Anderson
2022-04-03 0:17 ` Tom Rini
2022-03-22 21:19 ` [RESEND PATCH v3 28/29] test: serial: Add test for putc/puts Sean Anderson
2022-03-22 22:11 ` [PATCH v3 00/29] arm: semihosting: Cleanups and new features Heinrich Schuchardt
2022-03-22 23:21 ` Sean Anderson
[not found] ` <20220322205938.1721846-29-sean.anderson@seco.com>
2022-03-28 6:35 ` [PATCH v3 28/29] test: serial: Add test for putc/puts Simon Glass
2022-03-28 15:37 ` Sean Anderson
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=20220403001637.GF14476@bill-the-cat \
--to=trini@konsulko.com \
--cc=andre.przywara@arm.com \
--cc=linus.walleij@linaro.org \
--cc=liviu.dudau@foss.arm.com \
--cc=sean.anderson@seco.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
/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