xen/libxl.max_event_channels.patch
Charles Arnold f9b3d85b1e - Update to Xen 4.20.0 RC2 release
* xen/arm: Fully initialise struct membanks_hdr fields
  * build: Set DATE to SOURCE_DATE_EPOCH if available (for 
    reproducible builds)
  * x86: Add Support for Paging-Write Feature
  * x86/time: introduce command line option to select wallclock
  * x86/time: prefer CMOS over EFI_GET_TIME
  * xentrace: free CPU mask string before overwriting pointer
  * xl: properly dispose of vTPM struct instance
  * xl: properly dispose of libxl_dominfo struct instances
  * Various documentation fixes and adjustments
  * Various MISRA compliance improvements.

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=871
2025-01-20 13:29:19 +00:00

24 lines
951 B
Diff

References: bsc#1167608
unbound limits for max_event_channels
1023 is too low for a three digit value of vcpus
it is difficult to make the value depend on the number of vcpus
adding devices at runtime also needs event channels
But, having an unbound value (of 128k) may have a negative effect on XSA-344.
Therefore, just let the built-in default depend on the number of vcpus.
Index: xen-4.17.0-testing/tools/libs/light/libxl_create.c
===================================================================
--- xen-4.17.0-testing.orig/tools/libs/light/libxl_create.c
+++ xen-4.17.0-testing/tools/libs/light/libxl_create.c
@@ -263,7 +263,7 @@ int libxl__domain_build_info_setdefault(
b_info->iomem[i].gfn = b_info->iomem[i].start;
if (!b_info->event_channels)
- b_info->event_channels = 1023;
+ b_info->event_channels = max(1023, 8 * b_info->max_vcpus + 511);
rc = libxl_get_physinfo(CTX, &info);
if (rc) {