qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Furquan Shaikh <furquan@rivosinc.com>
To: Richard Henderson <richard.henderson@linaro.org>
Cc: Palmer Dabbelt <palmer@dabbelt.com>,
	Alistair Francis <alistair.francis@wdc.com>,
	 Bin Meng <bin.meng@windriver.com>,
	qemu-riscv@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH] riscv: Make semihosting configurable for all privilege modes
Date: Fri, 12 Aug 2022 22:22:26 -0700	[thread overview]
Message-ID: <CA+tJHD61M3t66geq9R_M+robyoK0dqZ7ScebZjOzsiB2Muz6WQ@mail.gmail.com> (raw)
In-Reply-To: <1f4b1b9b-51a0-8970-83ed-b4618a60cb1a@linaro.org>

On Fri, Aug 12, 2022 at 7:32 PM Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 8/12/22 17:50, Furquan Shaikh wrote:
> >> Why do you need such fine-grained control?  What is the use-case?
> >
> > I ran into a problem when I was testing a project (with a microkernel
> > in M-mode and tasks in U-mode) that uses semihosting for debugging.
> > The semihosting worked fine for M-mode but not in U-mode.
>
> Sure.  This would be handled by Peter's proposed userspace-enable=on property.
>
> > As I started
> > digging into this, I realized that this is because qemu restricts
> > semihosting to only M and S modes. From reading the debug spec, I
> > understood that the DCSR presents options for ebreak behavior in each
> > mode including VS and VU.
>
> I strongly suspect that VS also already works, since that's just
>
>    env->priv == PRV_S && riscv_cpu_virt_enabled(env)
>
> VU would also be handled by userspace-enable=on.
>
> I do not see any use for 5 separate properties.

It felt more natural to mimic the knobs that are provided by the debug
spec to allow users to easily control the ebreak behavior for
semihosting in all possible modes. I agree that it is possible to just
allow semihosting to be turned on/off for U-mode using the above
proposed config. It would work for the use case I ran into, but if
finer control is required for other cases, it makes sense to provide
the ebreak options. Anyways, if others here feel that the
userspace-enable option is sufficient, we can go ahead with that.

>
>
> r~


  reply	other threads:[~2022-08-13  5:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 20:41 [PATCH] riscv: Make semihosting configurable for all privilege modes Furquan Shaikh
2022-08-11 20:56 ` Furquan Shaikh
2022-08-11 23:27 ` Philippe Mathieu-Daudé via
2022-08-12 11:04 ` Andrew Jones
2022-08-12 22:05   ` Furquan Shaikh
2022-08-12 23:00     ` Palmer Dabbelt
2022-08-12 23:28       ` Furquan Shaikh
2022-08-12 11:28 ` Peter Maydell
2022-08-12 23:11   ` Furquan Shaikh
2022-08-12 23:27 ` Richard Henderson
2022-08-12 23:42   ` Richard Henderson
2022-08-12 23:57     ` Furquan Shaikh
2022-08-13  0:30       ` Richard Henderson
2022-08-13  0:50         ` Furquan Shaikh
2022-08-13  2:31           ` Richard Henderson
2022-08-13  5:22             ` Furquan Shaikh [this message]
2022-08-13 10:19           ` Peter Maydell
2022-08-14 22:03             ` Alistair Francis
2022-08-15  6:24               ` Furquan Shaikh

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=CA+tJHD61M3t66geq9R_M+robyoK0dqZ7ScebZjOzsiB2Muz6WQ@mail.gmail.com \
    --to=furquan@rivosinc.com \
    --cc=alistair.francis@wdc.com \
    --cc=bin.meng@windriver.com \
    --cc=palmer@dabbelt.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.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).