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

Re: [PATCH v5 04/12] xen/arm/irq: add handling for IRQs in the eSPI range


  • To: Julien Grall <julien@xxxxxxx>, Oleksandr Tyshchenko <olekstysh@xxxxxxxxx>
  • From: Leonid Komarianskyi <Leonid_Komarianskyi@xxxxxxxx>
  • Date: Tue, 2 Sep 2025 06:56:04 +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=kQ4wlDO2THQCpCtYA09thsa4uK1n5VuFcpGOJhtXlCQ=; b=U2T6Dr5vnp2+7Qi5DVdwE/ce3ZncF4M41SxNT3HE/TFOE3Cx/IbcZ1gMlCM4QiF7AiZPfK/T1Nrx6iW+bqIe8d/kP7yJblZ66B3+jyoL899BUFmIR6rXVAGkXwFOu3kMyZPpZHLfoihgrME/fQYLnoDPykEFZqpmtXKNcveFWiMSuJhZmjJyA5EqlaMYzNA0kWYAIxJ+kg1Qn2KMZH9ATGKmhTt1upgQ39FLeru9Zq+IELA0nJatxs0dbnRImXw2fTA1TKZK0xU0JioKfpoCl2LPhkLhIanAQ6rLonz82BIDcHDMwMX628mEy+JElIcGIVxPleKeD4qZdfjlF8DQ7g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=h/muRC0qsBWt0YjJz7RjPAAEEO4YNRcoU7PGOawaom3l9fWpNs9lAscj8iaM5DhTqTKIki89XqGYmDkLigumHCKNNSsYDYt6cCsLRx5bQEH0A/oqlgS4brFcBdY307k2T3YoektBJ3NRWRkNfCswt9q6A083FGQ2b9hKTuL77crJtcDeGW9hG/mydxuReo28NY/OLIeQUQQOgVSoXsOU3hOJ0LZXEEEg0DTvjJyhNcMkr1FSXQNqAYhMY2IFmt1Uzy70DOLXst7HCkkHGBPVvV0k3F5uZ/hKaspjDLWuc0KSGqEInNdLXe/T5ie1aPJd0v1v+tnTuPw7jpzru/2yfg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>
  • Delivery-date: Tue, 02 Sep 2025 06:56:18 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHcGP7bBiDA5fxWR0+DupelLQbe97R8z4uAgAGbqoCAABpjAIAA9bWA
  • Thread-topic: [PATCH v5 04/12] xen/arm/irq: add handling for IRQs in the eSPI range

Hello Julien, Volodymyr and Oleksandr,

On 01.09.25 19:16, Julien Grall wrote:
> Hi,
> 
> On 01/09/2025 15:42, Leonid Komarianskyi wrote:
>>>> Taking into account that with CONFIG_GICV3_ESPI=n we should never have
>>>> "irq" in eSPI range, do you really need this #ifdef? I think that
>>>> ASSERT_UNREACHABLE in espi_to_desc() is sufficient guard.
>>>>
>>>> Also, IRQ line number belongs to eSPI range regardless of
>>>> CONFIG_GICV3_ESPI,
>>>> value, so in my opinion is_espi() should always return correct value 
>>>> for
>>>> a given "irq".
>>>
>>>    ... I agree with Volodymyr's suggestion for is_espi() to always 
>>> return
>>> correct value for a given "irq".
>>>
>>>
>>
>> I will fix that in V6.
> 
> I am not sure about this. If is_espi() is not returning false with 
> CONFIG_GICV3_EPSI, then the compiler would not be able to optimize code 
> like:
> 
> if (is_espi(...)) {
>     return espi_to_desc(irq);
> }
> 
> return &irq_desc[irq-NR_LOCAL_IRQS];
> 
> irq_to_desc() is called fairly often, so I would like to keep the code 
> fairly optimized. An alternative would be to use #ifdef CONFIG_*. I 
> don't like it, but it could be a compromise if Oleksandr and Volodymyr 
> wants to push to remove #ifdef from CONFIG_IS_ESPI.
> 
> Cheers,
> 

I am just thinking about a possible compromise between writing logical 
code where the function name reflects its actual functionality and 
allowing for compiler optimization. Perhaps it would be better to keep 
the #ifdef but rename the function to `is_valid_espi()` or something 
similar.

In that case, I think there would be less confusion, as it seems 
reasonable for a function with such a name to return false when 
CONFIG_GICV3_ESPI=n, and also the compiler would be able to optimize the 
code.

What do you think about this approach?

Best regards,
Leonid

 


Rackspace

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