[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 3/4] xen/arm: vgic: free eSPIs using the bitmap index
- To: "Orzel, Michal" <michal.orzel@xxxxxxx>
- From: Mykola Kvach <mykola_kvach@xxxxxxxx>
- Date: Wed, 23 Sep 2026 12:09:54 +0300
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=epam.com; dmarc=pass action=none header.from=epam.com; dkim=pass header.d=epam.com; arc=none
- Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=5hDleXXQ7ZFYiRyz/TOQ5zOKUgB4ljJBW/GGekLzPjk=; b=p9P1b/PXJ4PQ4+3+BLigW6GMuHo5QkM3PgDEGHnHu5itNf54dxtTmwGb0QoXcdCWxyVvOZRTgjvszbwYFCvzXcETrjpDyQKUgGKpp85ypFUVYpbvv587Pb6PIGOiU8orVyPiF+nB6d4QEr7v3XQ5EtZe4QwgIbWNGhXKdtcmBZoZ34OAUxt04n8nXh+MOy+MKzcDEbHbF2R4HuLxwW1hP7WdyjFepRLVZNrcGQCt0H8QppxPfZjpOTGPQ/YxF8kDlzDgFGax6K30dOM7pwv/O4KImEQK1acSrSDXgq/WPjpia0gu4YLrk3V5wTlZG2oR1e/PtCFLsbbEzkTIdLmsLg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bEaQo6vmckxOZdHGwtcifI7WXBp0BJYmI5pRDQSxaigtqRFl6Mim70uNCeeIP16scKBwAM4ysS6X5NG/tVZA4tVdw6WHTKZGszkg77IHsJ7Y0UbXZ+DD7/5inpoqG+5Pg8Jy67F8/Xj0JUDOj0q8oqixVLjYKH8w2vlK2+AlG64VEcT63XwuKqlkOJ/yyB9xhKaetCm/MV2jUnACbYhTMiNbgKeg6xgiawg9wLcZhcLQTgKyUuCc6zEhygc67B5uknEvSESW1M6fdXl/2MOAb3LQcuEASFjzpWtDSX68Wa2sA+JzEMF85vPzHZyq4hm48Rt93ZtcbwRHB+EOtW67nw==
- Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=epam.com header.i="@epam.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
- Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
- Delivery-date: Wed, 23 Sep 2026 09:10:09 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Mail-followup-to: "Orzel, Michal" <michal.orzel@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
On Tue, Sep 22, 2026 at 04:21:13PM +0200, Orzel, Michal wrote:
>
>
> On 22-Sep-26 08:39, Mykola Kvach wrote:
> > The allocated_irqs bitmap in the existing vGIC implementation stores eSPI
> > allocation bits immediately after the regular vIRQ bits.
> > vgic_reserve_virq() converts an eSPI INTID to this compressed bitmap index,
> > but vgic_free_virq() used the raw INTID.
> >
> > Freeing INTID 4096 therefore clears bit 4096 instead of the first eSPI bit.
> > This writes beyond allocated_irqs and leaves the intended eSPI bit set.
> > Valid eSPIs reach this path during DOMCTL bind failure cleanup and unbind,
> > and during vPL011 teardown.
> >
> > Add virq_to_idx(), the inverse of idx_to_virq(), and use it when reserving
> > and freeing vIRQs. Validate a vIRQ before clearing its allocation bit.
> Please also add this validation (just vgic_is_valid_line() guard) to a new
> VGIC
> vgic.c. It's eSPI agnostic and we should keep them in sync if possible.
Sure, I can add the validation there as well.
Just to clarify, NEW_VGIC currently selects GICV2 and GICV3_ESPI
depends on GICV3 && !NEW_VGIC, so the eSPI bitmap issue itself cannot
affect the new VGIC. But I agree that the validity check is generic and
it makes sense to keep vgic_free_virq() consistent between the two
implementations.
Best regards,
Mykola
|