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

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


  • To: George Dunlap <George.Dunlap@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Wed, 1 Jun 2022 11:06:04 +0200
  • 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=Ddtxoi3oD3OEprzkBRW5NKojO3cSePqftt7ZJcrxUeg=; b=OkdWbMLB9CDw9gKXmGRhvJXZ8igZmVEKG8farMcP/NmJFKUArGvNJ0KplAfsrUj+NqWEBN6XrDEiDz04sXsTX3zoeQCrOW4UH80WtVRHKeaC7LwfYdLAICL+ao+pKIt1VfxXwATyjCWc623KfB1xAceB2S0d3d5qc/8K6pPoX8MLJkCoH7GpnhXS+SlSzY5WIdczRUGNY5Exj+X6LJ+YaGj0Ps6m/UaA5VdJ4/Dll2iikw5DgD5SMe/7ACgWAjULrhWFupWksEVKaDROkCYKeHJMKi7v2GcreYBbbESe6Meg3cq97cHXnV0LOfvSsx0OdaCXQwzlYRDWZEIn0TuzUQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i9sUl/rMwpq2VLFKLnuUDCn/dHkdR8PYXDvNno1sBjToQLV/teBnEu3AyiTJHNT9b+eWO8iMoHH+iLhS5G8etBcXqJ4yjHixp0N/xPM+I+HIjT1TSv33qk3r+m1KZFA15ENbDnzRO6OcbLRjgrR2D50zZOkBGJP7K/4xlIHv3JntOlwQAp5Yh9TLsRJ6KdTekihHcLK+n3QRcOUokedyoTCuDU80mT0vpIH8shHmAPd4cNc2DxOrISRUT+JLmtlJfEm8/URDJ+YKTMOu9M4h3z5U8J095SQKIh88fHafKZSNdhchFLTO+Qjv59e0M+PLbg/I3asBQjHOcl2/wG2j7w==
  • 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 09:06:20 +0000
  • Ironport-data: A9a23:M9xvAaoP9nslIsbrfA2XQHq3gjNeBmK+ZBIvgKrLsJaIsI4StFCzt garIBnQOa2KMWLzfox1Od+y/U0OsJbRxtQxSVFurC8yFC9GpJuZCYyVIHmrMnLJJKUvbq7GA +byyDXkBJppJpMJjk71atANlVEliefQAOCU5NfsYkidfyc9IMsaoU8lyrdRbrJA24DjWVvT4 Yqq+qUzBXf+s9JKGjNMg068gEsHUMTa4Fv0aXRnOJinFHeH/5UkJMp3yZOZdhMUcaENdgKOf M7RzanRw4/s10xF5uVJMFrMWhZirrb6ZWBig5fNMkSoqkAqSicais7XOBeAAKv+Zvrgc91Zk b1wWZKMpQgBIJP0stYFbiFiQwZRE6JK3ZbbPkWeiJnGp6HGWyOEL/RGKmgTZNRd0MAnRGZE+ LofNSwHaQ2Fi6Su2rWnR+Jwh8Mlas72IIcYvXImxjbcZR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qLA BXNrCc2B9qSyLbU5iA1VMfg+BEH05DUytue3Jy9PB8iFNt7TJEJ0hx/r1rop5PzuN5d3B+3Z W0Dk1ZrsAxciYoV9MMOA4ge7rBNoWfe2O7DIqtSW6XZ50vCjbql6PdxokTyaWDRKEopaFC6q gpFmko/1IPRw==
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Wed, Jun 01, 2022 at 07:40:12AM +0000, George Dunlap wrote:
> 
> 
> > 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.

FWIW, I have an editor feature that highlights trailing whitespace,
but doesn't remove it.

As said, I find it cumbersome to have to go through more jumps while
using `git blame` or similar, just because of unrelated cleanups.

IMO I don't think it's good practice to wholesale replace all trailing
whitespace from a file as part of an unrelated change.  If people do
think this is fine I'm OK with it, but it's not my preference.  Just
raised this because such changes make it harder to use `git blame`
IMO (have to remember to use -w, but that won't help people using the
web interface for example).

Thanks, Roger.



 


Rackspace

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