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

Re: [PATCH 04/10] xen/arm/irq: allow assignment/releasing of eSPI interrupts


  • To: Julien Grall <julien@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Leonid Komarianskyi <Leonid_Komarianskyi@xxxxxxxx>
  • Date: Thu, 31 Jul 2025 13:20:13 +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=UKbHKERrBKup1qIv92/sRRU77QVlek53UT8pvcFGQ48=; b=Af7MNcQTLuFuf5XM0/ySMrDTDBBnpLCwMeT/uiUQIGHUeA92pzexBYPGCZk4HPCLV3IzOCSR9QOM0TPrU8NQaXdIv8rwqIGEK4S//9Qt30kuej4Qmv+5PGfDHKDX6gUJQdc9PdGSyDvDVx11MHsCvyscqbM2rh/xqpVbLSk6uREOK7772QEOS68rudWLOOQVeFlIdFvZA7VVUVJf9gz2Qp+9SRWMayVRkvCeY2dEft/9x3Y49PvzrEl/9dCHaErHGKr5u3qNaG0KG3riMSDakdBA7k39AMNzhX4Ngra28p0K5NQeeaBGSCub5P6DYlLblVIIYdaegldHzs/xNLl+Wg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=pn2fddDduWexMVPkFsH0KVy2QEGmg2aTpN6qAfT/Z4PedGE+83ccxdzTUFTKYpMzhhXh4gIShnXyT3S/qCgRuKr8IhXLm2CdLB01uQPbV2Q841saaU4FdKjopTiw0qQmrmYLyXIP8d0RKriObqzUjjvGbo1OZuysJqF/25+ZDZbi/+AMzoFCS3C2KZR0Mq+e9Sxhg1HsbIqBiIsFIugHj4sI/cm+hQ+gaBZnTBGXZQQkOv+2V+G0Ea7OE+F6Iwvf9ikiCZEZJSLNrWN8Idb4Ml6ceR1LaTQ3Xkb05W3wE3Xa3IIgcCt77GulLMHU+lxe/njE129EUdeBnjv7V7B2gw==
  • 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:19 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb/KmxyVChbMj/DkOb8Y7w5RraGrRJJ8kAgAMalAA=
  • Thread-topic: [PATCH 04/10] xen/arm/irq: allow assignment/releasing of eSPI interrupts

Hi Julien,

On 29.07.25 16:56, Julien Grall wrote:
> Hi,
> 
> On 24/07/2025 15:57, Leonid Komarianskyi wrote:
>> The current checks don't allow us to assign or release interrupts
>> with INTID greater than 1024. This patch adds an additional condition
>> to check whether the IRQ number is in the eSPI range and allows it to
>> be assigned to Xen and domains if it is.
>  > > Signed-off-by: Leonid Komarianskyi <leonid_komarianskyi@xxxxxxxx>
>> ---
>>   xen/arch/arm/irq.c | 8 ++++----
>>   1 file changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
>> index 3f68257fde..8c47eeb7c3 100644
>> --- a/xen/arch/arm/irq.c
>> +++ b/xen/arch/arm/irq.c
>> @@ -444,8 +444,8 @@ err:
>>   bool is_assignable_irq(unsigned int irq)
>>   {
>> -    /* For now, we can only route SPIs to the guest */
>> -    return (irq >= NR_LOCAL_IRQS) && (irq < gic_number_lines());
>> +    /* For now, we can only route SPIs and eSPIs to the guest */
>> +    return (((irq >= NR_LOCAL_IRQS) && (irq < gic_number_lines())) || 
>> is_espi(irq));
>>   }
> 
> is_assignable_irq() is called by route_irq_to_guest() which first check 
> 'virq >= vgic_num_irqs()'. AFAICT, if we apply only up to this patch, 
> 'virq' would still require to < 1024. So ...

That is my mistake when splitting the changes into separate patches. I 
will at least reorder the patches to make the changes more logical, or, 
based on your comments for the 6th patch in the series, I will try to 
refactor it with a helper function instead.

>>   be
>>   /*
>> @@ -589,8 +589,8 @@ int release_guest_irq(struct domain *d, unsigned 
>> int virq)
>>       unsigned long flags;
>>       int ret;
>> -    /* Only SPIs are supported */
>> -    if ( virq < NR_LOCAL_IRQS || virq >= vgic_num_irqs(d) )
>> +    /* Only SPIs and eSPIs are supported */
>> +    if ( (virq < NR_LOCAL_IRQS || virq >= vgic_num_irqs(d)) && ! 
>> is_espi(virq) )
> 
> ... I don't quite understand why this (yet?) need a change. Can you 
> clarify? ...

This is necessary to allow releasing eSPI IRQs when destroying the 
domain. And yes, this is the same mistake on my part - the patches are 
in the wrong order, and I will refactor them to fix that and make 
changes more logical and straightforward.

Thank you for your comments.

Cheers,
Leonid

 


Rackspace

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