[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 10/23] xen/riscv: introduce init interrupt controller operations





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





 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.