From: Jan Beulich <jbeulich@suse.com>
To: Oleksii Kurochko <oleksii.kurochko@gmail.com>
Cc: "Romain Caritey" <Romain.Caritey@microchip.com>,
"Baptiste Le Duc" <baptiste.le-duc@vates.tech>,
"Zheng Zhang" <zhangzheng@iscas.ac.cn>,
"Alistair Francis" <alistair.francis@wdc.com>,
"Connor Davis" <connojdavis@gmail.com>,
"Andrew Cooper" <andrew.cooper3@citrix.com>,
"Anthony PERARD" <anthony.perard@vates.tech>,
"Michal Orzel" <michal.orzel@amd.com>,
"Julien Grall" <julien@xen.org>,
"Roger Pau Monné" <roger@xenproject.org>,
"Stefano Stabellini" <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v8 04/20] xen/riscv: introduce guest riscv,isa string
Date: Thu, 3 Sep 2026 09:33:12 +0200 [thread overview]
Message-ID: <578cefd9-de8d-4a2f-8fb9-778cc5d422b4@suse.com> (raw)
In-Reply-To: <01616191-99a5-48cd-9c3b-e6c00301ec67@gmail.com>
On 03.09.2026 09:27, Oleksii Kurochko wrote:
> On 9/2/26 4:58 PM, Jan Beulich wrote:
>> On 27.08.2026 17:18, Oleksii Kurochko wrote:
>>> @@ -34,9 +36,64 @@ struct riscv_isa_ext_data {
>>> .name = #ext_name, \
>>> }
>>>
>>> +/*
>>> + * Which guests an extension may be handed out to, by guest XLEN.
>>> + *
>>> + * These flags express Xen's policy, not the ISA's rules: extensions which
>>> + * are architecturally tied to one XLEN (Zilsd on RV32, say) need no special
>>> + * treatment here, as they can only ever appear in the "riscv,isa" of a host
>>> + * of that XLEN, and guest_isa is masked against the host ISA bitmap anyway.
>>> + * They are only of use for extensions Xen chooses not to expose to guests of
>>> + * a given width despite the hardware implementing them.
>>> + */
>>> +#define RISCV_ISA_EXT_GUEST_NONE 0
>>> +#define RISCV_ISA_EXT_GUEST_RV32 (1U << 0)
>>> +#define RISCV_ISA_EXT_GUEST_RV64 (1U << 1)
>>> +#define RISCV_ISA_EXT_GUEST_ANY (RISCV_ISA_EXT_GUEST_RV32 | \
>>> + RISCV_ISA_EXT_GUEST_RV64)
>>> +
>>> +/*
>>> + * Guests are of the same width as Xen itself for the time being; once guest
>>> + * XLEN can differ from host XLEN (hstatus.VSXL), this becomes a per-domain
>>> + * property, just as guest_isa below does.
>>> + */
>>> +#if defined(CONFIG_RISCV_32)
>>> +#define RISCV_ISA_EXT_GUEST_XLEN RISCV_ISA_EXT_GUEST_RV32
>>> +#elif defined(CONFIG_RISCV_64)
>>> +#define RISCV_ISA_EXT_GUEST_XLEN RISCV_ISA_EXT_GUEST_RV64
>>> +#else
>>> +# error "Unsupported RISC-V bitness"
>>> +#endif
>>> +
>>> +struct riscv_isa_ext_entry {
>>> + unsigned int id;
>>> + const char *name;
>>> + unsigned int guest_flags;
>>> +};
>>> +
>>> +#define RISCV_ISA_EXT_ENTRY(ext_name, guest_flgs) \
>>> +{ \
>>> + .id = RISCV_ISA_EXT_ ## ext_name, \
>>> + .name = #ext_name, \
>>> + .guest_flags = guest_flgs, \
>>
>> As you're using token concatenation here already anyway, why not
>>
>> .guest_flags = RISCV_ISA_EXT_GUEST_ ## guest_flgs, \
>>
>> helping the use sites quite a bit? (Whether guest_flgs [then] is
>> a good parameter name is a separate question.)
>
> Good point. I will use token concatenation.
>
> Regarding parameter name I have several options in mind: guests or
> guest_xlens.
>
> I prefer 'guests' at the moment but I am open to adjust to better naming
> before sending v9.
I'd suggest singular ("guest"), but I don't mind the plural form.
Jan
next prev parent reply other threads:[~2026-09-03 7:33 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-27 15:18 [PATCH v8 00/20] Introduce enablemenant of dom0less Oleksii Kurochko
2026-08-27 15:18 ` [PATCH v8 01/20] xen: introduce CONFIG_HAS_SHARED_INFO for archs without a shared page Oleksii Kurochko
2026-08-27 15:18 ` [PATCH v8 02/20] xen/dom0less: turn max_init_domid into a common variable Oleksii Kurochko
2026-08-31 15:48 ` Orzel, Michal
2026-09-01 6:54 ` Jan Beulich
2026-09-01 7:14 ` Orzel, Michal
2026-09-01 7:26 ` Jan Beulich
2026-09-02 9:59 ` Oleksii Kurochko
2026-08-27 15:18 ` [PATCH v8 03/20] xen/riscv: Implement construct_domain() Oleksii Kurochko
2026-08-27 15:18 ` [PATCH v8 04/20] xen/riscv: introduce guest riscv,isa string Oleksii Kurochko
2026-09-02 14:58 ` Jan Beulich
2026-09-03 7:27 ` Oleksii Kurochko
2026-09-03 7:33 ` Jan Beulich [this message]
2026-08-27 15:18 ` [PATCH v8 05/20] xen/riscv: implement make_cpus_node() Oleksii Kurochko
2026-08-27 15:18 ` [PATCH v8 06/20] xen/riscv: implement make_timer_node() Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 07/20] xen/riscv: implement make_arch_nodes() Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 08/20] xen/riscv: introduce init interrupt controller operations Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 09/20] xen/riscv: implement make_intc_domU_node() Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 10/20] xen/riscv: introduce aia_init() and aia_usable() Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 11/20] xen/riscv: introduce per-vCPU IMSIC state Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 12/20] xen/riscv: introduce minimal virtual APLIC (vAPLIC) infrastructure Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 13/20] xen/riscv: introduce (de)initialization helpers for vINTC Oleksii Kurochko
2026-09-03 9:20 ` Jan Beulich
2026-09-03 10:49 ` Oleksii Kurochko
2026-09-03 11:16 ` Jan Beulich
2026-08-27 15:19 ` [PATCH v8 14/20] xen/riscv: generate IMSIC DT node for guest domains Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 15/20] xen/riscv: create APLIC " Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 16/20] xen/riscv: implement IRQ routing for device passthrough Oleksii Kurochko
2026-09-03 10:00 ` Jan Beulich
2026-09-03 14:39 ` Oleksii Kurochko
2026-09-04 10:58 ` Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 17/20] xen/riscv: implement init_intc_phandle() Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 18/20] xen/riscv: initialize RCU, scheduler, and system domains in start_xen() Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 19/20] xen/riscv: provide init_vuart() Oleksii Kurochko
2026-08-27 15:19 ` [PATCH v8 20/20] xen/riscv: add initial dom0less infrastructure support Oleksii Kurochko
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=578cefd9-de8d-4a2f-8fb9-778cc5d422b4@suse.com \
--to=jbeulich@suse.com \
--cc=Romain.Caritey@microchip.com \
--cc=alistair.francis@wdc.com \
--cc=andrew.cooper3@citrix.com \
--cc=anthony.perard@vates.tech \
--cc=baptiste.le-duc@vates.tech \
--cc=connojdavis@gmail.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=oleksii.kurochko@gmail.com \
--cc=roger@xenproject.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.org \
--cc=zhangzheng@iscas.ac.cn \
/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.