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

Re: [PATCH 06/10] xen/arm/irq: allow eSPI processing in the do_IRQ function


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Leonid Komarianskyi <Leonid_Komarianskyi@xxxxxxxx>
  • Date: Thu, 31 Jul 2025 13:20:21 +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=i8/JnZ9ZdM2g7yD1fuGKs/LWTyQuEMFWbfZysOCuao8=; b=fjUyJ+w8EzUJLWpEMAG+KMgKNidofHQb8cD8ibM6iP/Oa6bFMO/jWB8mkgPQCaFEmDcxdq6e/FiVXZjCgCBmvBDyPfLN8ZBdlx+OiyAaki4L4yyUCSUlOr/Zqb/mpaqD2qTxRmY61N2fxMB1wfbCyjl/53m4jjQO4TcrwUD7iTaUIw16YSybfeWqeRofHlNlhq3WAO6ZpDifHBK0iCDTOB0uBUZMcInKY71jLLtaJc9z4nffSpbrcF7C5QnsZlKuOC121kbXiMk+61If+i524wUg73ZBvEwGxSot0Ky7qO7KxjDxp4oXmiGL+Z6fled2+qGrr5zNEPAGuyz8XnrdeQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=aufQWIwPJqQpQb1cNaEg4cmdnb9D5112uG4p9X3iClMdeAu4vw3K5n/I3twU8FsgVb53l0IAXiT8NVuX5ZqQHlZvdNHiWrSwhaC4/0ill4Mn+h0gl1gKTFy5yxDewmHmXnCEVVLdIicfGNlBe9+xcOCjxlJEW/XZe2nyvDKQ+FA0HGl7RfrWu6hGiDa548Fj3ZeJ+gt0Zir2/K6/kCg0bqePYek0ybmDB2uXca/NjMgMqcNxsaSb25ZewLzwvbIdZX1BXoqe4JwJ4rARTCuil/6Fgigd1aas4vmTglM45dXF6QOjIWfG+ExcXit0D+gm4ovP+zrr6/baJOwsfbgAiA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 31 Jul 2025 13:20:29 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb/KmyzrA3Eiqe3kK0sQcmvNAff7RJKJyAgAMZy4A=
  • Thread-topic: [PATCH 06/10] xen/arm/irq: allow eSPI processing in the do_IRQ function

Hi Julien,

On 29.07.25 16:59, Julien Grall wrote:
> Hi,
> 
> On 24/07/2025 15:57, Leonid Komarianskyi wrote:
>> The do_IRQ() function is the main handler for processing IRQs.
>> Currently, due to restrictive checks, it does not process interrupt
>> numbers greater than 1024. This patch updates the condition to allow
>> the handling of interrupts from the eSPI range.
>>
>> Signed-off-by: Leonid Komarianskyi <leonid_komarianskyi@xxxxxxxx>
>> ---
>>   xen/arch/arm/gic.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
>> index d5f2addf9f..b4a185fcc5 100644
>> --- a/xen/arch/arm/gic.c
>> +++ b/xen/arch/arm/gic.c
>> @@ -342,7 +342,7 @@ void gic_interrupt(struct cpu_user_regs *regs, int 
>> is_fiq)
>>           /* Reading IRQ will ACK it */
>>           irq = gic_hw_ops->read_irq();
>> -        if ( likely(irq >= GIC_SGI_STATIC_MAX && irq < 1020) )
>> +        if ( likely(irq >= GIC_SGI_STATIC_MAX && irq < 1020) || 
>> is_espi(irq) )
> 
> Looking at the series, we seem to have a common pattern which is "check 
> if an SPI or an eSPI". AFAIU, pretty much everywhere we use an SPI, we 
> want to be able to use an eSPI.
> 
> So rather than open-coding everywhere, can we create a new helper to 
> check whether we have an (e)SPI? This would make easier to read the code.
> 

Oh, thank you for your comment - it helped me identify mistakes in the 
previous patches :)

Basically, in some parts of the code like this, we only need to verify 
whether the INTID is valid. However, in other cases (e.g., vGIC-specific 
code), we also need to check whether the domain can utilize the IRQ or 
if the HW GIC actually supports that INTID. For instance, the HW might 
support only 512 eSPIs, and simply using the is_espi check would pass 
incorrectly because it only verifies if the INTID falls in the eSPI 
range but doesn't check if the hardware supports that INTID or if the 
domain can use that IRQ.

I will revise the code based on these findings, introduce helper 
functions, and address the potential issues in v2.

Cheers,
Leonid

 


Rackspace

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