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

Re: [PATCH v3 17/23] xen/riscv: create APLIC DT node for guest domains





On 6/22/26 5:23 PM, Jan Beulich wrote:
On 17.06.2026 13:17, Oleksii Kurochko wrote:
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -12,8 +12,10 @@
  #include <xen/const.h>
  #include <xen/device_tree.h>
  #include <xen/errno.h>
+#include <xen/fdt-kernel.h>
  #include <xen/init.h>
  #include <xen/irq.h>
+#include <xen/libfdt/libfdt.h>
  #include <xen/mm.h>
  #include <xen/sections.h>
  #include <xen/spinlock.h>

Why's this needed all of the sudden?

It isn't, just missed with vaplic.c, the similar name... I will drop these changes from aplic.c.


@@ -29,6 +36,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 = 0;
+    void *fdt = kinfo->fdt;
+    unsigned int msi_parent_phandle;
+    char vaplic_name[128];

Again an excessively large array?

Yes, i will change to 32. It will be enough.


+static const struct vintc_init_ops __initdata init_ops = {

Like elsewhere, __initconst{,rel} with const.

+    .make_domu_dt_node = vaplic_make_domu_dt_node,
+};
+
  static const struct vintc_ops vintc_ops = {
      .vcpu_init = vaplic_init,
      .vcpu_deinit = vaplic_deinit,
@@ -43,6 +118,7 @@ int domain_vaplic_init(struct domain *d)
d->arch.vintc = &vaplic->vintc;
      d->arch.vintc->ops = &vintc_ops;
+    d->arch.vintc->init_ops = &init_ops;

The caller of ->init_ops->make_domu_dt_node() appeared in patch 11 already,
if I'm getting things right. That is, up here there's a NULL deref there.

Yes, but make_intc_domU_node() (and therefore ->init_ops->make_domu_dt_node()) is only called from create_domUs(), which is not invoked in this patch series.

Thanks.

~ Oleksii



 


Rackspace

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