From: Richard Henderson <richard.henderson@linaro.org>
To: "Daniel Henrique Barboza" <dbarboza@ventanamicro.com>,
"Clément Léger" <cleger@rivosinc.com>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Bin Meng" <bin.meng@windriver.com>,
qemu-riscv@nongnu.org
Cc: Weiwei Li <liwei1518@gmail.com>,
Liu Zhiwei <zhiwei_liu@linux.alibaba.com>,
qemu-devel@nongnu.org, Anup Patel <apatel@ventanamicro.com>
Subject: Re: [PATCH] target/riscv: change RISCV_EXCP_SEMIHOST exception number to 63
Date: Mon, 22 Apr 2024 12:44:15 -0700 [thread overview]
Message-ID: <73af7008-f40a-4861-8826-2de4d5fc0564@linaro.org> (raw)
In-Reply-To: <b0fcb589-9217-4d30-8b72-5b0210ea871f@ventanamicro.com>
On 4/22/24 10:45, Daniel Henrique Barboza wrote:
> Palmer, Anup,
>
> On 4/22/24 10:58, Clément Léger wrote:
>> The current semihost exception number (16) is a reserved number (range
>> [16-17]). The upcoming double trap specification uses that number for
>> the double trap exception. Since the privileged spec (Table 22) defines
>> ranges for custom uses change the semihosting exception number to 63
>> which belongs to the range [48-63] in order to avoid any future
>> collisions with reserved exception.
>
>
> I didn't find any reference to a number for the SEMIHOST exception here:
>
>
> https://github.com/riscv-non-isa/riscv-semihosting
>
>
> Do we have any potential candidates? I would like to avoid, if possible, setting
> RISCV_EXCP_SEMIHOST to 63 as a band-aid just to replace it later on by the real
> value.
RISCV_EXCP_SEMIHOST is internal to the qemu implementation and will never be delivered to
the guest.
I suggest using a number high in the >64 reserved range which will (likely) never be used
by any implementation, including ones that *do* define implementation-specific exceptions.
Which seems more likely than not within the "implementation defined" range.
E.g. target/i386 uses 0x100+n for qemu internal exceptions.
But in any case, the number can be redefined at will and not cause compatibility issues.
r~
next prev parent reply other threads:[~2024-04-22 19:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-22 13:58 [PATCH] target/riscv: change RISCV_EXCP_SEMIHOST exception number to 63 Clément Léger
2024-04-22 17:45 ` Daniel Henrique Barboza
2024-04-22 19:44 ` Richard Henderson [this message]
2024-04-22 19:58 ` Daniel Henrique Barboza
2024-04-23 12:48 ` Clément Léger
2024-04-29 2:46 ` Alistair Francis
2024-04-29 2:52 ` Alistair Francis
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=73af7008-f40a-4861-8826-2de4d5fc0564@linaro.org \
--to=richard.henderson@linaro.org \
--cc=alistair.francis@wdc.com \
--cc=apatel@ventanamicro.com \
--cc=bin.meng@windriver.com \
--cc=cleger@rivosinc.com \
--cc=dbarboza@ventanamicro.com \
--cc=liwei1518@gmail.com \
--cc=palmer@dabbelt.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-riscv@nongnu.org \
--cc=zhiwei_liu@linux.alibaba.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 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).