All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Beulich <jbeulich@suse.com>
To: Penny Zheng <Penny.Zheng@arm.com>
Cc: wei.chen@arm.com, Andrew Cooper <andrew.cooper3@citrix.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Julien Grall <julien@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>, Wei Liu <wl@xen.org>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 6/6] xen: retrieve reserved pages on populate_physmap
Date: Tue, 17 May 2022 18:16:59 +0200	[thread overview]
Message-ID: <8ef3b2dc-ab14-d48e-6590-b35efbab863e@suse.com> (raw)
In-Reply-To: <20220510022733.2422581-7-Penny.Zheng@arm.com>

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.



      parent reply	other threads:[~2022-05-17 16:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-10  2:27 [PATCH V4 0/6] populate/unpopulate memory when domain on static Penny Zheng
2022-05-10  2:27 ` [PATCH v4 1/6] xen: do not free reserved memory into heap Penny Zheng
2022-05-16 18:01   ` Julien Grall
2022-05-17  8:21     ` Penny Zheng
2022-05-17  9:28       ` Julien Grall
2022-05-17 16:07         ` Jan Beulich
2022-05-18  6:06         ` Penny Zheng
2022-05-17 16:11   ` Jan Beulich
2022-05-18  2:29     ` Penny Zheng
2022-05-18  6:30       ` Jan Beulich
2022-05-10  2:27 ` [PATCH v4 2/6] xen: do not merge reserved pages in free_heap_pages() Penny Zheng
2022-05-16 17:36   ` Julien Grall
2022-05-10  2:27 ` [PATCH v4 3/6] xen: add field "flags" to cover all internal CDF_XXX Penny Zheng
2022-05-10  2:27 ` [PATCH v4 4/6] xen/arm: introduce CDF_staticmem Penny Zheng
2022-05-10  2:27 ` [PATCH v4 5/6] xen/arm: unpopulate memory when domain is static Penny Zheng
2022-05-10  2:27 ` [PATCH v4 6/6] xen: retrieve reserved pages on populate_physmap Penny Zheng
2022-05-16 18:29   ` Julien Grall
2022-05-17  6:24     ` Penny Zheng
2022-05-17  8:48       ` Julien Grall
2022-05-17 16:16   ` Jan Beulich [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ef3b2dc-ab14-d48e-6590-b35efbab863e@suse.com \
    --to=jbeulich@suse.com \
    --cc=Penny.Zheng@arm.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=george.dunlap@citrix.com \
    --cc=julien@xen.org \
    --cc=sstabellini@kernel.org \
    --cc=wei.chen@arm.com \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.