[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()
- To: Jan Beulich <jbeulich@xxxxxxxx>
- From: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- Date: Thu, 15 Oct 2026 10:32:40 +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:Content-Type:In-Reply-To:From:Content-Language:References:Cc:To:Subject:User-Agent:MIME-Version:Date:Message-ID"
- Cc: Romain Caritey <Romain.Caritey@xxxxxxxxxxxxx>, Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>, Zheng Zhang <zhangzheng@xxxxxxxxxxx>, 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@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Thu, 15 Oct 2026 08:32:47 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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
|