qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-riscv@nongnu.org, Palmer Dabbelt <palmer@dabbelt.com>,
	Bin Meng <bin.meng@windriver.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	Furquan Shaikh <furquan@rivosinc.com>
Subject: Re: [PATCH v2 0/7] Allow semihosting from user mode
Date: Tue, 6 Sep 2022 08:50:43 +0100	[thread overview]
Message-ID: <ccb7bf6c-645f-62a0-2488-8f0aa6a0104a@linaro.org> (raw)
In-Reply-To: <20220822141230.3658237-1-peter.maydell@linaro.org>

On 8/22/22 15:12, Peter Maydell wrote:
> Currently our semihosting implementations usually prohibit use of
> semihosting calls in system emulation from the guest userspace.  This
> is a very long standing behaviour justified originally "to provide
> some semblance of security" (since code with access to the semihosting
> ABI can do things like read and write arbitrary files on the host
> system).  However, it is sometimes useful to be able to run trusted
> guest code which performs semihosting calls from guest userspace,
> notably for test code.
> 
> This patchset adds a command line suboption to the existing
> semihosting-config option group so that you can explicitly opt in to
> semihosting from guest userspace with "-semihosting-config
> userspace=on".
> 
> It also brings all our target architectures into line about
> how they handle semihosting. Currently these fall into three
> different groups:
> 
>   * semihosting permitted only in privileged mode and only
>     if enabled on the command line:
>     - arm
>     - m68k
>   * semihosting permitted in any mode, if enabled on the command line:
>     - mips
>     - nios2
>     - xtensa
>   * semihosting permitted only in privileged mode, but fails
>     to honour the existing "enable semihosting" option, instead
>     enabling it all the time:
>     - riscv
> 
> The effect of the new option for group 1 is:
>   * user can now optionally also allow semihosting in usermode
> 
> For group 2 it is:
>   * usermode semihosting used to be permitted, but now changes
>     to default-disabled, needing explicit enablement
> 
> For group 3 it is:
>   * semihosting overall used to be default-enabled and is
>     now default-disabled, needing explicit enablement.
>     Semihosting in usermode can also be enabled.
> 
> That means this is a "things that used to work no longer do
> unless you change your commandline" change for groups 2 and 3
> (so, mips, nios2. xtensa, riscv). Consensus seems to be that
> it's OK to call this "fixing a bug" and note it in the
> changelog/releasenotes.
> 
> Changes v1->v2:
>   * make riscv check for semihosting being disabled at
>     translate time, not runtime
> 
> Only patch 7 needs review.

Thanks, queued to semihosting-next.


r~


      parent reply	other threads:[~2022-09-06  7:53 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-22 14:12 [PATCH v2 0/7] Allow semihosting from user mode Peter Maydell
2022-08-22 14:12 ` [PATCH v2 1/7] semihosting: Allow optional use of semihosting from userspace Peter Maydell
2022-08-22 14:12 ` [PATCH v2 2/7] target/arm: Honour -semihosting-config userspace=on Peter Maydell
2022-08-22 14:12 ` [PATCH v2 3/7] target/m68k: " Peter Maydell
2022-08-22 14:12 ` [PATCH v2 4/7] target/mips: " Peter Maydell
2022-08-22 14:12 ` [PATCH v2 5/7] target/nios2: " Peter Maydell
2022-08-22 14:12 ` [PATCH v2 6/7] target/xtensa: " Peter Maydell
2022-08-22 14:12 ` [PATCH v2 7/7] target/riscv: Honour -semihosting-config userspace=on and enable=on Peter Maydell
2022-08-22 16:11   ` Richard Henderson
2022-08-22 21:43   ` Alistair Francis
2022-09-06  7:50 ` Richard Henderson [this message]

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=ccb7bf6c-645f-62a0-2488-8f0aa6a0104a@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=alistair.francis@wdc.com \
    --cc=bin.meng@windriver.com \
    --cc=furquan@rivosinc.com \
    --cc=palmer@dabbelt.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.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).