From: Oleksii Kurochko <oleksii.kurochko@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: "Romain Caritey" <Romain.Caritey@microchip.com>,
"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.pau@citrix.com>,
"Stefano Stabellini" <sstabellini@kernel.org>,
xen-devel@lists.xenproject.org
Subject: Re: [PATCH v2 09/26] xen/riscv: introduce init interrupt controller operations
Date: Fri, 22 May 2026 16:38:15 +0200 [thread overview]
Message-ID: <40fa9628-73ab-48cf-9ff4-c87f0595065f@gmail.com> (raw)
In-Reply-To: <a94a55e0-b6c7-45ed-bc9f-76022f02b1fa@suse.com>
On 5/21/26 3:25 PM, Jan Beulich wrote:
> On 08.05.2026 16:43, Oleksii Kurochko wrote:
>> Introduce intc_hw_init_ops structure to avoid risky mix of init
>> function and non-init function.
>>
>> Signed-off-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
>> ---
>> Changes in v2:
>> - New patch.
>> ---
>> xen/arch/riscv/aplic.c | 7 +++++--
>> xen/arch/riscv/include/asm/intc.h | 10 +++++++---
>> xen/arch/riscv/intc.c | 10 ++++++++--
>> 3 files changed, 20 insertions(+), 7 deletions(-)
>>
>> diff --git a/xen/arch/riscv/aplic.c b/xen/arch/riscv/aplic.c
>> index 739e8dab3498..97dc0ef731f0 100644
>> --- a/xen/arch/riscv/aplic.c
>> +++ b/xen/arch/riscv/aplic.c
>> @@ -306,12 +306,15 @@ static const hw_irq_controller aplic_xen_irq_type = {
>>
>> static const struct intc_hw_operations aplic_ops = {
>> .info = &aplic_info,
>> - .init = aplic_init,
>> .host_irq_type = &aplic_xen_irq_type,
>> .handle_interrupt = aplic_handle_interrupt,
>> .set_irq_type = aplic_set_irq_type,
>> };
>>
>> +static const struct intc_hw_init_ops __initdata aplic_init_ops = {
>> + .init = aplic_init,
>> +};
>
> const wants to pair with __initconst. Then:
> Acked-by: Jan Beulich <jbeulich@suse.com>
>
Thanks.
> However, I have another comment for consideration:
>
>> --- a/xen/arch/riscv/intc.c
>> +++ b/xen/arch/riscv/intc.c
>> @@ -12,9 +12,13 @@
>>
>> static const struct intc_hw_operations *__ro_after_init intc_hw_ops;
>>
>> -void __init register_intc_ops(const struct intc_hw_operations *ops)
>> +static const struct intc_hw_init_ops *__initdata intc_hw_init_ops;
>> +
>> +void __init register_intc_ops(const struct intc_hw_operations *ops,
>> + const struct intc_hw_init_ops *init_ops)
>> {
>> intc_hw_ops = ops;
>> + intc_hw_init_ops = init_ops;
>> }
>
> Again following what we do e.g. in x86'es IOMMU code, instead of passing
> two pointers to the function, have struct intc_hw_init_ops have a
> const struct intc_hw_operations * member which then can be used to
> set intc_hw_ops here? Both will always come in pairs anyway.
It makes sense to me.
So I will do the following:
@@ -350,7 +351,7 @@ static int __init aplic_preinit(struct
dt_device_node *node, const void *dat)
dt_irq_xlate = aplic_irq_xlate;
- register_intc_ops(&aplic_ops, &aplic_init_ops);
+ register_intc_ops(&aplic_init_ops);
/* Enable supervisor external interrupt */
csr_set(CSR_SIE, BIT(IRQ_S_EXT, UL));
diff --git a/xen/arch/riscv/include/asm/intc.h
b/xen/arch/riscv/include/asm/intc.h
index 8b498e43b33f..3d84fcc51d1a 100644
--- a/xen/arch/riscv/include/asm/intc.h
+++ b/xen/arch/riscv/include/asm/intc.h
@@ -42,14 +42,14 @@ struct intc_hw_operations {
};
struct intc_hw_init_ops {
+ const struct intc_hw_operations *ops;
/* Initialize the intc and the boot CPU */
int (*init)(void);
};
void intc_preinit(void);
-void register_intc_ops(const struct intc_hw_operations *ops,
- const struct intc_hw_init_ops *init_ops);
+void register_intc_ops(const struct intc_hw_init_ops *init_ops);
void intc_init(void);
diff --git a/xen/arch/riscv/intc.c b/xen/arch/riscv/intc.c
index 8649160403f7..3600d23bdb5b 100644
--- a/xen/arch/riscv/intc.c
+++ b/xen/arch/riscv/intc.c
@@ -14,10 +14,9 @@ static const struct intc_hw_operations
*__ro_after_init intc_hw_ops;
static const struct intc_hw_init_ops *__initdata intc_hw_init_ops;
-void __init register_intc_ops(const struct intc_hw_operations *ops,
- const struct intc_hw_init_ops *init_ops)
+void __init register_intc_ops(const struct intc_hw_init_ops *init_ops)
{
- intc_hw_ops = ops;
+ intc_hw_ops = init_ops->ops;
intc_hw_init_ops = init_ops;
}
Thanks.
~ Oleksii
next prev parent reply other threads:[~2026-05-22 14:38 UTC|newest]
Thread overview: 83+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 14:43 [PATCH v2 00/26] Introduce enablemenant of dom0less Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 01/26] xen: arm: update p2m_set_allocation() prototype Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 02/26] xen/riscv: Implement ARCH_PAGING_MEMPOOL Oleksii Kurochko
2026-05-18 15:13 ` Jan Beulich
2026-05-19 9:27 ` Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 03/26] xen/riscv: Implement construct_domain() Oleksii Kurochko
2026-05-18 15:33 ` Jan Beulich
2026-05-19 9:28 ` Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 04/26] xen/riscv: implement prerequisites for domain_create() Oleksii Kurochko
2026-05-18 15:43 ` Jan Beulich
2026-05-19 11:33 ` Oleksii Kurochko
2026-05-19 11:47 ` Jan Beulich
2026-05-08 14:43 ` [PATCH v2 05/26] xen/riscv: introduce guest riscv,isa string Oleksii Kurochko
2026-05-18 15:51 ` Jan Beulich
2026-05-19 11:59 ` Oleksii Kurochko
2026-05-19 12:12 ` Jan Beulich
2026-05-19 13:24 ` Oleksii Kurochko
2026-05-19 13:40 ` Jan Beulich
2026-05-19 14:49 ` Oleksii Kurochko
2026-05-19 14:53 ` Jan Beulich
2026-05-19 15:17 ` Oleksii Kurochko
2026-05-19 15:56 ` Jan Beulich
2026-05-19 16:21 ` Oleksii Kurochko
2026-05-20 6:13 ` Jan Beulich
2026-05-20 7:28 ` Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 06/26] xen/riscv: implement make_cpus_node() Oleksii Kurochko
2026-05-18 16:00 ` Jan Beulich
2026-05-19 13:33 ` Oleksii Kurochko
2026-05-19 13:42 ` Jan Beulich
2026-05-08 14:43 ` [PATCH v2 07/26] xen/riscv: implement make_timer_node() Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 08/26] xen/riscv: implement make_arch_nodes() Oleksii Kurochko
2026-05-21 13:20 ` Jan Beulich
2026-05-08 14:43 ` [PATCH v2 09/26] xen/riscv: introduce init interrupt controller operations Oleksii Kurochko
2026-05-21 13:25 ` Jan Beulich
2026-05-22 14:38 ` Oleksii Kurochko [this message]
2026-05-08 14:43 ` [PATCH v2 10/26] xen/riscv: implement make_intc_domU_node() Oleksii Kurochko
2026-05-21 13:30 ` Jan Beulich
2026-05-22 14:45 ` Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 11/26] xen/riscv: introduce aia_init() and aia_usable() Oleksii Kurochko
2026-05-21 14:57 ` Jan Beulich
2026-05-22 14:55 ` Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 12/26] xen/riscv: add basic VGEIN management for AIA guests Oleksii Kurochko
2026-05-21 15:11 ` Jan Beulich
2026-05-22 15:43 ` Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 13/26] xen/riscv: introduce per-vCPU IMSIC state Oleksii Kurochko
2026-05-21 15:24 ` Jan Beulich
2026-05-22 15:50 ` Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 14/26] xen/riscv: add very early virtual APLIC (vAPLIC) initialization support Oleksii Kurochko
2026-06-03 14:54 ` Jan Beulich
2026-06-04 11:29 ` Oleksii Kurochko
2026-06-05 7:22 ` Jan Beulich
2026-06-05 11:59 ` Oleksii Kurochko
2026-06-05 12:05 ` Jan Beulich
2026-05-08 14:43 ` [PATCH v2 15/26] xen/riscv: introduce (de)initialization helpers for vINTC Oleksii Kurochko
2026-06-03 15:00 ` Jan Beulich
2026-06-04 11:33 ` Oleksii Kurochko
2026-06-05 7:26 ` Jan Beulich
2026-06-05 9:25 ` Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 16/26] xen/riscv: create APLIC DT node for guest domains Oleksii Kurochko
2026-06-03 15:10 ` Jan Beulich
2026-06-04 11:54 ` Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 17/26] xen/riscv: generate IMSIC " Oleksii Kurochko
2026-06-03 15:21 ` Jan Beulich
2026-06-04 14:21 ` Oleksii Kurochko
2026-06-05 7:31 ` Jan Beulich
2026-06-05 9:29 ` Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 18/26] xen: move declaration of map_device_irqs_to_domain() to common header Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 19/26] xen/riscv: implement IRQ routing for device passthrough Oleksii Kurochko
2026-06-03 16:01 ` Jan Beulich
2026-06-04 15:35 ` Oleksii Kurochko
2026-06-05 7:38 ` Jan Beulich
2026-05-08 14:43 ` [PATCH v2 20/26] xen/riscv: add missing APLIC register offsets, masks to asm/aplic.h Oleksii Kurochko
2026-06-03 15:36 ` Jan Beulich
2026-06-05 8:48 ` Oleksii Kurochko
2026-06-05 9:07 ` Jan Beulich
2026-05-08 14:43 ` [PATCH v2 21/26] xen/riscv: implement virtual APLIC MMIO emulation Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 22/26] xen/riscv: implement init_intc_phandle() Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 23/26] xen/riscv: initialize RCU, scheduler, and system domains in start_xen() Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 24/26] xen/riscv: provide init_vuart() Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 25/26] xen/riscv: add initial dom0less infrastructure support Oleksii Kurochko
2026-05-08 14:43 ` [PATCH v2 26/26] xen/riscv: manage IRQ_DISABLED flag in APLIC irq enable/disable callbacks Oleksii Kurochko
2026-05-18 15:38 ` [PATCH v2 00/26] Introduce enablemenant of dom0less Jan Beulich
2026-05-19 9:26 ` 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=40fa9628-73ab-48cf-9ff4-c87f0595065f@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=connojdavis@gmail.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=michal.orzel@amd.com \
--cc=roger.pau@citrix.com \
--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.