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

[PATCH v2] xen: add kconfig for event_fifo


  • To: <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Date: Thu, 27 Mar 2025 16:22:25 -0700
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0)
  • 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=8dgxLLLfoXL5Yr5Rx6rdlyc7YVFLFzXW7oBOjB4xBxo=; b=TsxxA1+0IHmjgPU/Z8OtFDgyoE7vL+wzKaCv3ZKjKPz3qU/3FROK0JPj0+bc5wDh1lJdpzqBEOHyLnfWqIP6eaNSzXVHGSFsZ4EjJYa3SOdtZXsKJeI/6KRYgrLsomN/C7N4Xe7jn40Xc9xHQFGY5e3Fq6W3G3uoajkXFHVTMevjZM5iNyWbnO3hVIJzRjgMKSKgEGwkBmtuX59Z1ljTmN7aCvVuvBtR+GweAyC2jubuLNzV1IWhND0n/yqvbuVsEupXCD4uhNbMt+BxtNupueYQJkJsqPRkqPbBng5h76SBadw46sADrL1uuzMTZ9FKeaYOfp/eb9ZXNFa0oPU0rw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=auVgPOF7gueB8Ll9Q1Wbc7VKZBsGPxuBi64GXQrB7quiYyqam7QpgWPgRQd+Gw3r8QXdwPSni32rYnbTbIedBthIz313yuNodOs6GnH1jKzxAOysLN5b5XRU3DbNx/ff8i1miphPW1VvNLJonIf1bi4svBbXPAhaIUSTWfpGWhS9ihNTMLI/6ORJmKVnqx1FTNRuoQizM4IpNXfGoKyYEjMtLFgHdaAqL5zcJbUa6u31AwK0pqNjcI7TuhQaAnPNwiNevrxRZeUJDIwWgdxjFDUSuXSN+r4g6ArePBoDHLW3i8HkFm3LFSQ+l2lPzPfJP+R6nwYK4O70nCZ/iHr5ZQ==
  • Cc: <sstabellini@xxxxxxxxxx>, <andrew.cooper3@xxxxxxxxxx>, <jbeulich@xxxxxxxx>, <roger.pau@xxxxxxxxxx>, <julien@xxxxxxx>, <michal.orzel@xxxxxxx>, <bertrand.marquis@xxxxxxx>, Stefano Stabellini <stefano.stabellini@xxxxxxx>
  • Delivery-date: Thu, 27 Mar 2025 23:22:42 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Evtchn fifos are not needed on smaller systems; the older interface is
lightweight and sufficient. Also, event_fifo causes runtime anonymous
memory allocations, which are undesirable.  Additionally, it exposes an
extra interface to the guest, which is also undesirable unless
necessary.

Make it possible to disable evtchn fifo.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxx>
---
Changes in v2:
- improve description and commit message
---
 xen/common/Kconfig         | 14 ++++++++++++++
 xen/common/Makefile        |  2 +-
 xen/common/event_channel.h | 15 +++++++++++++++
 3 files changed, 30 insertions(+), 1 deletion(-)

diff --git a/xen/common/Kconfig b/xen/common/Kconfig
index a6aa2c5c14..0e51076c05 100644
--- a/xen/common/Kconfig
+++ b/xen/common/Kconfig
@@ -23,6 +23,20 @@ config GRANT_TABLE
 
          If unsure, say Y.
 
+config EVTCHN_FIFO
+       bool "Event Channel Fifo support" if EXPERT
+       default y
+       help
+         The Event channel Fifo extends support for event channels
+         beyond 1024 event channels for 32-bit guests and 4096 for
+         64-bit guests.
+
+         Cons: They cause runtime anonymous memory allocations and expose
+         an additional interface to the guest. For smaller systems, you
+         might consider disabling this feature.
+
+         If unsure, say Y.
+
 config PDX_COMPRESSION
        bool "PDX (Page inDeX) compression" if EXPERT && !X86 && !RISCV
        default ARM || PPC
diff --git a/xen/common/Makefile b/xen/common/Makefile
index ac23120d7d..9da8a7244d 100644
--- a/xen/common/Makefile
+++ b/xen/common/Makefile
@@ -13,7 +13,7 @@ obj-$(CONFIG_IOREQ_SERVER) += dm.o
 obj-y += domain.o
 obj-y += event_2l.o
 obj-y += event_channel.o
-obj-y += event_fifo.o
+obj-$(CONFIG_EVTCHN_FIFO) += event_fifo.o
 obj-$(CONFIG_GRANT_TABLE) += grant_table.o
 obj-y += guestcopy.o
 obj-y += gzip/
diff --git a/xen/common/event_channel.h b/xen/common/event_channel.h
index 45219ca67c..a778ae775b 100644
--- a/xen/common/event_channel.h
+++ b/xen/common/event_channel.h
@@ -45,12 +45,27 @@ void evtchn_2l_init(struct domain *d);
 
 /* FIFO */
 
+#ifdef CONFIG_EVTCHN_FIFO
 struct evtchn_init_control;
 struct evtchn_expand_array;
 
 int evtchn_fifo_init_control(struct evtchn_init_control *init_control);
 int evtchn_fifo_expand_array(const struct evtchn_expand_array *expand_array);
 void evtchn_fifo_destroy(struct domain *d);
+#else
+static inline int evtchn_fifo_init_control(struct evtchn_init_control 
*init_control)
+{
+    return -EOPNOTSUPP;
+}
+static inline int evtchn_fifo_expand_array(const struct evtchn_expand_array 
*expand_array)
+{
+    return -EOPNOTSUPP;
+}
+static inline void evtchn_fifo_destroy(struct domain *d)
+{
+    return;
+}
+#endif /* CONFIG_EVTCHN_FIFO */
 
 /*
  * Local variables:
-- 
2.25.1




 


Rackspace

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