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

Re: [RFC PATCH 1/4] kconfig: allow configuration of maximum modules


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>
  • From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
  • Date: Tue, 31 May 2022 09:07:52 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=9Th7N1XGg19r4bdlU/NzYKD779beWdYoKYuv9n9pzro=; b=elOg8y+nWl2Hv44jcqXisq+EXwlGP6gE+eIeZJ8a562/eRYMsuCNzX0iyAmW0AxQWTYLX5bloyTwhfhGaGpwC/8uuyNfemD6Pa8KsXByMLNopkzThdWRLbu3Ezug59+c8R4zSM7MDlXHrale1+z7UK2TU9HF6aW/QKILRZ4C3aRqb8dP7wHUf4FkRPX+GeNFKS6Qgs9rEoll0fdps78/jOWaPbUCpPJb+g4hSjBCavS383x+mmA4/O4PfyaAlEjQTJgzlq4CiJX5pQiYOQrpkAHAx6IZxh2HSdNGfUB7zu+W2SFpn5rwn1nfXM/Wl4H+N80ZGX7wYyqH/DvF8HqcIQ==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; 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=9Th7N1XGg19r4bdlU/NzYKD779beWdYoKYuv9n9pzro=; b=bLbqCksbFHm9l41sSrBBBKcapDrVIQcc1AdzxNIyDug4SPhnHNualx9MNR5UE2LHqDxnoTzNZZfqiKSgMun/dDY5zuWANwQoS3HHamXcvbxNT1DMMeNS+hnEQWbcULs/xAK/SD7vS8Zn/7KCyfdZcBawOkONe9brnqby3Be69ginYhXjHFzHuu3l3Ks338DJukU0Hx8zJ6Vkm90wG0sBcI3chFrqOgypQBkbv21+IAR3ZJkbCMBCGtqEP3xPQs95P+b1PhLh48EDZBysbQZRkLGw4EBVV/CtHAY36yUsDxG4n+LqDhQNIyOZ7r6WoHADou6VgMAYB2OhIhaH1fls9A==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=BFzkmnXvIziPJg/KN78R/aSVgnhodnMLPhkkpEaWGUeNhg0OxRy8Ef3ikqIqxIRR/Bre8QfRDu6LPXVxPVDfihJ4Xu7zwajIMjBB5/Ix0l6Z5Qc6zwV3SWb4gEp6pZe8k8dl3oxe5YPmHQW1oJVRqrTzWjeyiUyjWh+D6CuAgX7rGXxircpqckx0wZsRfFuopabx/KX5sdb3I028tMdjEhUC5q+aYb9nqJdqqRiKUMcto7MkXD6v5Sqav7qlsKSYJKvmvmbN98P32Y7fndEnSHJiXQGU1Zmpv9KiCKbSmqiwG8rHNxDDo1NjyvxSH55fgZOPhxYBxjiIlhkLa0IL6g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=axTk7wJNDuBFt33rViw+8wbva1Sm3O+7Xf2ZcUqYl2C8DAiUhQAbtvwJHO8Z6n8exX4hbH35C1RUzlu0H4p/nVOHVahSxbm+e5MbHg14ffaW0ZmK2AeBs9BGMwwMbDqHnb220TTNlS/nvaoVgmoeV6L6m+VIEGVuDEZ3TesqRL5L7ityDGmm2smrP9YxywuQGbQbipWvqszLcE8f0xwAvMXLC91booNTTlYxpdzuxb0TXQBOoY6kjex5gdOGNHqxUEga4liQ/iV19TXbUJND4/am6VkJS9Q4u+yQD7dQ3l/ed71ZcMtEBFCzSrexC9eI5l/gr66qIfAm8bvP+LRbig==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, "scott.davis@xxxxxxxxxx" <scott.davis@xxxxxxxxxx>, "christopher.clark@xxxxxxxxxx" <christopher.clark@xxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Tue, 31 May 2022 09:08:21 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHYdHaP7qNDYyBbfkiCxkS8602Jcq04suAA
  • Thread-topic: [RFC PATCH 1/4] kconfig: allow configuration of maximum modules

Hi Daniel,

> On 31 May 2022, at 03:41, Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx> 
> wrote:
> 
> For x86 the number of allowable multiboot modules varies between the different
> entry points, non-efi boot, pvh boot, and efi boot. In the case of both Arm 
> and
> x86 this value is fixed to values based on generalized assumptions. With
> hyperlaunch for x86 and dom0less on Arm, use of static sizes results in large
> allocations compiled into the hypervisor that will go unused by many use 
> cases.
> 
> This commit introduces a Kconfig variable that is set with sane defaults based
> on configuration selection. This variable is in turned used as the array size
> for the cases where a static allocated array of boot modules is declared.
> 
> Signed-off-by: Daniel P. Smith <dpsmith@xxxxxxxxxxxxxxxxxxxx>
> ---
> xen/arch/Kconfig                  | 12 ++++++++++++
> xen/arch/arm/include/asm/setup.h  |  5 +++--
> xen/arch/x86/efi/efi-boot.h       |  2 +-
> xen/arch/x86/guest/xen/pvh-boot.c |  2 +-
> xen/arch/x86/setup.c              |  4 ++--
> 5 files changed, 19 insertions(+), 6 deletions(-)
> 
> diff --git a/xen/arch/Kconfig b/xen/arch/Kconfig
> index f16eb0df43..57b14e22c9 100644
> --- a/xen/arch/Kconfig
> +++ b/xen/arch/Kconfig
> @@ -17,3 +17,15 @@ config NR_CPUS
>         For CPU cores which support Simultaneous Multi-Threading or similar
>         technologies, this the number of logical threads which Xen will
>         support.
> +
> +config NR_BOOTMODS
> +     int "Maximum number of boot modules that a loader can pass"
> +     range 1 64
> +     default "8" if X86
> +     default "32" if ARM
> +     help
> +       Controls the build-time size of various arrays allocated for
> +       parsing the boot modules passed by a loader when starting Xen.
> +
> +       This is of particular interest when using Xen's hypervisor domain
> +       capabilities such as dom0less.
> diff --git a/xen/arch/arm/include/asm/setup.h 
> b/xen/arch/arm/include/asm/setup.h
> index 2bb01ecfa8..312a3e4209 100644
> --- a/xen/arch/arm/include/asm/setup.h
> +++ b/xen/arch/arm/include/asm/setup.h
> @@ -10,7 +10,8 @@
> 
> #define NR_MEM_BANKS 256
> 
> -#define MAX_MODULES 32 /* Current maximum useful modules */
> +/* Current maximum useful modules */
> +#define MAX_MODULES CONFIG_NR_BOOTMODS
> 
> typedef enum {
>     BOOTMOD_XEN,
> @@ -38,7 +39,7 @@ struct meminfo {
>  * The domU flag is set for kernels and ramdisks of "xen,domain" nodes.
>  * The purpose of the domU flag is to avoid getting confused in
>  * kernel_probe, where we try to guess which is the dom0 kernel and
> - * initrd to be compatible with all versions of the multiboot spec. 
> + * initrd to be compatible with all versions of the multiboot spec.

This seems to be a spurious change.

With that fixed, for the arm part:
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>

Cheers
Bertrand




 


Rackspace

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