All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Penny Zheng <Penny.Zheng@arm.com>
Cc: xen-devel@lists.xenproject.org, wei.chen@arm.com,
	 Stefano Stabellini <sstabellini@kernel.org>,
	Julien Grall <julien@xen.org>,
	 Bertrand Marquis <bertrand.marquis@arm.com>,
	 Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	 Andrew Cooper <andrew.cooper3@citrix.com>,
	 George Dunlap <george.dunlap@citrix.com>,
	Jan Beulich <jbeulich@suse.com>,  Wei Liu <wl@xen.org>
Subject: Re: [PATCH v2 4/6] xen/arm: introduce CDF_staticmem
Date: Wed, 20 Apr 2022 17:08:34 -0700 (PDT)	[thread overview]
Message-ID: <alpine.DEB.2.22.394.2204201708240.915916@ubuntu-linux-20-04-desktop> (raw)
In-Reply-To: <20220418122251.3583049-5-Penny.Zheng@arm.com>

On Mon, 18 Apr 2022, Penny Zheng wrote:
> In order to have an easy and quick way to find out whether this domain memory
> is statically configured, this commit introduces a new flag CDF_staticmem and a
> new helper is_domain_static to tell.
> 
> Signed-off-by: Penny Zheng <penny.zheng@arm.com>

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>


> ---
> v2 changes:
> - change name from "is_domain_on_static_allocation" to "is_domain_static()"
> ---
>  xen/arch/arm/domain_build.c       | 5 ++++-
>  xen/arch/arm/include/asm/domain.h | 2 ++
>  xen/include/xen/domain.h          | 2 ++
>  3 files changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c
> index 8be01678de..4e62fd0bf1 100644
> --- a/xen/arch/arm/domain_build.c
> +++ b/xen/arch/arm/domain_build.c
> @@ -3191,9 +3191,12 @@ void __init create_domUs(void)
>          if ( !dt_device_is_compatible(node, "xen,domain") )
>              continue;
>  
> +        if ( dt_find_property(node, "xen,static-mem", NULL) )
> +            flags |= CDF_staticmem;
> +
>          if ( dt_property_read_bool(node, "direct-map") )
>          {
> -            if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) || !dt_find_property(node, "xen,static-mem", NULL) )
> +            if ( !IS_ENABLED(CONFIG_STATIC_MEMORY) || !(flags & CDF_staticmem) )
>                  panic("direct-map is not valid for domain %s without static allocation.\n",
>                        dt_node_name(node));
>  
> diff --git a/xen/arch/arm/include/asm/domain.h b/xen/arch/arm/include/asm/domain.h
> index 36ec00e62d..b097433f9f 100644
> --- a/xen/arch/arm/include/asm/domain.h
> +++ b/xen/arch/arm/include/asm/domain.h
> @@ -31,6 +31,8 @@ enum domain_type {
>  
>  #define is_domain_direct_mapped(d) ((d)->flags & CDF_directmap)
>  
> +#define is_domain_static(d) ((d)->flags & CDF_staticmem)
> +
>  /*
>   * Is the domain using the host memory layout?
>   *
> diff --git a/xen/include/xen/domain.h b/xen/include/xen/domain.h
> index 1c3c88a14d..35dc7143a4 100644
> --- a/xen/include/xen/domain.h
> +++ b/xen/include/xen/domain.h
> @@ -34,6 +34,8 @@ void arch_get_domain_info(const struct domain *d,
>  #ifdef CONFIG_ARM
>  /* Should domain memory be directly mapped? */
>  #define CDF_directmap            (1U << 1)
> +/* Is domain memory on static allocation? */
> +#define CDF_staticmem            (1U << 2)
>  #endif
>  
>  /*
> -- 
> 2.25.1
> 


  reply	other threads:[~2022-04-21  0:09 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 [this message]
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
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=alpine.DEB.2.22.394.2204201708240.915916@ubuntu-linux-20-04-desktop \
    --to=sstabellini@kernel.org \
    --cc=Penny.Zheng@arm.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=george.dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.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.