[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 6/6] xen/arm: retrieve reserved pages on populate_physmap
- To: Penny Zheng <Penny.Zheng@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 19 Apr 2022 11:14:54 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=0GkGb3tsZKp7cwVLodyek/nmMqvzXVknfmvXj7A655g=; b=AY6AyTrFvfcwBaiN1C2Fqh5dV+N4vryccn/+uFnk3GuBogX2PkT1J4TWj6hBl9m7TMmj4QpDVHe4DPQal+WVXMao2FKbHi4dGpH9F0w6Bx2dhEQ4LP0kWd7GbW6l8Qnb+ZBgT5XfiOrBS2QzA2HiggOwYhgJh/ZkueYhPv4DMbC0sl2fCbPsICRjYy3LtGBs/FVZcsQw6P1eLetINkcR4wuwtoB6hUrbaPuP+Otqkga6dIU+y7uMFh8B3BE0kFjrWMPiUxDSLBSjuYZS465ZdEdS84bWCnUbDVU4/R0OTNz83vEY30fZf0tEa0qPjgxDytochG0OkEW2ipFPQbL4Ow==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZlEdzF+LIINjmbQq9xjEExf6mv15DxqxnRTMht6+onwslCljVhSJzedWEpUgNoORvEBEcLcMG0MYIzd83QbVdPmvoYdzPtFMIes3hOZzysn75bCiuL7RLEaDL5jGTWILETfnhREtp+290Pyu5xNl4BtoHz+/N2fGCJjzQYcyti4xUDjDGSFo8kkCba6huq7ZdNwhJzRSvba2nKEy+uCgPuO3rFcOtd1Q9XI4GC86YiiRGFwIviJR1rrTVVNY77Iqg6jdc2egXUggcO7micF2pRYCYKMXHb6vJc3LqVt/rf1GiqRifw4v6KpDBKwN2/muyodjBfBl7eQhuc3oibh5Ow==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: wei.chen@xxxxxxx, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Tue, 19 Apr 2022 09:15:01 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 18.04.2022 14:22, Penny Zheng wrote:
> --- a/xen/common/memory.c
> +++ b/xen/common/memory.c
> @@ -35,6 +35,10 @@
> #include <asm/guest.h>
> #endif
>
> +#ifndef is_domain_static
> +#define is_domain_static(d) ((void)(d), false)
> +#endif
I think this might better live in a header. I wonder why you add it
though, considering ...
> @@ -245,6 +249,31 @@ static void populate_physmap(struct memop_args *a)
>
> mfn = _mfn(gpfn);
> }
> +#ifdef CONFIG_STATIC_MEMORY
> + else if ( is_domain_static(d) )
... its use sits inside an #ifdef which ought to guarantee it's defined.
That said, even better would imo be if no new #ifdef-ary appeared here.
> --- a/xen/common/page_alloc.c
> +++ b/xen/common/page_alloc.c
> @@ -2770,6 +2770,34 @@ int __init acquire_domstatic_pages(struct domain *d,
> mfn_t smfn,
>
> return 0;
> }
> +
> +/*
> + * Acquire a page from reserved page list(resv_page_list), when populating
> + * memory for static domain on runtime.
> + */
> +mfn_t acquire_reserved_page(struct domain *d, unsigned int memflags)
> +{
> + struct page_info *page;
> + mfn_t smfn;
> +
> + /* Acquire a page from reserved page list(resv_page_list). */
> + page = page_list_remove_head(&d->resv_page_list);
> + if ( unlikely(!page) )
> + {
> + printk(XENLOG_ERR
> + "%pd: failed to acquire a reserved page %"PRI_mfn".\n",
> + d, mfn_x(page_to_mfn(page)));
"page" is NULL, so page_to_mfn(page) is meaningless.
Jan
|