All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rahul Singh <rahul.singh@arm.com>
To: xen-devel@lists.xenproject.org
Cc: rahul.singh@arm.com, Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	Bertrand Marquis <bertrand.marquis@arm.com>,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Michal Orzel <michal.orzel@amd.com>
Subject: [PATCH v4 3/7] xen/evtchn: restrict the maximum number of evtchn supported for domUs
Date: Tue,  6 Sep 2022 14:40:41 +0100	[thread overview]
Message-ID: <a631af9b5499eb3fab76cae372d623021431347c.1662462034.git.rahul.singh@arm.com> (raw)
In-Reply-To: <cover.1662462034.git.rahul.singh@arm.com>

Restrict the maximum number of evtchn supported for domUs to avoid
allocating a large amount of memory in Xen.

Set the default value of max_evtchn_port to 1023. The value of 1023
should be sufficient for domUs guests because on ARM we don't bind
physical interrupts to event channels. The only use of the evtchn port
is inter-domain communications. Another reason why we choose the value
of 1023 to follow the default behavior of libxl.

Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
---
Changes in v4:
 - fix minor comments in commit msg
 - Added Michal Reviewed-by
Changes in v3:
 - added in commit msg why we set the max_evtchn_port value to 1023.
 - added the comment in code also why we set the max_evtchn_port to 1023
 - remove the define and set the value to 1023 in code directly.
Changes in v2:
 - new patch in the version
---
 xen/arch/arm/domain_build.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
index 3fd1186b53..fde133cd94 100644
--- a/xen/arch/arm/domain_build.c
+++ b/xen/arch/arm/domain_build.c
@@ -3277,7 +3277,13 @@ void __init create_domUs(void)
         struct xen_domctl_createdomain d_cfg = {
             .arch.gic_version = XEN_DOMCTL_CONFIG_GIC_NATIVE,
             .flags = XEN_DOMCTL_CDF_hvm | XEN_DOMCTL_CDF_hap,
-            .max_evtchn_port = -1,
+            /*
+             * The default of 1023 should be sufficient for domUs guests
+             * because on ARM we don't bind physical interrupts to event
+             * channels. The only use of the evtchn port is inter-domain
+             * communications.
+             */
+            .max_evtchn_port = 1023,
             .max_grant_frames = -1,
             .max_maptrack_frames = -1,
             .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),
-- 
2.25.1



  parent reply	other threads:[~2022-09-06 13:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06 13:39 [PATCH v4 0/7] xen/evtchn: implement static event channel signaling Rahul Singh
2022-09-06 13:40 ` [PATCH v4 1/7] xen/evtchn: Make sure all buckets below d->valid_evtchns are allocated Rahul Singh
2022-09-06 13:45   ` Jan Beulich
2022-09-06 13:40 ` [PATCH v4 2/7] xen/evtchn: Add an helper to reserve/allocate a port Rahul Singh
2022-09-06 13:40 ` Rahul Singh [this message]
2022-09-07 13:01   ` [PATCH v4 3/7] xen/evtchn: restrict the maximum number of evtchn supported for domUs Julien Grall
2022-09-07 14:19     ` Rahul Singh
2022-09-06 13:40 ` [PATCH v4 4/7] xen/evtchn: modify evtchn_alloc_unbound to allocate specified port Rahul Singh
2022-09-06 13:40 ` [PATCH v4 5/7] xen/evtchn: modify evtchn_bind_interdomain to support static evtchn Rahul Singh
2022-09-06 13:40 ` [PATCH v4 6/7] xen/arm: introduce new xen,enhanced property value Rahul Singh
2022-09-06 22:12   ` Stefano Stabellini
2022-09-07  8:13     ` Rahul Singh
2022-09-07 13:09   ` Julien Grall
2022-09-07 14:19     ` Rahul Singh
2022-09-06 13:40 ` [PATCH v4 7/7] xen/arm: introduce xen-evtchn dom0less property Rahul Singh
2022-09-06 22:22   ` Stefano Stabellini
2022-09-07  8:12     ` Rahul Singh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a631af9b5499eb3fab76cae372d623021431347c.1662462034.git.rahul.singh@arm.com \
    --to=rahul.singh@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=bertrand.marquis@arm.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.