[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 10/39] xen/riscv: build the target hart index via aplic_hart_field()
- To: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
- From: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- Date: Fri, 4 Sep 2026 16:28:28 +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: xen-devel@xxxxxxxxxxxxxxxxxxxx, Romain Caritey <Romain.Caritey@xxxxxxxxxxxxx>, 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>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger@xxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
- Delivery-date: Fri, 04 Sep 2026 14:28:33 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 9/4/26 10:26 AM, Baptiste Le Duc wrote:
On Thu, 27 Aug 2026 17:20:54 +0200, Oleksii Kurochko
<oleksii.kurochko@xxxxxxxxx> wrote:
aplic_set_irq_affinity() open-coded the packing of the group and hart
indices into the target register, and got two things wrong along the
way:
- imsic_config.msi[] is indexed by logical CPU id, but the index was
run through cpuid_to_hartid() first. On any platform where the two
spaces differ this picks another CPU's interrupt file, or reads past
the array;
[...]
Reviewed-by: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
Thanks.
Considering your suggestion regarding renaming of the function
aplic_hart_field() in the prev. patches. I will also do here:
@ -344 +344 @@ static void cf_check aplic_set_irq_affinity(struct
irq_desc *desc, const cpumask
- value = MASK_INSR(aplic_hart_field(cpu), APLIC_TARGET_HART_IDX) |
+ value = MASK_INSR(aplic_hart_index(cpu), APLIC_TARGET_HART_IDX) |
+
Update the functions name in the commit message.
~ Oleksii
|