From: "Alex Bennée" <alex.bennee@linaro.org>
To: Kito Cheng <kito.cheng@gmail.com>
Cc: Keith Packard <keithp@keithp.com>,
qemu-devel@nongnu.org,
Alistair Francis <Alistair.Francis@wdc.com>,
Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
Laurent Vivier <laurent@vivier.eu>,
Palmer Dabbelt <palmer@dabbelt.com>,
Peter Maydell <peter.maydell@linaro.org>,
qemu-arm@nongnu.org, qemu-riscv@nongnu.org,
Sagar Karandikar <sagark@eecs.berkeley.edu>
Subject: Re: [PATCH 5/8] riscv: Add semihosting support [v13]
Date: Mon, 14 Dec 2020 11:29:35 +0000 [thread overview]
Message-ID: <87zh2gtyhk.fsf@linaro.org> (raw)
In-Reply-To: <CA+yXCZA7XhLXDN7ZDk8D90eyXOLCzsrzwUyego1Sn=D9x3BGMQ@mail.gmail.com>
Kito Cheng <kito.cheng@gmail.com> writes:
> Hi Keith:
>
> Thanks for your reply, but it seems like we need some more modification in
> linux-user/riscv/cpu_loop.c to enable that, I guess I should post that in mail
> rather than attachment :)
>
> Patch here:
>
> From 2f1eb5825a6dda177d3289106970eab05cb08445 Mon Sep 17 00:00:00 2001
> From: Kito Cheng <kito.cheng@sifive.com>
> Date: Wed, 9 Dec 2020 14:24:51 +0800
> Subject: [PATCH] riscv: Add semihosting support for user mode
>
> This could make testing easier and ARM/AArch64 has support on
> their linux user mode too, so I think it should be reasonable.
>
> Verified GCC testsuite with newlib/semihosting.
>
> Signed-off-by: Kito Cheng <kito.cheng@sifive.com>
If the riscv linux-user maintainer is happy with it I'll take it through
semihosting/next. It certainly has a use case in the ARM case.
> ---
> linux-user/riscv/cpu_loop.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c
> index aa9e437875..9665dabb09 100644
> --- a/linux-user/riscv/cpu_loop.c
> +++ b/linux-user/riscv/cpu_loop.c
> @@ -23,6 +23,7 @@
> #include "qemu.h"
> #include "cpu_loop-common.h"
> #include "elf.h"
> +#include "hw/semihosting/common-semi.h"
>
> void cpu_loop(CPURISCVState *env)
> {
> @@ -91,6 +92,10 @@ void cpu_loop(CPURISCVState *env)
> sigcode = TARGET_SEGV_MAPERR;
> sigaddr = env->badaddr;
> break;
> + case RISCV_EXCP_SEMIHOST:
> + env->gpr[xA0] = do_common_semihosting(cs);
> + env->pc += 4;
> + break;
> case EXCP_DEBUG:
> gdbstep:
> signum = TARGET_SIGTRAP;
--
Alex Bennée
WARNING: multiple messages have this Message-ID (diff)
From: "Alex Bennée" <alex.bennee@linaro.org>
To: Kito Cheng <kito.cheng@gmail.com>
Cc: Peter Maydell <peter.maydell@linaro.org>,
Keith Packard <keithp@keithp.com>,
qemu-riscv@nongnu.org,
Sagar Karandikar <sagark@eecs.berkeley.edu>,
Bastian Koppelmann <kbastian@mail.uni-paderborn.de>,
qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>,
qemu-arm@nongnu.org, Palmer Dabbelt <palmer@dabbelt.com>,
Alistair Francis <Alistair.Francis@wdc.com>
Subject: Re: [PATCH 5/8] riscv: Add semihosting support [v13]
Date: Mon, 14 Dec 2020 11:29:35 +0000 [thread overview]
Message-ID: <87zh2gtyhk.fsf@linaro.org> (raw)
In-Reply-To: <CA+yXCZA7XhLXDN7ZDk8D90eyXOLCzsrzwUyego1Sn=D9x3BGMQ@mail.gmail.com>
Kito Cheng <kito.cheng@gmail.com> writes:
> Hi Keith:
>
> Thanks for your reply, but it seems like we need some more modification in
> linux-user/riscv/cpu_loop.c to enable that, I guess I should post that in mail
> rather than attachment :)
>
> Patch here:
>
> From 2f1eb5825a6dda177d3289106970eab05cb08445 Mon Sep 17 00:00:00 2001
> From: Kito Cheng <kito.cheng@sifive.com>
> Date: Wed, 9 Dec 2020 14:24:51 +0800
> Subject: [PATCH] riscv: Add semihosting support for user mode
>
> This could make testing easier and ARM/AArch64 has support on
> their linux user mode too, so I think it should be reasonable.
>
> Verified GCC testsuite with newlib/semihosting.
>
> Signed-off-by: Kito Cheng <kito.cheng@sifive.com>
If the riscv linux-user maintainer is happy with it I'll take it through
semihosting/next. It certainly has a use case in the ARM case.
> ---
> linux-user/riscv/cpu_loop.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/linux-user/riscv/cpu_loop.c b/linux-user/riscv/cpu_loop.c
> index aa9e437875..9665dabb09 100644
> --- a/linux-user/riscv/cpu_loop.c
> +++ b/linux-user/riscv/cpu_loop.c
> @@ -23,6 +23,7 @@
> #include "qemu.h"
> #include "cpu_loop-common.h"
> #include "elf.h"
> +#include "hw/semihosting/common-semi.h"
>
> void cpu_loop(CPURISCVState *env)
> {
> @@ -91,6 +92,10 @@ void cpu_loop(CPURISCVState *env)
> sigcode = TARGET_SEGV_MAPERR;
> sigaddr = env->badaddr;
> break;
> + case RISCV_EXCP_SEMIHOST:
> + env->gpr[xA0] = do_common_semihosting(cs);
> + env->pc += 4;
> + break;
> case EXCP_DEBUG:
> gdbstep:
> signum = TARGET_SIGTRAP;
--
Alex Bennée
next prev parent reply other threads:[~2020-12-14 11:31 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-25 21:36 [PATCH 0/8] Add RISC-V semihosting 0.2. Finish ARM semihosting 2.0 Keith Packard
2020-11-25 21:36 ` Keith Packard via
2020-11-25 21:36 ` [PATCH 1/8] semihosting: Move ARM semihosting code to shared directories [v3] Keith Packard
2020-11-25 21:36 ` Keith Packard via
2020-11-25 21:36 ` [PATCH 2/8] semihosting: Change common-semi API to be architecture-independent Keith Packard
2020-11-25 21:36 ` Keith Packard via
2020-11-25 21:36 ` [PATCH 3/8] semihosting: Change internal common-semi interfaces to use CPUState * [v2] Keith Packard
2020-11-25 21:36 ` Keith Packard via
2020-11-25 21:36 ` [PATCH 4/8] semihosting: Support SYS_HEAPINFO when env->boot_info is not set Keith Packard
2020-11-25 21:36 ` Keith Packard via
2020-11-25 21:36 ` [PATCH 5/8] riscv: Add semihosting support [v13] Keith Packard
2020-11-25 21:36 ` Keith Packard via
2020-12-09 7:58 ` Kito Cheng
2020-12-09 7:58 ` Kito Cheng
2020-12-09 16:29 ` Keith Packard
2020-12-09 16:29 ` Keith Packard via
2020-12-10 3:39 ` Kito Cheng
2020-12-10 3:39 ` Kito Cheng
2020-12-10 6:21 ` Keith Packard
2020-12-10 6:21 ` Keith Packard via
2020-12-14 11:29 ` Alex Bennée [this message]
2020-12-14 11:29 ` Alex Bennée
2020-11-25 21:36 ` [PATCH 6/8] semihosting: Implement SYS_ELAPSED and SYS_TICKFREQ Keith Packard
2020-11-25 21:36 ` Keith Packard via
2020-11-25 21:36 ` [PATCH 7/8] semihosting: Implement SYS_TMPNAM Keith Packard
2020-11-25 21:36 ` Keith Packard via
2020-11-25 21:36 ` [PATCH 8/8] semihosting: Implement SYS_ISERROR Keith Packard
2020-11-25 21:36 ` Keith Packard via
2020-12-14 11:24 ` [PATCH 0/8] Add RISC-V semihosting 0.2. Finish ARM semihosting 2.0 Alex Bennée
2020-12-14 11:24 ` Alex Bennée
2020-12-14 14:58 ` Alex Bennée
2020-12-14 14:58 ` Alex Bennée
2020-12-14 20:06 ` Keith Packard
2020-12-14 20:06 ` Keith Packard via
2020-12-14 20:07 ` [PATCH 0/9] " Keith Packard
2020-12-14 20:07 ` Keith Packard via
2020-12-14 20:07 ` [PATCH 1/9] semihosting: Move ARM semihosting code to shared directories Keith Packard
2020-12-14 20:07 ` Keith Packard via
2020-12-14 20:07 ` [PATCH 2/9] semihosting: Change common-semi API to be architecture-independent Keith Packard
2020-12-14 20:07 ` Keith Packard via
2020-12-14 20:07 ` [PATCH 3/9] semihosting: Change internal common-semi interfaces to use CPUState * Keith Packard
2020-12-14 20:07 ` Keith Packard via
2020-12-14 20:07 ` [PATCH 4/9] semihosting: Support SYS_HEAPINFO when env->boot_info is not set Keith Packard
2020-12-14 20:07 ` Keith Packard via
2020-12-14 20:07 ` [PATCH 5/9] riscv: Add semihosting support Keith Packard
2020-12-14 20:07 ` Keith Packard via
2020-12-14 20:07 ` [PATCH 6/9] riscv: Add semihosting support for user mode Keith Packard
2020-12-14 20:07 ` Keith Packard via
2020-12-14 20:07 ` [PATCH 7/9] semihosting: Implement SYS_ELAPSED and SYS_TICKFREQ Keith Packard
2020-12-14 20:07 ` Keith Packard via
2020-12-14 20:07 ` [PATCH 8/9] semihosting: Implement SYS_TMPNAM Keith Packard
2020-12-14 20:07 ` Keith Packard via
2020-12-14 20:07 ` [PATCH 9/9] semihosting: Implement SYS_ISERROR Keith Packard
2020-12-14 20:07 ` Keith Packard via
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=87zh2gtyhk.fsf@linaro.org \
--to=alex.bennee@linaro.org \
--cc=Alistair.Francis@wdc.com \
--cc=kbastian@mail.uni-paderborn.de \
--cc=keithp@keithp.com \
--cc=kito.cheng@gmail.com \
--cc=laurent@vivier.eu \
--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=sagark@eecs.berkeley.edu \
/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.