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

[xen master] xen/evtchn: restrict the maximum number of evtchn supported for domUs



commit 0a8ef2fa450aa9673dd2e0d25bb16931aea2bf1e
Author:     Rahul Singh <rahul.singh@xxxxxxx>
AuthorDate: Wed Sep 7 17:27:34 2022 +0100
Commit:     Julien Grall <jgrall@xxxxxxxxxx>
CommitDate: Thu Sep 8 12:21:58 2022 +0100

    xen/evtchn: restrict the maximum number of evtchn supported for domUs
    
    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@xxxxxxx>
    Reviewed-by: Michal Orzel <michal.orzel@xxxxxxx>
    Acked-by: Julien Grall <jgrall@xxxxxxxxxx>
---
 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 0277790088..f899766860 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 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),
--
generated by git-patchbot for /home/xen/git/xen.git#master



 


Rackspace

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