public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Andre Przywara <andre.przywara@arm.com>
Cc: Sean Anderson <sean.anderson@seco.com>,
	Kautuk Consul <kconsul@ventanamicro.com>,
	Simon Glass <sjg@chromium.org>,
	u-boot@lists.denx.de
Subject: Re: [PATCH 1/2] arm: semihosting: replace inline assembly with assembly file
Date: Tue, 7 Mar 2023 12:52:14 -0500	[thread overview]
Message-ID: <20230307175214.GK968799@bill-the-cat> (raw)
In-Reply-To: <20230207152105.2167641-2-andre.przywara@arm.com>

[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]

On Tue, Feb 07, 2023 at 03:21:04PM +0000, Andre Przywara wrote:

> So far we used inline assembly to inject the actual instruction that
> triggers the semihosting service. While this sounds elegant, as it's
> really only about one instruction, it has some serious downsides:
> - We need some barriers in place to force the compiler to issue writes
>   to a data structure before issuing the trap instruction.
> - We need to convince the compiler to actually fill the structures that
>   we use pointers to.
> - We need a memory clobber to avoid the compiler caching the data in
>   those structures, when semihosting writes data back.
> - We need register arguments to make sure the function ID and the
>   pointer land in the right registers.
> 
> This is all doable, but fragile and somewhat cumbersome. Since we now
> have a separate function in an extra file anyway, we can do away with
> all the magic and just write that in an actual assembly file.
> This is much more readable and robust.
> 
> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
> Reviewed-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 --]

  parent reply	other threads:[~2023-03-07 17:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 15:21 [PATCH 0/2] semihosting: use assembly conduit functions Andre Przywara
2023-02-07 15:21 ` [PATCH 1/2] arm: semihosting: replace inline assembly with assembly file Andre Przywara
2023-02-09 23:07   ` Sean Anderson
2023-03-07 17:52   ` Tom Rini [this message]
2023-02-07 15:21 ` [PATCH 2/2] riscv: " Andre Przywara
2023-02-09 23:07   ` Sean Anderson
2023-03-07 17:52   ` Tom Rini
2023-02-09 23:08 ` [PATCH 0/2] semihosting: use assembly conduit functions 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=20230307175214.GK968799@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=andre.przywara@arm.com \
    --cc=kconsul@ventanamicro.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