[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: Mykola Kvach <mykola_kvach@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: "Orzel, Michal" <michal.orzel@xxxxxxx>
  • Date: Tue, 22 Sep 2026 16:21:13 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=epam.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=UOcZmDEQVFh+hFHW/y8ILASHFQwfF/paE8y4vWUmMtM=; b=Mt0bVn8Gq8AonSFpOrEFJGxvq5zm21i/Yv7HTdKGa0hn8rYctMfjiPv2bS66QaAhV3n5K74Ag59YcMRLV5caEePZ/FIErrdO3b/iDHZHcwNE5DjUAREFZVfRIu4kDUZM7ZiYd7qWjzhU+xuzCekhTMrTo5RA3HXyvOaOlo3B+XkQrevYT7exMh2uTMh4sDdWxNLEhYm7ZuR2B0S4m/v+Wlyl4UfYkb0bMyo1AbN4udjw3lrjc8rYrvVkPNEECttT+ZEHso0ND7MhsZD5X8jsUIIQnKrh4A9RUIDFc6tekKBPZ6+UolZaF9E70rAx+UK1CYOVP4DYvu+jZSaG+3jVCQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QM7IjKYQmg36TzDvXvKkLC45Y9vky9ixpDSotiVQRHrthWcWhfqu8Owk80Nni7198fWbfotkkF5mGW4GseWNnZDhoTyvHcAwCJO3dW7xsI2K99PqriZpZ4Vro2t4iuHj1w6lafbBFRlWSSti6BqIyLf62lk1B8GeZ7CmS4z2sgedbqxZgam8LIvtjSbwbdr5FVMamxobBsowd4I2D/fZEEVe22vgfpwNcIBiZzzpVihg9htAhWxJ8UtB07ouFAFF0qX89lwsBMkMLIRXqEwDUmY5EeoHnFVFisyuC7UtGOZyk5M3EDBrlHzpP79dsYQRGWT5LKTU0shKr1wryG0ViA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=amd.com header.i="@amd.com" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, "Volodymyr Babchuk" <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 22 Sep 2026 14:24:43 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


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.

~Michal




 


Rackspace

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