[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>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 19 Jul 2022 11:32:46 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • 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=Fz7c6wjkMrFruZ2/AtYHJb3j8hPxDPCAGR6792LWaK0=; b=kmc75bqE5GgaYqo6e6q6zcGKnHR8nRng2hmjMSNmXjmXdpQZT9TnNuo9ew2+/wr8AP0kKdANvCwySwQXxZB1i2HC6VdYT2WYS+1q4z+JH0ZmmSNDTf3GbWDmouTHfIOeYBH7xGmLOWfU5nb5E0heqPlXNsowJxfpoou9rwYHE/zDX6Q1SigMK2zUVFFvKP75i6hhZ0kChioeQzP5gt2QFpxApso+QWfbpUi7u2DdYVmHYCG4jnO8mR//pv1ASAxxB58qnF6FQehmno3J169LEpVdq46ipHJ8EB3Y0aSSuku5QHTPjtQPKkk5or1qTXgyogHrWKaoj60Vx4vh0OwE3g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NgENY3uaDTfo3uyycJ14qF64Hrj3S5rw2ImyaUxCXSTytfcA3eLlH+mmGVDq9BwAplhpxNm6xXC5n+Z/u+mhQlB0dPRdhTIEzsmDjRRB//zhnLlM26z6Cri7eSZ/kPoYMelshDJBuiUqQ/n7Atp4SPcI9qzPsMN9NppwIdw35TAfrb7y06pv9K3aUOrFtY8IsIT3C7D1tZoGVQUEYKkhzQv498uOjg9BpBTNhDZGbtmo0OwALE5AWlYz4VER0P3xRe//G3icGrLTpFctpTy1EdjxhvKd0UYNKmCGDurreq8iHOIQmdVRlVn7XEcnVdPPJoOO7TnPWHR0JuqEQvKn7Q==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: scott.davis@xxxxxxxxxx, christopher.clark@xxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 19 Jul 2022 09:33:10 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 06.07.2022 23:04, Daniel P. Smith wrote:
> --- 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

Any reason for the larger default on Arm, irrespective of dom0less
actually being in use? (I'm actually surprised I can't spot a Kconfig
option controlling inclusion of dom0less. The default here imo isn't
supposed to depend on the architecture, but on whether dom0less is
supported. That way if another arch gained dom0less support, the
higher default would apply to it without needing further adjustment.)

> --- a/xen/arch/x86/efi/efi-boot.h
> +++ b/xen/arch/x86/efi/efi-boot.h
> @@ -18,7 +18,7 @@ static multiboot_info_t __initdata mbi = {
>   * The array size needs to be one larger than the number of modules we
>   * support - see __start_xen().
>   */
> -static module_t __initdata mb_modules[5];
> +static module_t __initdata mb_modules[CONFIG_NR_BOOTMODS + 1];

If the build admin selected 1, I'm pretty sure about nothing would work.
I think you want max(5, CONFIG_NR_BOOTMODS) or
max(4, CONFIG_NR_BOOTMODS) + 1 here and ...

> --- a/xen/arch/x86/guest/xen/pvh-boot.c
> +++ b/xen/arch/x86/guest/xen/pvh-boot.c
> @@ -32,7 +32,7 @@ bool __initdata pvh_boot;
>  uint32_t __initdata pvh_start_info_pa;
>  
>  static multiboot_info_t __initdata pvh_mbi;
> -static module_t __initdata pvh_mbi_mods[8];
> +static module_t __initdata pvh_mbi_mods[CONFIG_NR_BOOTMOD + 1];

... max(8, CONFIG_NR_BOOTMODS) here (albeit the 8 may have room for
lowering - I don't recall why 8 was chosen rather than going with
the minimum possible value covering all module kinds known at that
time).

Jan



 


Rackspace

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