[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[XEN][PATCH] 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: Thu, 17 Jul 2025 13:01:57 +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=zSdGAj+j7HEUTpGACkIL2RDO37zmHteZ1kvBGvrE+lY=; b=Zy9RF13iHhjLnnjXg9wz9S/uHEk1iFd9Utztv6aLhEb+9rEsTjaH087piKpVhc0/+vszC6+fkHQCgV6Hp962r3rR23A05lQJ/nMWgNjwWMGq1QSHpOwKiKIuYMGn9XXs/4f8EBRwZ3I0N105LzfHqpy95tRNJX3hBYrxIOt8rUV8vjdf9yGolWdTmsgx6Yk89g1xZVPA2WD4zAsm5ZP+J7iYtQE806WzwijxcKJGhsZNzGr/kSaAH3OxHVTM27iOZz6oZ0sISlKFNr6ajgXg6Xbnd11ZwDs2s+BMgWJDIk3tWi+bDQdLFKbRZbkUpF24EpEOnMUpfYw2DUKoDC3kMw==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NqLax9pudSEG6jgKNxT4DouwyHe+fyd6OpObC//oEAhvOOraYbPIa2xv3zev7IndzJX3j5TOYNWLlh4QJNr26b9cB7IYE7YweHYJTBnIR6tZiuBlLk+gGSzVqqijBn45DWy1/y6v6RLhhcaysbBh/CmJQ/zi7WyH26TptKVih15DIavIXqya/0YyL7fFzuVJRgRWeHcKTompOEL8saXVaMmZzDL1PIk6epEwsqA/csJuDI+X2vWyd6opURL2OC+wmYnoPRogDXPBezWtMOVHmnV8ohVKy4UMsWhnZwj5mYKL80jWEkY3piP2c2/n7q6NRvmAPQJXTnQUhgn7AAFkGw==
- 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>, Grygorii Strashko <grygorii_strashko@xxxxxxxx>
- Delivery-date: Thu, 17 Jul 2025 13:02:04 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Thread-index: AQHb9xr6oTct5b0A70W8Vu3/qpQqAw==
- Thread-topic: [XEN][PATCH] xen/evtchn: enable build optimization for evtchn_move_pirqs()/send_guest_pirq()
From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
Enable build time optimization for evtchn_move_pirqs()/send_guest_pirq() on
platforms without PIRQ support by adding compile time check for
!IS_ENABLED(CONFIG_HAS_PIRQ) at the beginning of functions.
This will shrink them to (on Arm64 with -O1):
000000000000264c <send_guest_pirq>:
264c: d65f03c0 ret
0000000000004644 <evtchn_move_pirqs>:
4644: d65f03c0 ret
Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
---
xen/common/event_channel.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/xen/common/event_channel.c b/xen/common/event_channel.c
index c8c1bfa615df..ccecdd682dd4 100644
--- a/xen/common/event_channel.c
+++ b/xen/common/event_channel.c
@@ -975,6 +975,9 @@ void send_guest_pirq(struct domain *d, const struct pirq
*pirq)
int port;
struct evtchn *chn;
+ if (!IS_ENABLED(CONFIG_HAS_PIRQ))
+ return;
+
/*
* PV guests: It should not be possible to race with __evtchn_close(). The
* caller of this function must synchronise with pirq_guest_unbind().
@@ -1710,10 +1713,15 @@ void evtchn_destroy_final(struct domain *d)
void evtchn_move_pirqs(struct vcpu *v)
{
struct domain *d = v->domain;
- const cpumask_t *mask = cpumask_of(v->processor);
+ const cpumask_t *mask;
unsigned int port;
struct evtchn *chn;
+ if (!IS_ENABLED(CONFIG_HAS_PIRQ))
+ return;
+
+ mask = cpumask_of(v->processor);
+
read_lock(&d->event_lock);
for ( port = v->pirq_evtchn_head; port; port = chn->u.pirq.next_port )
{
--
2.34.1
|