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

Re: [PATCH V3 05/10] xen/arm: static memory initialization


  • To: Penny Zheng <penny.zheng@xxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 19 Jul 2021 10:20:10 +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-SenderADCheck; bh=+pzUDLabhAU1CElnoW/t1BEgFFiv9swMoUtBn9WmeSA=; b=gqY4NwVyF9eTfj78U6SzaoJ0WMc2Cg3dr59oF+2j05US4WSox67iOuTMlLAbYkbjJgSwc76cu3r0SSHKZIHnSYuLRx4d9k9rFR9xx5S4D4snZO/WhdJx8ZhHcyV0btUdj1KAqAUzu+UzevNft7iSVNMGyWQuJyRxYH2d5nfC1nGw5iGz1bBpJyorOH/a51LWXylRzsiC7fDVoLeunODdQpctSNWzVda4yNeMVyf8oKPhHARnkkgRC8YcMssnd2Rjnbv6g+u4oVNdec5bP35zyaxRA0YXFo9EIgDLm4g26uVjTRp4dD0Od3oB2Uh+zQdl96HDqsS1Av54JuwIDYNoeA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DTRmFhm3W4Kd6M2EIjbXgYfGOUv+aGmZzt2b1WXFKgW91sKSYx+1rHu6TE6xy4H/1D9e/qpyZFkzckdJbw9Y01QrBLN3LcfxUVbZOfIdhu7DKr2+dMqhbZA1z6b3colV7rtvJY4lDnf+bYKPo/aAM6TrcvZRHH9jb3/Gb3Cx94xjl8DoYw9DavQSByp5plbrMqAp4iri4ZdbxNjkFON0QnZP8I4bYPyEUMaB3HATG4TRVoKeDR966Id6QcYONb/pwfBKmUocsFJPMkEaCjGQRMHpbF1vICEoIqYF5YpZuaMQ8Bg53ggisOKxJ/RmPQPNiDTlxMOsXdTvwOTyXEHIYA==
  • Authentication-results: xen.org; dkim=none (message not signed) header.d=none;xen.org; dmarc=none action=none header.from=suse.com;
  • Cc: Bertrand.Marquis@xxxxxxx, Wei.Chen@xxxxxxx, nd@xxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxx, sstabellini@xxxxxxxxxx, julien@xxxxxxx
  • Delivery-date: Mon, 19 Jul 2021 08:20:24 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.07.2021 07:18, Penny Zheng wrote:
> v3 change:
> - include addition of CONFIG_STATIC_ALLOCATION in this commit, where it
> is firstly used and also change the name to CONFIG_STATIC_MEMORY
> - Fix TAB typo in Kconfig

Not sure what this relates to, but ...

> --- a/xen/arch/arm/Kconfig
> +++ b/xen/arch/arm/Kconfig
> @@ -106,6 +106,9 @@ config TEE
>  
>  source "arch/arm/tee/Kconfig"
>  
> +config STATIC_MEMORY
> +        def_bool y

... this is (wrongly) using spaces for indentation.

I also wonder about the placement: Shouldn't the option live in common
code, with Arm "select"ing it?

> --- a/xen/arch/arm/setup.c
> +++ b/xen/arch/arm/setup.c
> @@ -622,6 +622,28 @@ static void __init init_pdx(void)
>      }
>  }
>  
> +/* Static memory initialization */
> +static void __init init_staticmem_pages(void)
> +{
> +    unsigned int bank;
> +
> +    /* TODO: Considering NUMA-support scenario. */
> +    for ( bank = 0 ; bank < bootinfo.static_mem.nr_banks; bank++ )
> +    {
> +        paddr_t bank_start = bootinfo.static_mem.bank[bank].start;
> +        paddr_t bank_size = bootinfo.static_mem.bank[bank].size;
> +        paddr_t bank_end = bank_start + bank_size;
> +
> +        bank_start = round_pgup(bank_start);
> +        bank_end = round_pgdown(bank_end);
> +        if ( bank_end <= bank_start )
> +            return;
> +
> +        free_staticmem_pages(maddr_to_page(bank_start),
> +                            (bank_end - bank_start) >> PAGE_SHIFT, false);

Indentation (one too few spaces). Perhaps also consider to avoid
open-coding PFN_DOWN() here; in fact it and PFN_UP() could be used
in place of round_pg{down,up}() above.

Jan




 


Rackspace

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