From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Romain Caritey" <Romain.Caritey@microchip.com>,
"Baptiste Le Duc" <baptiste.le-duc@vates.tech>,
"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 v6 06/23] xen/riscv: introduce guest riscv,isa string
Date: Tue, 28 Jul 2026 17:47:38 +0200 [thread overview]
Message-ID: <1e6d2cc4-4bf0-4035-b6fa-52bd111f03fd@gmail.com> (raw)
In-Reply-To: <d329d1c0-59b1-4aa8-b72d-5aad3e310f07@suse.com>
On 7/22/26 9:25 AM, Jan Beulich wrote:
> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>> Introduce build_guest_isa_str() to generate the riscv,isa string to be
>> passed to the guest via the Device Tree riscv,isa property.
>>
>> Introduce the per-domain guest ISA bitmap, populated during domain
>> creation by calling init_guest_isa().
>>
>> Introduce struct riscv_isa_ext_entry with a new guest_supported field
>> to filter out ISA extensions that should not be exposed to guests:
>>
>> - f/d/q/v: FPU and vector context save/restore are not yet implemented
>> for guests.
>> - Z*inx are not exposed either: they aren't in riscv_isa_ext[], so they
>> can never be set in riscv_isa and thus never reach a guest, and no
>> current hardware/guest-OS advertises or expects them. Supporting them
>> would be cheaper than F/D/Q (FP values stay in integer registers Xen
>> already context-switches), but is left as future work.
>> - h: Nested virtualisation is not supported.
>> - sstc: Xen owns the supervisor timer; guests must use SBI.
>> - svade: Xen manages hardware A/D bit updates in stage-2 page tables.
>> - svpbmt: Page-based memory types are not yet wired up in stage-2 code.
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>
> In principle
> Acked-by: Jan Beulich <jbeulich@suse.com>
Thanks.
>
> But see below.
>
>> ---
>> Changes in v6:
>> - build_guest_isa_str() now takes a `const struct domain *d` instead of a
>> raw `const unsigned long *isa_bitmap`, to leave room for using more than
>> just the bitmap in the future.
>> - Compute the guest-visible ISA bitmap once at boot, into a new
>> __ro_after_init `guest_isa` bitmap (compute_guest_isa(), called at the
>> end of riscv_fill_hwcap()), instead of re-deriving it from
>> riscv_isa_ext[] on every domain creation in init_guest_isa(). All guests
>> currently get the same extension set, so this avoids repeating
>> identical work per domain; will need revisiting if/when per-domain ISA
>> policy is introduced.
>> - struct arch_domain's `isa` field is now `const unsigned long *isa`
>> instead of an embedded bitmap; init_guest_isa() just points it at the
>> shared `guest_isa` bitmap rather than copying bits into a per-domain
>> array.
>> - Mark riscv_isa_ext[] __initconstrel, since its entries hold name pointers
>> and the need for relocations requires that the compiler emit the data to
>> a writable section.
>> - Make build_guest_isa_str() __init as it is called during make_cpus_node()
>> which is used only (at least, for now) in build time of domain.
>
> This last item is confusing. For one as there's no call site being added here
> in the first place.
Agree, I have to put that actual call happens in the follow up commit.
And then - why would the string need re-calculating when
> the bitmap is calculated once at start of day?
It isn't re-calculated per call site, only once per domain build. But
you're right that today that's still redundant work: the bitmap is
shared, so every domain gets the same string. I kept the generation in
make_cpus_node() because the string is consumed there and thrown away,
and because per-domain ISA policy would put us back to building it per
domain anyway.
~ Oleksii
next prev parent reply other threads:[~2026-07-28 15:47 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-20 15:59 [PATCH v6 00/23] Introduce enablemenant of dom0less Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 01/23] xen: introduce CONFIG_HAS_SHARED_INFO for archs without a shared page Oleksii Kurochko
2026-07-21 14:50 ` Jan Beulich
2026-07-28 15:29 ` Oleksii Kurochko
2026-07-28 15:40 ` Jan Beulich
2026-07-20 15:59 ` [PATCH v6 02/23] xen/dom0less: turn max_init_domid into a common variable Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 03/23] xen: arm: update p2m_set_allocation() prototype Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 04/23] xen/riscv: Implement ARCH_PAGING_MEMPOOL Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 05/23] xen/riscv: Implement construct_domain() Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 06/23] xen/riscv: introduce guest riscv,isa string Oleksii Kurochko
2026-07-22 7:25 ` Jan Beulich
2026-07-28 15:47 ` Oleksii Kurochko [this message]
2026-07-28 15:53 ` Jan Beulich
2026-07-20 15:59 ` [PATCH v6 07/23] xen/riscv: implement make_cpus_node() Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 08/23] xen/riscv: implement make_timer_node() Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 09/23] xen/riscv: implement make_arch_nodes() Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 10/23] xen/riscv: introduce init interrupt controller operations Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 11/23] xen/riscv: implement make_intc_domU_node() Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 12/23] xen/riscv: introduce aia_init() and aia_usable() Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 13/23] xen/riscv: introduce per-vCPU IMSIC state Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 14/23] xen/riscv: introduce minimal virtual APLIC (vAPLIC) infrastructure Oleksii Kurochko
2026-07-22 7:40 ` Jan Beulich
2026-07-20 15:59 ` [PATCH v6 15/23] xen/riscv: introduce (de)initialization helpers for vINTC Oleksii Kurochko
2026-07-20 15:59 ` [PATCH v6 16/23] xen/riscv: generate IMSIC DT node for guest domains Oleksii Kurochko
2026-07-22 7:43 ` Jan Beulich
2026-07-20 15:59 ` [PATCH v6 17/23] xen/riscv: create APLIC " Oleksii Kurochko
2026-07-23 13:08 ` Jan Beulich
2026-07-20 15:59 ` [PATCH v6 18/23] xen/riscv: implement IRQ routing for device passthrough Oleksii Kurochko
2026-07-23 13:30 ` Jan Beulich
2026-07-20 16:00 ` [PATCH v6 19/23] xen/riscv: implement init_intc_phandle() Oleksii Kurochko
2026-07-20 16:00 ` [PATCH v6 20/23] xen/riscv: initialize RCU, scheduler, and system domains in start_xen() Oleksii Kurochko
2026-07-20 16:00 ` [PATCH v6 21/23] xen/riscv: provide init_vuart() Oleksii Kurochko
2026-07-20 16:00 ` [PATCH v6 22/23] xen/riscv: add initial dom0less infrastructure support Oleksii Kurochko
2026-07-21 7:27 ` Jan Beulich
2026-07-20 16:00 ` [PATCH v6 23/23] xen/riscv: do a 4th linking pass if necessary Oleksii Kurochko
2026-07-21 7:29 ` Jan Beulich
2026-07-21 7:34 ` 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=1e6d2cc4-4bf0-4035-b6fa-52bd111f03fd@gmail.com \
--to=oleksii.kurochko@gmail.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=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger@xenproject.org \
--cc=sstabellini@kernel.org \
--cc=xen-devel@lists.xenproject.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 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.