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 v2 6/6] xen/arm: retrieve reserved pages on populate_physmap
Date: Tue, 19 Apr 2022 11:14:54 +0200	[thread overview]
Message-ID: <c204a98a-2988-b85e-20e7-a77e77e6f39a@suse.com> (raw)
In-Reply-To: <20220418122251.3583049-7-Penny.Zheng@arm.com>

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



  reply	other threads:[~2022-04-19  9:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18 12:22 [PATCH V2 0/6] populate/unpopulate memory when domain on static Penny Zheng
2022-04-18 12:22 ` [PATCH v2 1/6] xen/arm: do not free reserved memory into heap Penny Zheng
2022-04-19  8:59   ` Jan Beulich
2022-04-19 10:25     ` Penny Zheng
2022-04-18 12:22 ` [PATCH v2 2/6] xen/arm: do not merge reserved pages in free_heap_pages() Penny Zheng
2022-04-18 12:22 ` [PATCH v2 3/6] xen: add field "flags" to cover all internal CDF_XXX Penny Zheng
2022-04-19  9:02   ` Jan Beulich
2022-04-18 12:22 ` [PATCH v2 4/6] xen/arm: introduce CDF_staticmem Penny Zheng
2022-04-21  0:08   ` Stefano Stabellini
2022-04-18 12:22 ` [PATCH v2 5/6] xen/arm: unpopulate memory when domain is static Penny Zheng
2022-04-19  9:10   ` Jan Beulich
2022-04-25  6:34     ` Penny Zheng
2022-04-25  8:00       ` Jan Beulich
2022-04-25  8:21         ` Penny Zheng
2022-04-18 12:22 ` [PATCH v2 6/6] xen/arm: retrieve reserved pages on populate_physmap Penny Zheng
2022-04-19  9:14   ` Jan Beulich [this message]
2022-04-19  8:46 ` [PATCH V2 0/6] populate/unpopulate memory when domain on static Jan Beulich
2022-04-19  9:11   ` Penny Zheng

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=c204a98a-2988-b85e-20e7-a77e77e6f39a@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.