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

[XEN][PATCH v2 1/2] xen/evtchn: enable build optimization for evtchn_move_pirqs()/send_guest_pirq()


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Date: Fri, 18 Jul 2025 10:11:50 +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=j/QS4SYrOQ8+/Pp3lF5IcA+CjFOUSBXpzliLqQXJMTE=; b=ds7DPGxaVCg/XlNFuWfg+N5eMF3QcpuO8KarJYIwxK2/fx/VC3w9SHA+sVHNTPJmIppWGifedEOcbvsmrbfvCdHm3nf45zEs+VwMHIDEecwzzRZUofKZTRffaBNQ8ro6ndbKLI025pzZZKOu9oewR8r5uw0Q6lXmvgtMalkTPh3he+ws2W077b6JISddl2x8BJd1d4wqSKa3PDgwaLs9LxGSNyVSquaK9ZrGcBdY8MND5OPZDIip8t3my/3NAVVExl4zIeOlv35piDvzeZo4SN+Iix43YXCLohouPFw7BPKA2hysGiopY1kskHt1yTJxfoAVttrMBenwCmxJmbIDlg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hsPTjarWQWi91SWgoqhycV0pvT18Izi0GXjPinDCx48k/Mf0Dxo767m7NYrqSyTPcconRJ0RKVE1jenDOp1c42ySqRloup7nkGJgajxQUxWX6NHxOn8ShTVexeEiDwT8Q9vdxz95PhaC8UT4QaUPaNkpSr0Vs/Yy6YIsuw7YosYboN0OVdj9FFUWiKFaL8bHke3vCSnq6k4r9TNQaDxF2KJ3WekNPBWM0ojBoIERPt2Y4PMqBwWrzdHF1/hcN+QN8D2lpRaF9wJMx8yK+GFufxjH6VPUOHGF9xgiUkC+g9cQuXdLiPFepG/SYjBf8kBZuT9pAiTfBrIkug0fPcRSUw==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=epam.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Michal Orzel <michal.orzel@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Ayan Kumar Halder <ayankuma@xxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Dario Faggioli <dfaggioli@xxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, George Dunlap <gwd@xxxxxxxxxxxxxx>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>
  • Delivery-date: Fri, 18 Jul 2025 10:11:57 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHb98xgXEjYq4ZtG0GeJYJst0IW+g==
  • Thread-topic: [XEN][PATCH v2 1/2] xen/evtchn: enable build optimization for evtchn_move_pirqs()/send_guest_pirq()

From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>

On platforms without PIRQ support evtchn_move_pirqs()/send_guest_pirq()
functions are unreachable (Misra rule 2.1).

Move these function under CONFIG_HAS_PIRQ ifdefs to fix Misra rule 2.1
violation and resolve call of evtchn_move_pirqs() from common /sched/core.c
vcpu_move_irqs() code by moving evtchn_move_pirqs() into x86
arch_move_irqs() callback (which is converted to define).

Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
---
changes in v2:
- functions fully moved under idefs
- evtchn_move_pirqs() call moved in x86 arch code

v1: https://lists.xenproject.org/archives/html/xen-devel/2025-07/msg01207.html
 xen/arch/x86/include/asm/irq.h | 2 +-
 xen/common/event_channel.c     | 5 ++++-
 xen/common/sched/core.c        | 1 -
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/include/asm/irq.h b/xen/arch/x86/include/asm/irq.h
index 3c73073b71b3..8c81f66434a8 100644
--- a/xen/arch/x86/include/asm/irq.h
+++ b/xen/arch/x86/include/asm/irq.h
@@ -224,7 +224,7 @@ void cleanup_domain_irq_mapping(struct domain *d);
 
 bool cpu_has_pending_apic_eoi(void);
 
-static inline void arch_move_irqs(struct vcpu *v) { }
+#define arch_move_irqs(v) evtchn_move_pirqs(v)
 
 struct msi_info;
 int allocate_and_map_gsi_pirq(struct domain *d, int index, int *pirq_p);
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index c8c1bfa615df..aa5cf41a8d6d 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -970,6 +970,7 @@ void send_guest_domain_virq(struct domain *d, uint32_t virq)
     read_unlock_irqrestore(&v->virq_lock, flags);
 }
 
+#ifdef CONFIG_HAS_PIRQ
 void send_guest_pirq(struct domain *d, const struct pirq *pirq)
 {
     int port;
@@ -994,6 +995,7 @@ void send_guest_pirq(struct domain *d, const struct pirq 
*pirq)
         evtchn_read_unlock(chn);
     }
 }
+#endif /* CONFIG_HAS_PIRQ */
 
 static DEFINE_SPINLOCK(global_virq_handlers_lock);
 
@@ -1707,6 +1709,7 @@ void evtchn_destroy_final(struct domain *d)
 }
 
 
+#ifdef CONFIG_HAS_PIRQ
 void evtchn_move_pirqs(struct vcpu *v)
 {
     struct domain *d = v->domain;
@@ -1722,7 +1725,7 @@ void evtchn_move_pirqs(struct vcpu *v)
     }
     read_unlock(&d->event_lock);
 }
-
+#endif /* CONFIG_HAS_PIRQ */
 
 static void domain_dump_evtchn_info(struct domain *d)
 {
diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 13fdf57e57b9..ad6032fb2865 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -642,7 +642,6 @@ int sched_init_vcpu(struct vcpu *v)
 static void vcpu_move_irqs(struct vcpu *v)
 {
     arch_move_irqs(v);
-    evtchn_move_pirqs(v);
 }
 
 static void sched_move_irqs(const struct sched_unit *unit)
-- 
2.34.1



 


Rackspace

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