[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] xen/arm: bootfdt: Ignore empty memory bank
- To: Julien Grall <julien@xxxxxxx>
- From: Bertrand Marquis <Bertrand.Marquis@xxxxxxx>
- Date: Mon, 21 Sep 2020 12:24:24 +0000
- Accept-language: en-GB, en-US
- 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-SenderADCheck; bh=cNBBm1mANX89y44izPcFbe9YvEWtwXEwl73gldcT0jU=; b=gAEfKA8+BI6Z6Tqzc4MQpvqKc/YwTFKizDAs1fnI3V/dB5XpAD47aosokcXzbe3U7LLG7nDpJLO2UHY9lQonEa44POmtVPMWEC6eBRLCYEFQmGseab/Q5GuYa5I+1ZPlQ354OdD3JckzYalL6ib12tBCNSyD3rB8zUe6Cpuv9TdBVLiEy5w2A2rqLY/f/EH4DDpwHxW5VS3Lb7YXHayz1B9w3cbJxuxw0wlwdQJAodM9iZGNjz9dcJu3/DwzLEVZEpBSuxWWtipn3IUzAjCTPlt+jtXWJQtRe/9Ws2bdAouC4gbaSCte155IdW3QhRX+4/Xi9mO/kpMRbTQzdxgLFQ==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=en7lGEAsQyZcyRU2trxmVaUqx4o5i0r7FiDzQIQKgBOuTkDl9A792tAjohV12EOoX/a8ENTYOIItPFA/7o/Dur/J2UliCbUth6GhrtoysbPG+L25UZjufhVP2abBc2fweKYUgEqoeqviPj5VHfpI15X13+Q5Q4pKzSuJdeo6B9IzQ71mX7gWDisyrtG9V7KcluqHW5BJ+F31JM+jaxmr+YdRnpxZSBHLm1/nCzi28hJdxNMHApop5EuTr2V98PiR7UxsrqR8lVmwZQomSxBonlbxcjxb6+P4bRVYU3MUr6gl+vh+dxaCdeP2NGRFBNwx/22j2qoB14JInZdfnr6vHw==
- Authentication-results-original: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
- Cc: "open list:X86" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Julien Grall <jgrall@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Daniel Wagner <Daniel.Wagner2@xxxxxxxxxxxxxxxxxx>
- Delivery-date: Mon, 21 Sep 2020 12:25:08 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
- Nodisclaimer: true
- Original-authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=arm.com;
- Thread-index: AQHWjd7zyb31yIRDt0eFx2X6X5zVxKlzCIiA
- Thread-topic: [PATCH] xen/arm: bootfdt: Ignore empty memory bank
> On 18 Sep 2020, at 18:11, Julien Grall <julien@xxxxxxx> wrote:
>
> From: Julien Grall <jgrall@xxxxxxxxxx>
>
> At the moment, Xen will stop processing the Device Tree if a memory
> bank is empty (size == 0).
>
> Unfortunately, some of the Device Tree (such as on Colibri imx8qxp)
> may contain such a bank. This means Xen will not be able to boot
> properly.
>
> Relax the check to just ignore the banks. FWIW this also seems to be the
> behavior adopted by Linux.
>
> Reported-by: Daniel Wagner <Daniel.Wagner2@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Julien Grall <jgrall@xxxxxxxxxx>
Reviewed-by: Bertrand Marquis <bertrand.marquis@xxxxxxx>
> ---
> xen/arch/arm/bootfdt.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/xen/arch/arm/bootfdt.c b/xen/arch/arm/bootfdt.c
> index 08fb59f4e7a9..dcff512648a0 100644
> --- a/xen/arch/arm/bootfdt.c
> +++ b/xen/arch/arm/bootfdt.c
> @@ -163,8 +163,9 @@ static int __init process_memory_node(const void *fdt,
> int node,
> for ( i = 0; i < banks && mem->nr_banks < NR_MEM_BANKS; i++ )
> {
> device_tree_get_reg(&cell, address_cells, size_cells, &start, &size);
> + /* Some DT may describe empty bank, ignore them */
> if ( !size )
> - return -EINVAL;
> + continue;
> mem->bank[mem->nr_banks].start = start;
> mem->bank[mem->nr_banks].size = size;
> mem->nr_banks++;
> --
> 2.17.1
>
>
|