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

[PATCH 05/10] xen/arm: gic/irq: permit routing of eSPI interrupts to Xen and domains


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Leonid Komarianskyi <Leonid_Komarianskyi@xxxxxxxx>
  • Date: Thu, 24 Jul 2025 14:57:26 +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=6S09mXpqN6JFsA+d/cmSMr+x1LOLHHmyPbgmJCCy2GU=; b=CiyljdAEwSSHnBD9V8OhX09fefyIOa3aG7dmDLF+5Bp0qwhFuUYUVzm9EzhZ6tRwQmU7/I/++KW7EVf8EA22MEraEy8gY/5kksVmx9wqn2JjJoB83EqhbkA71Swo63jSSC7PFjsf3DjO+F0MJPAiKEy9JuHGi1OKf/IrcH54DU1bfT7G9PJwfVKzC5n3lW5WkC5jaH6RW/hhoMD3QrX0OhUHqTYzlBR9tdU/PDQG1EX9qFaqxl1mIVm2+KQ2nK4O/91byjF12gf2r7zBfpfDpwEXkJgEvw3ySEm1WTUSJtL8Oq0N3pf/tzwzL2Ea0z3ee/lKFOLcZhBEm/V3D4tBOA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MvAzEhnh52A18rgg6WKXpfSm2+p4qmfpmTV1jiptdA342zG8gtJ+DT8fjW8FCooEQJ07Cq4vpmwxDimWZYBFqpPn4SRC2L19p16uAMC1ROajMKqEXHMprrHYNXRvYKcoq5S8sCwPC3GSJ3D+4eqI6egxMDTSOgIsOO+QuEuSKP7Te0pLifOiK6TwdP4wxXNj6VO1qrAIGp5zMtCBZvPAUcyH/6U3gELxAUshq2CAA8Wdsd8b5euzKxoYuuzRCF6ohhWYGtariF0QnGfCNLivBKylFLFfl07ppyl5T+0s3yrhGI40EqwK7nl67ZF3Shq3c/1j6s1LvwX7G/7VsksTUw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Leonid Komarianskyi <Leonid_Komarianskyi@xxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 24 Jul 2025 15:01:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb/KtE4U8sM114rk+e2GRvEynFEA==
  • Thread-topic: [PATCH 05/10] xen/arm: gic/irq: permit routing of eSPI interrupts to Xen and domains

Current checks prevent routing of interrupts from the eSPI range to Xen
or guest domains. The addition of the is_espi condition allows verification
of whether a given index falls within the eSPI range, enabling routing of
such interrupts.

Existing behavior remains unchanged for configurations where eSPI support
is disabled, as in this case, is_espi always returns false.

Signed-off-by: Leonid Komarianskyi <leonid_komarianskyi@xxxxxxxx>
---
 xen/arch/arm/gic.c | 4 ++--
 xen/arch/arm/irq.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/xen/arch/arm/gic.c b/xen/arch/arm/gic.c
index e80fe0ca24..d5f2addf9f 100644
--- a/xen/arch/arm/gic.c
+++ b/xen/arch/arm/gic.c
@@ -111,7 +111,7 @@ static void gic_set_irq_priority(struct irq_desc *desc, 
unsigned int priority)
 void gic_route_irq_to_xen(struct irq_desc *desc, unsigned int priority)
 {
     ASSERT(priority <= 0xff);     /* Only 8 bits of priority */
-    ASSERT(desc->irq < gic_number_lines());/* Can't route interrupts that 
don't exist */
+    ASSERT(desc->irq < gic_number_lines() || is_espi(desc->irq));/* Can't 
route interrupts that don't exist */
     ASSERT(test_bit(_IRQ_DISABLED, &desc->status));
     ASSERT(spin_is_locked(&desc->lock));
 
@@ -134,7 +134,7 @@ int gic_route_irq_to_guest(struct domain *d, unsigned int 
virq,
     ASSERT(spin_is_locked(&desc->lock));
     /* Caller has already checked that the IRQ is an SPI */
     ASSERT(virq >= 32);
-    ASSERT(virq < vgic_num_irqs(d));
+    ASSERT(virq < vgic_num_irqs(d) || is_espi(virq));
     ASSERT(!is_lpi(virq));
 
     ret = vgic_connect_hw_irq(d, NULL, virq, desc, true);
diff --git a/xen/arch/arm/irq.c b/xen/arch/arm/irq.c
index 8c47eeb7c3..d4d40a4f2f 100644
--- a/xen/arch/arm/irq.c
+++ b/xen/arch/arm/irq.c
@@ -461,7 +461,7 @@ bool irq_type_set_by_domain(const struct domain *d)
 
 /*
  * Route an IRQ to a specific guest.
- * For now only SPIs are assignable to the guest.
+ * For now only SPIs and eSPIs are assignable to the guest.
  */
 int route_irq_to_guest(struct domain *d, unsigned int virq,
                        unsigned int irq, const char * devname)
@@ -472,7 +472,7 @@ int route_irq_to_guest(struct domain *d, unsigned int virq,
     unsigned long flags;
     int retval = 0;
 
-    if ( virq >= vgic_num_irqs(d) )
+    if ( virq >= vgic_num_irqs(d) && !is_espi(virq))
     {
         printk(XENLOG_G_ERR
                "the vIRQ number %u is too high for domain %u (max = %u)\n",
-- 
2.34.1



 


Rackspace

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