]> xenbits.xensource.com Git - people/tklengyel/xen.git/commitdiff
xen/evtchn: restrict the maximum number of evtchn supported for domUs
authorRahul Singh <rahul.singh@arm.com>
Wed, 7 Sep 2022 16:27:34 +0000 (17:27 +0100)
committerJulien Grall <jgrall@amazon.com>
Thu, 8 Sep 2022 11:21:58 +0000 (12:21 +0100)
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 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 is to follow the default behavior of libxl.

Signed-off-by: Rahul Singh <rahul.singh@arm.com>
Reviewed-by: Michal Orzel <michal.orzel@amd.com>
Acked-by: Julien Grall <jgrall@amazon.com>
xen/arch/arm/domain_build.c

index 0277790088e869526eb12e21e23dc6bb77073360..f89976686036f91a218c8ee860135e5e2be83c88 100644 (file)
@@ -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 guests because
+             * on ARM we don't bind physical interrupts to event channels.
+             * The only use of the evtchn port is inter-domain communications.
+             * 1023 is also the default value used in libxl.
+             */
+            .max_evtchn_port = 1023,
             .max_grant_frames = -1,
             .max_maptrack_frames = -1,
             .grant_opts = XEN_DOMCTL_GRANT_version(opt_gnttab_max_version),