[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 05/42] xen/riscv: build the target hart index via aplic_hart_index()
- To: Jan Beulich <jbeulich@xxxxxxxx>, Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
- From: Oleksii Kurochko <oleksii.kurochko@xxxxxxxxx>
- Date: Mon, 30 Nov 2026 10:25:55 +0100
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=20260707 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>, 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>
- Delivery-date: Mon, 30 Nov 2026 09:26:04 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 11/30/26 9:40 AM, Jan Beulich wrote:
On 27.11.2026 17:00, Baptiste Le Duc wrote:
[ ... 129 lines skipped ... ]
+static unsigned long aplic_hart_index(unsigned int cpu)
+{
+ const struct imsic_config *imsic = imsic_get_config();
+ const struct imsic_msi *msi = &imsic->msi[cpu];
+ /* Low Hart Index Shift */
+ unsigned int lhxs = imsic->guest_index_bits;
+ /* Low Hart Index Width */
+ unsigned int lhxw = imsic->hart_index_bits;
+ /* High Hart Index Width */
+ unsigned int hhxw = imsic->group_index_bits;
+ /* High Hart Index Shift */
+ unsigned int hhxs =
+ imsic->group_index_shift - APLIC_xMSICFGADDR_PPN_SHIFT * 2;
+ /*
+ * msi->base_addr is the base of the MMIO regset this CPU's interrupt
+ * files live in, and one regset can cover several harts; msi->offset
+ * selects this CPU's block inside it. The hart index bits are part of
Very small nit: too keep being consistant with above wording and with
the spec, it should be better to use "The Hart Index bits are...." to
not confuse with "h" again...
I think it doesn't need an extra version. Jan, if you acked this patch,
could you please do it while commiting?
Sure, I can make that adjustment; it's not quite clear to me though where
the possible confusion lies. Oleksii, thoughts?
I will be happy with that!
Reviewed-by: Baptiste Le Duc <baptiste.le-duc@xxxxxxxxxx>
Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
Thanks.
~ Oleksii
|