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

[RFC PATCH v1 20/26] xen/arm: vgic-v3: expose SGI emulation for Realm exits


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Koichiro Den <den@xxxxxxxxxxxxx>
  • Date: Fri, 15 May 2026 13:08:06 +0900
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=valinux.co.jp; dmarc=pass action=none header.from=valinux.co.jp; dkim=pass header.d=valinux.co.jp; 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=QH/Emp4HZ6BP+ThWjVFWJsY+2Jm00dCee5sOCsxZDxM=; b=HoV2KraGX6XYkEKsbMqp+9uJKfijW0pJ/eoAo+uRT44e1xjXwrTu+u/Yo3iLbz2IrohXV1mZiBUaO1x8CHrr663nyca1EE3jF16HdX5R+4uCyrC1P/tjMuwVDzxd4rlK1XLr6MArtvZtqqiLHYowIzQN23mLt2EBTKf8Z8XFkg6mnwNyoV4zDSazKkChxoAzP6tyBREilkQUc2IXyIMD+SCXGNzqQQtBRk5gVCjOeoAd0BgKn2PpGpcMwcFyWIyUOLTh0Oly8RL/d1v8If0B/hfAGsT5sf4KCJAmX/w11vYNL5AqpATNHTXXxN+DFKfuNd2ZOWfTneCZ967mGGFfsA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hV4TBptnBiCzJUrB1fasuOyHhNIyKBFECzOs3LNB0wFiW83XcDCSzT4FenO4ApQgPjxlHHsyPrA7AXHcRNwn7vmmmemqTbLdl1vS2uFfWMWWxDyOz3QGWgQ58u6BuwRDzhwvg4XiN9B+t10uSvZwepClL3aiwrkMg4i+DqH2c0jjt0X1xOUVV5YHfpJ3u3rNG3NpiTdayCTpJi15VuuEqEPwHHYAL7lApsUOVaKZqz0ltWiVz1JtroLU2tAYgqUlchb3Sua2ec5I1XHW3NH7WXERS+ggRI7skkn8+ftMPNT2t/aay+Z7iJw78yP0EL8q06h9hp3oJdvs0h4TEAeLMA==
  • Authentication-results: eu.smtp.expurgate.cloud; dkim=pass header.s=selector1 header.d=valinux.co.jp header.i="@valinux.co.jp" header.h="From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck"
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=valinux.co.jp;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Fri, 15 May 2026 04:11:46 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Expose the GICv3 SGI decoder so Realm sysreg exits can reuse Xen's
normal ICC_SGI1R_EL1 handling.

Signed-off-by: Koichiro Den <den@xxxxxxxxxxxxx>
---
 xen/arch/arm/include/asm/vgic.h | 10 ++++++++++
 xen/arch/arm/vgic-v3.c          |  4 +++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/include/asm/vgic.h b/xen/arch/arm/include/asm/vgic.h
index 6f9ab1c98c1c..93f5e3ba40fc 100644
--- a/xen/arch/arm/include/asm/vgic.h
+++ b/xen/arch/arm/include/asm/vgic.h
@@ -336,6 +336,9 @@ extern void vgic_set_irqs_pending(struct vcpu *v, uint32_t 
r,
 extern void register_vgic_ops(struct domain *d, const struct vgic_ops *ops);
 int vgic_v2_init(struct domain *d, unsigned int *mmio_count);
 int vgic_v3_init(struct domain *d, unsigned int *mmio_count);
+#ifdef CONFIG_GICV3
+bool vgic_v3_to_sgi(struct vcpu *v, uint64_t sgir);
+#endif
 
 extern bool vgic_to_sgi(struct vcpu *v, register_t sgir,
                         enum gic_sgi_mode irqmode, int virq,
@@ -346,6 +349,13 @@ extern void vgic_check_inflight_irqs_pending(struct vcpu 
*v,
 
 #endif /* !CONFIG_NEW_VGIC */
 
+#if defined(CONFIG_NEW_VGIC) || !defined(CONFIG_GICV3)
+static inline bool vgic_v3_to_sgi(struct vcpu *v, uint64_t sgir)
+{
+    return false;
+}
+#endif
+
 /*** Common VGIC functions used by Xen arch code ****/
 
 /*
diff --git a/xen/arch/arm/vgic-v3.c b/xen/arch/arm/vgic-v3.c
index 77517c303061..9cb1495bba97 100644
--- a/xen/arch/arm/vgic-v3.c
+++ b/xen/arch/arm/vgic-v3.c
@@ -1600,13 +1600,15 @@ write_reserved:
     return 1;
 }
 
-static bool vgic_v3_to_sgi(struct vcpu *v, uint64_t sgir)
+bool vgic_v3_to_sgi(struct vcpu *v, uint64_t sgir)
 {
     int virq;
     int irqmode;
     enum gic_sgi_mode sgi_mode;
     struct sgi_target target;
 
+    ASSERT(v == current);
+
     sgi_target_init(&target);
     irqmode = (sgir >> ICH_SGI_IRQMODE_SHIFT) & ICH_SGI_IRQMODE_MASK;
     virq = (sgir >> ICH_SGI_IRQ_SHIFT ) & ICH_SGI_IRQ_MASK;
-- 
2.51.0




 


Rackspace

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