[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 10/23] xen/riscv: introduce init interrupt controller operations
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- Date: Wed, 24 Jun 2026 13:34:04 +0200
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20251104 header.d=gmail.com header.i="@gmail.com" header.h="Content-Transfer-Encoding:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
- Cc: Romain Caritey <Romain.Caritey@xxxxxxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Wed, 24 Jun 2026 11:34:15 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 6/22/26 4:30 PM, Jan Beulich wrote:
On 17.06.2026 13:17, 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@xxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
Thanks.
Strictly speaking ...
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -306,12 +306,16 @@ 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 __initconst aplic_init_ops = {
... I think this needs to use __initconstrel, as ...
+ .ops = &aplic_ops,
+ .init = aplic_init,
+};
... both initialized fields incur a relocation.
Isn’t it needed only when `aplic_init_ops.{ops,init}` is saved in a
variable that doesn’t belong to the `.init` section, so that a potential
dereference of already freed memory could occur?
~ Oleksii
|