[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:25:18 +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=6uRbLEDcSIn3pOirweLS+/AVRtzGTsuziAo0nk6+sNE=; b=SeDVFG/CZ6cdD5xbLLih8vjUStcRrzUaGVXMHlKV+PUtrZY9aAOEte3nFNwYifFsnot4DjSur6byinaaTzThMKrwqr5xuJTCvWrOcF1l8p37nqp5Q9WA+nRrV8Y7Xgq/CxMkP15Lht+Bu9w9RWn5a8xm9mENOuO/UAL1OLy2N+5MzugwHlJ7EPgnLNfNGnxCspnqJrvq7sTSaW50k/SZQekNgMsCTbSBIbiEGnE1mRMMe8hNJzuUurdoc0MVR0tDqgkxoUVgLdTSXEUVceqkKhr/fgxc6rojgG/KFYF5NdhZu39AenY04X5pPN6pVxOsyBHVva1GbQGhUe28gqbjEg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iLCsYEL9zoTu2k55dGuJenWwiCRMfHaoNpZJhVhVTXDaW4uEMBNziRXVsm/DURBTGFdpUS0YJ1VB2567i4b2N7ZitKBXQHKrsikAboQu0GRWbgCrASFPrZTVUcQvQGX/qa4leXCpZ1IPKZXbZbNn5LOL76RYtayYVvvr5zvzoqckQrQGI7oZFFmrM8ADexbhRoRhpj7OMU7gOJpZTfsjmUvq+qmdbftnDWpBNElbJrknVn1dQc3dtRezk/7ELxk2+e3pLv/A7OjKk7UY6LKLEDPwa4HUCs+SiSl/0+g+oAxEJRh1S6sUzsHal9s/wlU5UkmLFuc0rnz7ip5wlQO3jw==
  • 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:25:31 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 15.07.2021 07:18, Penny Zheng wrote:
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -1519,6 +1519,26 @@ static void free_heap_pages(
>      spin_unlock(&heap_lock);
>  }
>  
> +#ifdef CONFIG_STATIC_MEMORY
> +/* Equivalent of free_heap_pages to free nr_mfns pages of static memory. */
> +void __init free_staticmem_pages(struct page_info *pg, unsigned long nr_mfns,
> +                                 bool need_scrub)
> +{
> +    mfn_t mfn = page_to_mfn(pg);
> +    unsigned long i;
> +
> +    for ( i = 0; i < nr_mfns; i++ )
> +    {
> +        mark_page_free(&pg[i], mfn_add(mfn, i));
> +
> +        if ( need_scrub )
> +        {
> +            /* TODO: asynchronous scrubbing for pages of static memory. */
> +            scrub_one_page(pg);
> +        }
> +    }
> +}
> +#endif

Btw, I think the lack of locking warrants extending the comment above
the function, to spell out what the implications are (in particular:
calls here need to happen early enough).

Jan




 


Rackspace

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