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

Re: [PATCH v3 09/39] xen/riscv: build the target hart index via aplic_hart_index()





On 10/14/26 4:03 PM, Jan Beulich wrote:
On 30.09.2026 18:18, Oleksii Kurochko wrote:
--- a/xen/arch/riscv/aplic.c
+++ b/xen/arch/riscv/aplic.c
@@ -335,9 +335,7 @@ static unsigned int aplic_get_cpu_from_mask(const cpumask_t 
*cpumask)
  static void cf_check aplic_set_irq_affinity(struct irq_desc *desc, const 
cpumask_t *mask)
  {
      unsigned int cpu;
-    uint64_t group_index, base_ppn;
-    uint32_t hhxw, lhxw, hhxs, value;
-    const struct imsic_config *imsic = aplic.imsic_cfg;
+    uint32_t value;
/*
       * TODO: Currently, APLIC is supported only with MSI interrupts.
@@ -350,27 +348,18 @@ static void cf_check aplic_set_irq_affinity(struct 
irq_desc *desc, const cpumask
ASSERT(spin_is_locked(&desc->lock)); - cpu = cpuid_to_hartid(aplic_get_cpu_from_mask(mask));
-    hhxw = imsic->group_index_bits;
-    lhxw = imsic->hart_index_bits;
+    cpu = aplic_get_cpu_from_mask(mask);

Any reason this can't be the initializer of the variable? There is a
related assertion in between, but as long as the variable isn't otherwise
used ahead of that, such ordering if fine afaict.

Agree, it could be used as initializer. I will do that.

thanks.

~ Oleksii



 


Rackspace

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