All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-arm@nongnu.org, qemu-devel@nongnu.org,
	qemu-riscv@nongnu.org, "Laurent Vivier" <laurent@vivier.eu>,
	"Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Aleksandar Rikalo" <aleksandar.rikalo@syrmia.com>,
	"Stefan Pejic" <stefan.pejic@syrmia.com>,
	"Chris Wulff" <crwulff@gmail.com>, "Marek Vasut" <marex@denx.de>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Alistair Francis" <alistair.francis@wdc.com>,
	"Bin Meng" <bin.meng@windriver.com>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	"Richard Henderson" <richard.henderson@linaro.org>,
	"Furquan Shaikh" <furquan@rivosinc.com>
Subject: Re: [PATCH 1/7] semihosting: Allow optional use of semihosting from userspace
Date: Tue, 16 Aug 2022 09:50:57 +0100	[thread overview]
Message-ID: <87v8qsbmh4.fsf@linaro.org> (raw)
In-Reply-To: <20220815190303.2061559-2-peter.maydell@linaro.org>


Peter Maydell <peter.maydell@linaro.org> writes:

> Currently our semihosting implementations generally 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.  Add 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
>
> (There is no equivalent option for the user-mode emulator, because
> there by definition all code runs in userspace and has access to
> semihosting already.)
>
> This commit adds the infrastructure for the command line option and
> adds a bool 'is_user' parameter to the function
> semihosting_userspace_enabled() that target code can use to check
> whether it should be permitting the semihosting call for userspace.
> It mechanically makes all the callsites pass 'false', so they
> continue checking "is semihosting enabled in general".  Subsequent
> commits will make each target that implements semihosting honour the
> userspace=on option by passing the correct value and removing
> whatever "don't do this for userspace" checking they were doing by
> hand.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Acked-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée


  parent reply	other threads:[~2022-08-16  8:53 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-15 19:02 [PATCH 0/7] Allow semihosting from user mode Peter Maydell
2022-08-15 19:02 ` [PATCH 1/7] semihosting: Allow optional use of semihosting from userspace Peter Maydell
2022-08-16  0:27   ` Philippe Mathieu-Daudé via
2022-08-16  0:27     ` Philippe Mathieu-Daudé
2022-08-16  8:50   ` Alex Bennée [this message]
2022-08-18  4:17   ` Alistair Francis
2022-08-15 19:02 ` [PATCH 2/7] target/arm: Honour -semihosting-config userspace=on Peter Maydell
2022-08-15 19:02 ` [PATCH 3/7] target/m68k: " Peter Maydell
2022-08-16 10:55   ` Laurent Vivier
2022-08-15 19:03 ` [PATCH 4/7] target/mips: " Peter Maydell
2022-08-16  0:33   ` Philippe Mathieu-Daudé via
2022-08-16  0:33     ` Philippe Mathieu-Daudé
2022-08-15 19:03 ` [PATCH 5/7] target/nios2: " Peter Maydell
2022-08-15 19:03 ` [PATCH 6/7] target/xtensa: " Peter Maydell
2022-08-15 23:15   ` Max Filippov
2022-08-16  0:35   ` Philippe Mathieu-Daudé via
2022-08-16  0:35     ` Philippe Mathieu-Daudé
2022-08-15 19:03 ` [PATCH 7/7] target/riscv: Honour -semihosting-config userspace=on and enable=on Peter Maydell
2022-08-15 20:26   ` Richard Henderson
2022-08-16  5:39     ` Furquan Shaikh
2022-08-18  4:19   ` Alistair Francis
2022-08-18 13:57     ` Peter Maydell
2022-08-19  0:55       ` Alistair Francis
2022-08-19  9:09         ` Peter Maydell
2022-08-15 20:27 ` [PATCH 0/7] Allow semihosting from user mode Richard Henderson

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=87v8qsbmh4.fsf@linaro.org \
    --to=alex.bennee@linaro.org \
    --cc=aleksandar.rikalo@syrmia.com \
    --cc=alistair.francis@wdc.com \
    --cc=bin.meng@windriver.com \
    --cc=crwulff@gmail.com \
    --cc=f4bug@amsat.org \
    --cc=furquan@rivosinc.com \
    --cc=jcmvbkbc@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=laurent@vivier.eu \
    --cc=marex@denx.de \
    --cc=palmer@dabbelt.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=stefan.pejic@syrmia.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.