[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 6/6] xen: retrieve reserved pages on populate_physmap
- To: Penny Zheng <Penny.Zheng@xxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Tue, 17 May 2022 18:16:59 +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=p+SLWDNDM900chpyBUlVFtLC/KqH7c87vTOavH25HHc=; b=JuDxTOySUe/RtLqeQOX9EpwA0m1ZwflK+ThHo/KajoYJTAkX5hYUZbTv0LuwHgx96oPQM4Fp8K38ezI2hnI2gdtiAIYcTVbmVzW+U2WW/ZC9PQZ+RWVlirmQHCdoNXoY+5b5KaBwqvNuGoDzGZnvPtdAkNV5hLniT21n5RmN4v+SRQqNIj9Yb83EUsGfNwB635n4FYDeJdFsrN3OdyPLJgePslo4xLGvlF+kK6WnH1AQ0aSVyFufGIJswRu5NF+qpept3GbS1N3LMUr8aexWJeyp/174TASieY6Xome5wG81H/jkNS1IsUc/0luqmcwhbIhwUbi3rQHLtuDM+ot+jg==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SqxgMzSkhGfR6zzlFAPEpwVUazsRFrDrbZLIt7bXGrOcNYmjS2jho7fR2cGyPegkBMnlE7j4HFJFjU1yZQtH/ly2gK6r0S3utt5apKEhKoR2GIEp9GIF8QoODHjVfEJuEdTTswWcIbul8V6GiM2I1wt1/cXYSIeoCsVilxiDttXukPg/PHSqpNaGIsgpvdci0+tb+uM/bMD2O836v5oN4wg/g3NvLKaAcdOpyP3rQNLlItp6+XG497qyvwfz05+EbwLXmw3OJLnidSgbwLFHg4nEmUkMbpZWmh3wDl83s7siZd9EjnFspe1O2eJIEHpDe6Wp4Qxb1wtSWDtSVjK6DA==
- 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, 17 May 2022 16:17:11 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 10.05.2022 04:27, Penny Zheng wrote:
> @@ -2769,12 +2769,43 @@ 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) )
> + return INVALID_MFN;
> +
> + smfn = page_to_mfn(page);
> +
> + if ( acquire_domstatic_pages(d, smfn, 1, memflags) )
> + {
> + page_list_add_tail(page, &d->resv_page_list);
> + return INVALID_MFN;
> + }
> +
> + return smfn;
> +}
> #else
> void free_staticmem_pages(struct page_info *pg, unsigned long nr_mfns,
> bool need_scrub)
> {
> ASSERT_UNREACHABLE();
> }
> +
> +mfn_t acquire_reserved_page(struct domain *d, unsigned int memflags)
> +{
> + ASSERT_UNREACHABLE();
> + return INVALID_MFN;
> +}
> #endif
Much like for the other stub function added in the earlier patch: If
is_domain_using_staticmem() was compile time constant "false" when
!CONFIG_STATIC_MEM, there would be no need for this one since the
compiler would DCE the only call site.
|