[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 08/12] xen/arm: vgic: add resource management for extended SPIs


  • To: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • From: Leonid Komarianskyi <Leonid_Komarianskyi@xxxxxxxx>
  • Date: Thu, 28 Aug 2025 09:16:08 +0000
  • Accept-language: en-US
  • 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=LNlVm3BEpT3u5zlQF2L1wKKSsJoAkdl16LtfV7J6BIc=; b=ZNTRA4DEYGEI1mG8gKTBTDys3GKGgM+F/wfRZ2RUsRcqF9Y+r+WdmGf5RJ5Bwuxk9u6gtJxxxUe1BaS/BaZix0GUTMKN89KJIbpgOAvXWQOaTTBsc4oy5GAiJTdTphiSrE/I96kx3BE4tTTN+N0t0DanmyCEV5mPL2xRgQBRpjpQpz7DLUMnedGACfT0vY+YY+pevcRv0dr3NgLrkn+huORCe61HKwZJfxZHXGEVpIOC5yeZsoWX8xq6slSsjxQPGDpKGsrxZyWpTjYQYdrAsz91t6GtFGAiTm7b263Ulsr0Ey6Q65Xwe/LURoCfeEMTiLjoPkP9gJ6P32Mc/Dwfbw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=BcFTR1aEC5TzyH0zoReMFzjka54+gF35r2yC0km6VUW3tKAMQQ26wogQ7bY7MGHJTsK5+YT7EyHlg7lpMGSxk77o8aAVYOxETXPLKr7qo7EIokXT+tu8cqVkoNU6yTcX9t/y3dUgr74tXODP+Cbh2ZnmqvqeU/LGk3KZnkhGd/TaZPbAxkAFKDDm06Je+q42MEEmSSNa+uAzUosVIx4HsEvGxVPDB8w8JkthPzVywdarYL/MfYrx6txndBKBKe3Cgz2BwZxMQESZjzuHBNKdFgCDDb81OubDpG7T2QcWoA2Hx6Ee2NYQI9iMMx7EUwtwywnjn9UbuxTWNRmXAI9jhw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "olekstysh@xxxxxxxxx" <olekstysh@xxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Thu, 28 Aug 2025 09:16:20 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcF3/NodAFMh424U2CquWmKsv0JLR3ycWA
  • Thread-topic: [PATCH v4 08/12] xen/arm: vgic: add resource management for extended SPIs

Hi Volodymyr,

Thank you for your review comment.

On 28.08.25 02:01, Volodymyr Babchuk wrote:
> Hi Leonid,
> 
> Leonid Komarianskyi<Leonid_Komarianskyi@xxxxxxxx> writes:
> 
>> This change introduces resource management in the VGIC to handle
>> extended SPIs introduced in GICv3.1. The pending_irqs and
>> allocated_irqs arrays are resized to support the required
>> number of eSPIs, based on what is supported by the hardware and
>> requested by the guest. A new field, ext_shared_irqs, is added
>> to the VGIC structure to store information about eSPIs, similar
>> to how shared_irqs is used for regular SPIs.
>>
>> Since the eSPI range starts at INTID 4096 and INTIDs between 1025
>> and 4095 are reserved, helper macros are introduced to simplify the
>> transformation of indices and to enable easier access to eSPI-specific
>> resources. These changes prepare the VGIC for processing eSPIs as
>> required by future functionality.
>>
>> The initialization and deinitialization paths for vgic have been updated
>> to allocate and free these resources appropriately. Additionally,
>> updated handling of INTIDs greater than 1024, passed from the toolstack
>> during domain creation, and verification logic ensures only valid SPI or
>> eSPI INTIDs are used.
>>
>> The existing SPI behavior remains unaffected when guests do not request
>> eSPIs, GIC hardware does not support them, or the CONFIG_GICV3_ESPI
>> option is disabled.
>>
>> Signed-off-by: Leonid Komarianskyi<leonid_komarianskyi@xxxxxxxx>
>>
>> ---
>> Changes in V4:
>> - added has_espi field to simplify determining whether a domain is able
>>    to operate with eSPI
> I don't think that this is a good idea. You already have an invariant that
> tells if domain has eSPIs: d->nr_espis != 0. If you introduce a new
> field, you now have to keep these two values coherent or deal with possible 
> cases
> like d->nr_espis == 0 && d->has_espi == true
> 
> Also, this new field is not used anywhere, so why adding it in the first
> place?

I just wanted to simplify the checks in the next patch:
https://patchew.org/Xen/cover.1756317702.git.leonid._5Fkomarianskyi@xxxxxxxx/6b312e1997da5abdf592f66d16067f4330431ded.1756317702.git.leonid._5Fkomarianskyi@xxxxxxxx/
e.g.:

+        if ( !v->domain->arch.vgic.has_espi )
+            goto read_reserved;

But yes, I agree that it looks redundant. Would it be okay if I drop 
this change in V5 and modify the checks in the next patch to something 
like this?

+        if ( v->domain->arch.vgic.nr_espis == 0 )
+            goto read_reserved;

Best regards,
Leonid

 


Rackspace

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