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

RE: [PATCH v1 01/18] kconfig: allow configuration of maximum modules


  • To: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Henry Wang <Henry.Wang@xxxxxxx>
  • Date: Thu, 7 Jul 2022 01:44:28 +0000
  • Accept-language: zh-CN, 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=NYpcNpnVUoenC3Di66fS55RIcJXm/TNgvfGMfiqZVCI=; b=nSbjleLtaFzqIcWFGg24VslLirzSuJgLWX0BtpVsaj2MilRFge0Ao6EhkPah/bJoRVhCbC1RS/YKVdzWokbO7dmLycRsedJmV+BlhSaPE84lv/bNJAiqGFalOTnahNsXCa7SVTeJL21ggkz09Jm0Tl+rTXespDGcnl0vKi+IFv/r2wrKb6WxZfI0IL2Ki7BOiNb6FlX+Dnl44CxDk///yMKI1cf7VWI+ytLzyeQEFJ0u6ChRVnQEc/f9pLXk/QIxOzpttP1951vR5g5ansXQ0Bd9tix9pR9Mbz7fVfkyBhRGxJZ1WDAMVoVnoU+iG/BXberLRYdDgpkD7WHYGJ3NwA==
  • 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=NYpcNpnVUoenC3Di66fS55RIcJXm/TNgvfGMfiqZVCI=; b=aw4hw3pPX7Glud4wAmSP6p6m2ukTKHr6uV0dInYfxR/qhlz+4E+hirji6wyhgRUbVMjjdITUPvCad0YZaXrP9UpvXb6e1hvg8CL5QbzGrdQ2eUMRcTu10cyowzqMSlUc60QkRj41HdhDKFjrMMk66vwnsPDxyGYsxS0BYCHcAOHImsuDkPpNuyPWYmJCJV5M1i74uN67FgNIxjYTseu6Q6pxAlLRtB71lbiPRBAr0PEbK6Wwe/AVfSGmQifH9F6djvuYS2Yp6eUBECVZxBu0NJKZF7U623jW0q1Wft4x5qdhvaojUR5pW67u4BXortxE+u+TPlVZKBBQZi6U8YBS1w==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=pass; b=ENhmKJ6yzCiy3H0zXjVWZ7G5raLcKMAHPPe51OsPugOUWHD/9bFrz5YYtCLKR0vIcxHMGEAfqa/EqdNytMNe6e/amNYpnt/QzTS4Jn79uatlDaE0Mgsd/ftzjUL8OeJMqPbjhiblHpfcsxKskc50q4dxxUbM0YWVm5q1boaPufz0QXshzHG+NONuFmPXs1sI3paW+euIYpcQ2JVi0fIWQqASwEcoyEauD/Ba3PjMaGLuP6w/Oe5LGvO/mASpRY2Nr8vB/Qy04vAsXagdSWX7ecqJSkmdSVWru6O77isROT5OS+RgUZgC4ULgPQoWGp+iBudOO/pW7OS0wV+SmWg1zw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=n2rGfiJlohTu6jD8HnyCBOenOZhx3IgDVnA//agBS/IQJ50LBmQRzBrSemqmi7Nxlgog5svDp9BOEY1qsFNlB2F8ae+WO+TDy9UGg9uiF7rjgwsUGMQNugDqmaI1Jjwbat+n4na5JKLWmkIbnAbV2nWQBwko5VzrHGUAyLtGB5+lEsDvm2KySuCW3b43/W74VW2WwAfApe25WukvxpvbTy/KDomyVY+IGj+MZQ6ZJi2fkVydz/ktBo8vZy1DR1NUh6SWMKYK46C0Gj6gKkIUUiT0VJonGWw7jygw33qr4J19/MPwcMNbORfUVQBAXf+ka5FNMEJ2mhNCBN1fS+XPPQ==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: "scott.davis@xxxxxxxxxx" <scott.davis@xxxxxxxxxx>, "christopher.clark@xxxxxxxxxx" <christopher.clark@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Thu, 07 Jul 2022 01:45:11 +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: AQHYkXwoifwexgw7vU2lK0bNIn1Zbq1yHf8Q
  • Thread-topic: [PATCH v1 01/18] kconfig: allow configuration of maximum modules

Hi Daniel,

> -----Original Message-----
> Subject: [PATCH v1 01/18] kconfig: allow configuration of maximum modules
> 
> 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>
> Reviewed-by: Christopher Clark <christopher.clark@xxxxxxxxxx>

Reviewed-by: Henry Wang <Henry.Wang@xxxxxxx>

> ---
>  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..24139057be 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 32768
> +     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.

Thanks for taking the chance to remove the space in the end of the sentence.

Kind regards,
Henry





 


Rackspace

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