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

Re: [PATCH] xen/arm: Add Kconfig parameter for memory banks number


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <luca.fancellu@xxxxxxx>
  • Date: Tue, 7 Dec 2021 10:52:04 +0000
  • 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=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=9SNRZIlkIQfr2XxDNhrlBDHkr/swtumsR7/J+3zcYVU=; b=OwFfv0h6fFzVn5eaQd6WIrXQwFO/iYR0IIPU82tvRv6d7SS24iizpU+RxBFFDMmptiH7YNwmwTNWF7kZTxg8Q8PhUhNg7sQIkod5OgobO/5twDB1s2IRso/LG5UxFRPTAb9QQWil/NK3D+G7+BOkJYXDzzUXNRbd9N5wBxP1+QbrwbCjINL+18EtUQYHw1e53tkapORKALbEth7ajxsLjcMf6PwR9ArQ5kLioFbviIb6cv/UUGuq+HOscUPYww5gULVKwJCrf2uB9JiWzjlo/IEmb7BP1obiBp7NAjJ+JYobNHIhXwCyJiDwE/4CBj0oFd1LboiulXSEcrJGewi9BQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xao76e67KvxzmA60XxBsM9gatkD7NpbuIzcZjHkZJKUjvhNg39SyQ8ELJjGclFYIqZ8G+xAiV0Ls4UcLWLYiQD/3bNBUR1CqaWGtWzsb1qHBHH52KDbFlCJIzh5KCrXANu1YmZECw3mCDzzxazT4yCF8aPx9f5vfjTc9ToC6gSl7s8g5QJNFOY5SxRR/kV3HeEmT0V4qwNEAFED3EA1YoYQStICAT4yxSOPmI9RPiUZ4TcPmiLctXkAIDIWXqvhVgVEV7iT+00NqfZ9yi6Ac5pW41+ejnLGYUeJJPFWN+ytF7K4izR4u0IUxhAxNy7EwaujBE8Tr9zCREA8kZYPT/A==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, bertrand.marquis@xxxxxxx, wei.chen@xxxxxxx, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>
  • Delivery-date: Tue, 07 Dec 2021 10:52:27 +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;


> On 6 Dec 2021, at 17:05, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Luca,
> 
> On 06/12/2021 15:37, Luca Fancellu wrote:
>> Currently the maximum number of memory banks is fixed to
>> 128, but on some new platforms that have a large amount
>> of memory, this value is not enough 
> 

Hi Julien,

> Can you provide some information on the setup? Is it using UEFI?

Yes it is a platform with 32gb of ram, I’ve built Xen with ACPI support and 
it’s starting using UEFI+ACPI.

> 
>> and prevents Xen
>> from booting.
> 
> AFAIK, the restriction should only prevent Xen to use all the memory. If 
> that's not the case, then this should be fixed.

The code that it’s failing is this, inside efi_process_memory_map_bootinfo(…) 
in the arch/arm/efi/efi-boot.h:

#ifdef CONFIG_ACPI
        else if ( desc_ptr->Type == EfiACPIReclaimMemory )
        {
            if ( !meminfo_add_bank(&bootinfo.acpi, desc_ptr) )
            {
                PrintStr(L"Error: All " __stringify(NR_MEM_BANKS)
                          " acpi meminfo mem banks exhausted.\r\n");
                return EFI_LOAD_ERROR;
            }
        }
#endif

> 
>> Create a Kconfig parameter to set the value, by default
>> 128.
> 
> I think Xen should be able to boot on any platform with the default 
> configuration. So the value should at least be bumped.
> 
>> Signed-off-by: Luca Fancellu <luca.fancellu@xxxxxxx>
>> ---
>>  xen/arch/arm/Kconfig        | 8 ++++++++
>>  xen/include/asm-arm/setup.h | 2 +-
>>  2 files changed, 9 insertions(+), 1 deletion(-)
>> diff --git a/xen/arch/arm/Kconfig b/xen/arch/arm/Kconfig
>> index ecfa6822e4d3..805e3c417e89 100644
>> --- a/xen/arch/arm/Kconfig
>> +++ b/xen/arch/arm/Kconfig
>> @@ -25,6 +25,14 @@ menu "Architecture Features"
>>    source "arch/Kconfig"
>>  +config MEM_BANKS
>> +    int "Maximum number of memory banks."
>> +    default "128"
>> +    help
>> +      Controls the build-time size memory bank array.
>> +      It is the upper bound of the number of logical entities describing
>> +      the memory.
> 
> NR_MEM_BANKS is going to be used by multiple internal structure in Xen (e.g. 
> static memory, reserved memory, normal memory). So how could an admin decide 
> the correct value?
> 
> In particular for UEFI, we are at the mercy of the firmware that can expose 
> any kind of memory map (that's why we had to increase the original number of 
> banks).
> 
> So maybe it is time for us to move out from a static array and re-think how 
> we discover the memory.
> 
> That this is probably going to take some time to get it properly, so
> I would be OK with bumping the value + a config gated UNSUPPORTED.

I can do that.

Cheers,
Luca

> 
>> +
>>  config ACPI
>>      bool "ACPI (Advanced Configuration and Power Interface) Support 
>> (UNSUPPORTED)" if UNSUPPORTED
>>      depends on ARM_64
>> diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h
>> index 95da0b7ab9cd..785a8fe81450 100644
>> --- a/xen/include/asm-arm/setup.h
>> +++ b/xen/include/asm-arm/setup.h
>> @@ -6,7 +6,7 @@
>>  #define MIN_FDT_ALIGN 8
>>  #define MAX_FDT_SIZE SZ_2M
>>  -#define NR_MEM_BANKS 128
>> +#define NR_MEM_BANKS CONFIG_MEM_BANKS
>>    #define MAX_MODULES 32 /* Current maximum useful modules */
>>  
> 
> Cheers,
> 
> -- 
> Julien Grall




 


Rackspace

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