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 17/23] xen/riscv: create APLIC DT node for guest domains
Date: Wed, 29 Jul 2026 13:02:47 +0200 [thread overview]
Message-ID: <247a16f6-bf53-4447-a17a-c7593c02950f@gmail.com> (raw)
In-Reply-To: <c37949ce-5858-4b62-b6c8-5cc17d40c9b4@suse.com>
On 7/23/26 3:08 PM, Jan Beulich wrote:
> On 20.07.2026 17:59, Oleksii Kurochko wrote:
>> --- a/xen/arch/riscv/aplic-priv.h
>> +++ b/xen/arch/riscv/aplic-priv.h
>> @@ -34,4 +34,18 @@ struct aplic_priv {
>> const struct imsic_config *imsic_cfg;
>> };
>>
>> +/*
>> + * Value is inspired by what QEMU is using for riscv,num-sources property for
>> + * APLIC node.
>> + */
>> +#define GUEST_APLIC_MAX_SOURCES 96U
>> +
>> +/*
>> + * Specifies the number of wired interrupt sources supported by guest APLIC
>> + * domain.
>> + * Could be limited by host interrupt controller and is identical for every
>> + * domain.
>> + */
>> +extern unsigned int guest_aplic_num_sources;
>
> It being only IMSIC which is supported right now together with APLIC, what
> exactly does the word "wired" mean to express in the comment? MSI, as their
> name says, aren't "wired interrupts" but messages on the system bus.
Technically, APLIC always works with interrupts delivered via dedicated
physical connections (wired interrupts). The difference is that the
APLIC can operate in two modes: direct mode and MSI mode. In our case,
all interrupts are converted into MSIs, which are then sent over the
system bus to a hart's IMSIC.
To avoid confusion, I think the term "wired" can simply be omitted. So
I'll remove it.
>
> You may also want to add "for now" to the latter sentence.
Agree I will add this.
>
>> @@ -29,6 +37,74 @@ static void cf_check vaplic_deinit(struct vcpu *v)
>> return vcpu_imsic_deinit(v);
>> }
>>
>> +static int __init cf_check vaplic_make_domu_dt_node(struct kernel_info *kinfo)
>> +{
>> + struct domain *d = kinfo->bd.d;
>> + int res;
>> + void *fdt = kinfo->fdt;
>> + unsigned int msi_parent_phandle;
>> + char vaplic_name[32];
>> + unsigned int aplic_size = APLIC_SIZE(d->max_vcpus);
>> + const __be32 reg[] = {
>> + cpu_to_be32(GUEST_APLIC_S_BASE >> 32),
>> + cpu_to_be32(GUEST_APLIC_S_BASE),
>> + cpu_to_be32(0),
>> + cpu_to_be32(aplic_size),
>> + };
>> +
>> + BUILD_BUG_ON(APLIC_SIZE(MAX_VIRT_CPUS) > UINT_MAX);
>> +
>> + res = snprintf(vaplic_name, sizeof(vaplic_name), "/soc/aplic@%lx",
>
> Well, what should I say? I really expected you to have gone through all of your
> pending patches. replacing sizeof() by ARRAY_SIZE() in cases like this one.
No, you shouldn't but thanks for reminding me. I will replace sizeof()
with ARRAY_SIZE().
>
> With this adjusted and with the question above sorted one way or the other:
> Acked-by: Jan Beulich <jbeulich@suse.com>
Thanks.
~ Oleksii
next prev parent reply other threads:[~2026-07-29 11:03 UTC|newest]
Thread overview: 45+ 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
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-29 10:41 ` Oleksii Kurochko
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-29 11:02 ` Oleksii Kurochko [this message]
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-29 11:59 ` Oleksii Kurochko
2026-07-29 14:15 ` Jan Beulich
2026-07-29 15:02 ` Oleksii Kurochko
2026-07-29 15:23 ` Oleksii Kurochko
2026-07-30 7:18 ` Jan Beulich
2026-07-30 11:31 ` Oleksii Kurochko
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=247a16f6-bf53-4447-a17a-c7593c02950f@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.