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

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


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • From: George Dunlap <George.Dunlap@xxxxxxxxxx>
  • Date: Wed, 1 Jun 2022 07:40:12 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=jyVIV3LeyRDNNE3omh0hYjfR0gRzgBqV4vaR1GTJwGc=; b=QBcfO1HQMt/WGPSFQ7oU6dCa39K8bIO+GwwDEWRlKTkHyhutMZ5C909NB9pRkhNgMvoNpO6zM0h9yayOfXO417PpfoTeXNyaUv/ABDkk6cm4eyxRsUgpGPJ0XZye63Xui8uevuesuL2fo3mXff+UOLe1G2jMCKPUa1RT2oEPpgLLyntgYyR55FgGRw131pKudGmyIY0KWHTch7kXkcnsTkNxkVyuBUoqCi+c1uqrWMBQP7xGJS4eKH/PuleYJoJjm6ZmYVSNRolxEZyTgenxP3IqLZEVr0+aYBbInJEAyvdwolPzuwTSDheSe9PGUUa9cfEqDFKz5fZ3nkXURls7eQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NPoyHLuHqg/V2IGli49OBV46OIZRom69JFN+KcRQFxW57NdidSezY52a4+Sv/c12Th6LCeJip0tL622msYfEenFWxlk0uQDoJn2xZbA2xouKd2BJJ5jDhwmZnjB0MMK0qXcNwQbqdA9dqGCNA4VyXxzOr/2TW4AA0PF1i3p8Y0ukUD6l9fuf3qHWzS0zg7chvfHQTMJUpzgi+QgTzA7r23xTP6ucoLCp4+RqGHsDsGNQaRjvsigb06+ea5c3+ueTbGuXak4FcnxyxIuDL2xBEkJwo5qxVqeH+UufWYBI/T8mD73ksJKdfKvxQZMknfnXVHMXBkf3xzP0kqumPBX45w==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "Daniel P. Smith" <dpsmith@xxxxxxxxxxxxxxxxxxxx>, Bertrand Marquis <Bertrand.Marquis@xxxxxxx>, 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>, Jan Beulich <jbeulich@xxxxxxxx>, Julien Grall <julien@xxxxxxx>
  • Delivery-date: Wed, 01 Jun 2022 07:40:28 +0000
  • Ironport-data: A9a23:N324Vq9PusZMWOWfjvd+DrUDkn6TJUtcMsCJ2f8bNWPdYAuX7wSz/ BJcAD7Ya7vPIDfrKpolWDmFhUhQu5aHy94xSFBqqCo8FStG95efC4yScB/+ZHPIcJPJER055 pgQNdKdfcxpQCKN/h2naeTq9XVw2KjUT7SsVL+s1kydPeNBYH5JZUVLx75p6mIRveWEPu+th T/Ti5LTNgao0GclamtOsKzYpEM+5aX75mlG41Zhb68bt1HXxiUZVJ4RG/q8fiDyKmV28k9WZ AphIJWRpD6xE8IFU4v9+lrDWhRWBOaUZ2Bis1IOM0SYqkEqShcaj+BqbZLwVW8N02/Tx44pk Y0U3XCNYVxB0pPkybx1vyZwS0mSDYUekFMQCSHi2SA75xSun0rEm52CPmlvVWEr0r8f7VV13 e4ZMFgwgiWr3Ipa9l4Zpt5E3azPJOGzVG8WV+oJIT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Lmxa1+ Uk7S1QefiboEmhA11d6SGdpzUIlgxepEMKgGXo/0fLsIj3Qik3BNFGgp8cehzF61A4tNU5y6 5T2XmF3qAnRS8pDEzGlqf1vjxR5zyJSEAZ4KcuZr1kIPkjQa4UqZZa8FJeEZ8GEi6/4Ic7EP N2BMWZ4PpNa1uVY33Qo2EqmbWXLz4ONwbDRlJHtt2e0jBQknw8x0wExNYHlnNF8J4mUZFL6+ nNL6wtnrBTSc0da757GY46MICKI32IRQiJPHOZIFzhGq1CM3XRq4Tv6LFw/+2ucIxg9upEpH 0AaiItiYcfQTOfNSTV5uw7zvnkehTPYR39jsdD+pN+prrwALL2LCzrciFar/ed
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYdHaBi3mMFaceck2YWC859wyqAa04suMAgAAbYQCAADQ0AIABKjuA
  • Thread-topic: [RFC PATCH 1/4] kconfig: allow configuration of maximum modules



On 31 May 2022, at 14:52, Roger Pau Monne <roger.pau@xxxxxxxxxx> wrote:

On Tue, May 31, 2022 at 06:45:52AM -0400, Daniel P. Smith wrote:
On 5/31/22 05:07, Bertrand Marquis wrote:
Hi Daniel,

Greetings Bertrand.

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.

I have been trying to clean up trailing white space when I see it
nearby. I can drop this one if that is desired.

IMO it's best if such white space removal is only done when already
modifying the line, or else it makes it harder to track changes when
using `git blame` for example (not likely in this case since it's a
multi line comment).

The down side of this is that you can’t use “automatically remove trailing whitespace on save” features of some editors.

Without such automation, I introduce loads of trailing whitespace.  With such automation, I end up removing random trailing whitespace as I happen to touch files.  I’ve always done this by just adding “While here, remove some trailing whitespace” to the commit message, and there haven’t been any complaints.

If we actually care about trailing whitespace, then I think we should accept random fix-ups as files are touched.  OTOH if we want to avoid random fix-ups, we should remove the aversion to trailing whitespace.

 -George

Attachment: signature.asc
Description: Message signed with OpenPGP


 


Rackspace

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