[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: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 3 Jun 2022 14:58:15 +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=P09xsg/S0JeIpfNf9MHrZwsWQDycBLb0/iFvbFqey6o=; b=Cs3aFTtzonWzQDMOIl9i25ITPCh10QjuJ+Y/YWnWgUikhmqte+jQOCE9aoYMkFgFrzo6HPPZL4tuSxbM3YQFoc1+gipplKbE0oNEfRwIVREFSDz8L3b3uHX0aAvCBmLIGNEsAWT9Bzp0qhlSosvkGsP9gz0EC+asjRR5lBKtybejaL+JVZEnLOZTHi/JuL03Wm7HOblanXV0RpJvKhzzg9Po4osPfYuqUIkMbkJwl3e5sE/O8nl0/mO/ucQTSAYBgfOKB4OlJUNNaRcIArFwzV1UKB/g7qezYxefGqKQli+Yof5YBeV5HrPFvx8tinwm6GZDRvVQYL0qjFj89IKpHg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PVCR5ohBTumrojmlXscazpol0D+86O8I3b39IHzHBfHmuZ481w6AK2AXKlsVsyvt1dERo7W3/oUXHBurwriE0XCmuAfuS0vK9UVvBMaNUj2rSAClUr6tpdoqwima1VTG8FWOu9mKuNGI1WlTl4zyin6uZSdA14z4QqS4of1J3os8jErYiqofxorLOw2oundjo6VTjmhlcBongtPkAP1RlFS0WKIsGxxl8hCO2Ne4fyTBbSvjR06zy6aP2eCm3Tw74pNpp2nBAhIqBazRJ9hkFR/0Ocx9h1J2SJeKXojm7gfVJRW3u1GIRlj3+0TGNh9ry+vhevfG2N4lkS7Y++bJew==
  • 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, sstabellini@xxxxxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, 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: Fri, 03 Jun 2022 12:58:26 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 31.05.2022 04:41, Daniel P. Smith wrote:
> --- 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];

Did this build successfully for you? Looks like the trailing S is
missing ...

> --- a/xen/arch/x86/setup.c
> +++ b/xen/arch/x86/setup.c
> @@ -1017,9 +1017,9 @@ void __init noreturn __start_xen(unsigned long mbi_p)
>          panic("dom0 kernel not specified. Check bootloader configuration\n");
>  
>      /* Check that we don't have a silly number of modules. */
> -    if ( mbi->mods_count > sizeof(module_map) * 8 )
> +    if ( mbi->mods_count > CONFIG_NR_BOOTMODS )
>      {
> -        mbi->mods_count = sizeof(module_map) * 8;
> +        mbi->mods_count = CONFIG_NR_BOOTMODS;
>          printk("Excessive multiboot modules - using the first %u only\n",
>                 mbi->mods_count);
>      }

You'll want to accompany this by a BUILD_BUG_ON() checking that
the Kconfig value doesn't exceed the capacity of module_map. Without
that it could be quite hard to notice that a bump of the upper bound
in the Kconfig file would result in an issue here.

Jan




 


Rackspace

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