Xen-Devel Archive on lore.kernel.org
 help / color / Atom feed
From: Julien Grall <julien.grall@gmail.com>
To: Stefano Stabellini <sstabellini@kernel.org>
Cc: xen-devel <xen-devel@lists.xenproject.org>,
	Julien Grall <julien.grall@arm.com>,
	ian.jackson@eu.citrix.com, wei.liu2@citrix.com,
	Stefano Stabellini <stefanos@xilinx.com>
Subject: Re: [Xen-devel] [PATCH v2 05/10] libxl/xl: add memory policy option to iomem
Date: Tue, 18 Jun 2019 23:20:56 +0100
Message-ID: <CAF3u54CHbQo82D18LTOdhbLgq4YfHkVin1c4YDkv0QLuqwUL3Q@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.21.1906181415510.2072@sstabellini-ThinkPad-T480s>

[-- Attachment #1.1: Type: text/plain, Size: 2061 bytes --]

Sorry for the formatting.

On Tue, 18 Jun 2019, 23:09 Stefano Stabellini, <sstabellini@kernel.org>
wrote:

> On Tue, 18 Jun 2019, Julien Grall wrote:
> > On 30/04/2019 22:02, Stefano Stabellini wrote:
> > > diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c
> > > index 89fe80f..a6c5e30 100644
> > > --- a/tools/libxl/libxl_create.c
> > > +++ b/tools/libxl/libxl_create.c
> > > @@ -415,6 +415,21 @@ static void init_console_info(libxl__gc *gc,
> > >          Only 'channels' when mapped to consoles have a string name. */
> > >   }
> > >   +static uint32_t libxl__memory_policy_to_xc(libxl_memory_policy c)
> > > +{
> > > +    switch (c) {
> > > +    case LIBXL_MEMORY_POLICY_ARM_MEM_WB:
> > > +        return MEMORY_POLICY_ARM_MEM_WB;
> > > +    case LIBXL_MEMORY_POLICY_ARM_DEV_NGRE:
> > > +        return MEMORY_POLICY_ARM_DEV_nGRE;
> > > +    case LIBXL_MEMORY_POLICY_X86_UC:
> > > +        return MEMORY_POLICY_X86_UC;
> > > +    case LIBXL_MEMORY_POLICY_DEFAULT:
> > > +    default:
> >
> > Looking at this again, don't we want to bail out if the policy is
> unknown? My
> > concern here is the user may configure with something it didn't expect.
> The
> > risk is the problem will be hard to debug.
> >
> > I also believe this could be part of libxl_{arm,x86}.c allowing us to
> filter
> > misuse early.
>
> This sounds like a good idea, I can do that. Then, I can also #ifdef the
> hypercalls defines, although for some reason today libxl doesn't have
> CONFIG_X86 or CONFIG_ARM set so I would also have to do the following in
> the libxl Makefile:
>
> ifeq ($(CONFIG_X86),y)
> CFLAGS_LIBXL += -DCONFIG_X86
> else
> CFLAGS_LIBXL += -DCONFIG_ARM
> endif
>

Or just follow what we do today in other public headers:

#if defined(__arm__) || defined(__aarch64__)

You need to double check the exact syntax as I wrote it by memory.

Cheers,


>
> > Ian, Wei, any opinion?
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-devel

[-- Attachment #1.2: Type: text/html, Size: 3236 bytes --]

<div dir="auto"><div>Sorry for the formatting.<br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, 18 Jun 2019, 23:09 Stefano Stabellini, &lt;<a href="mailto:sstabellini@kernel.org">sstabellini@kernel.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, 18 Jun 2019, Julien Grall wrote:<br>
&gt; On 30/04/2019 22:02, Stefano Stabellini wrote:<br>
&gt; &gt; diff --git a/tools/libxl/libxl_create.c b/tools/libxl/libxl_create.c<br>
&gt; &gt; index 89fe80f..a6c5e30 100644<br>
&gt; &gt; --- a/tools/libxl/libxl_create.c<br>
&gt; &gt; +++ b/tools/libxl/libxl_create.c<br>
&gt; &gt; @@ -415,6 +415,21 @@ static void init_console_info(libxl__gc *gc,<br>
&gt; &gt;          Only &#39;channels&#39; when mapped to consoles have a string name. */<br>
&gt; &gt;   }<br>
&gt; &gt;   +static uint32_t libxl__memory_policy_to_xc(libxl_memory_policy c)<br>
&gt; &gt; +{<br>
&gt; &gt; +    switch (c) {<br>
&gt; &gt; +    case LIBXL_MEMORY_POLICY_ARM_MEM_WB:<br>
&gt; &gt; +        return MEMORY_POLICY_ARM_MEM_WB;<br>
&gt; &gt; +    case LIBXL_MEMORY_POLICY_ARM_DEV_NGRE:<br>
&gt; &gt; +        return MEMORY_POLICY_ARM_DEV_nGRE;<br>
&gt; &gt; +    case LIBXL_MEMORY_POLICY_X86_UC:<br>
&gt; &gt; +        return MEMORY_POLICY_X86_UC;<br>
&gt; &gt; +    case LIBXL_MEMORY_POLICY_DEFAULT:<br>
&gt; &gt; +    default:<br>
&gt; <br>
&gt; Looking at this again, don&#39;t we want to bail out if the policy is unknown? My<br>
&gt; concern here is the user may configure with something it didn&#39;t expect. The<br>
&gt; risk is the problem will be hard to debug.<br>
&gt; <br>
&gt; I also believe this could be part of libxl_{arm,x86}.c allowing us to filter<br>
&gt; misuse early.<br>
<br>
This sounds like a good idea, I can do that. Then, I can also #ifdef the<br>
hypercalls defines, although for some reason today libxl doesn&#39;t have<br>
CONFIG_X86 or CONFIG_ARM set so I would also have to do the following in<br>
the libxl Makefile:<br>
<br>
ifeq ($(CONFIG_X86),y)<br>
CFLAGS_LIBXL += -DCONFIG_X86<br>
else<br>
CFLAGS_LIBXL += -DCONFIG_ARM<br>
endif<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Or just follow what we do today in other public headers:</div><div dir="auto"><br></div><div dir="auto">#if defined(__arm__) || defined(__aarch64__)</div><div dir="auto"><br></div><div dir="auto">You need to double check the exact syntax as I wrote it by memory.</div><div dir="auto"><br></div><div dir="auto">Cheers,</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
&gt; Ian, Wei, any opinion?<br>
<br>
_______________________________________________<br>
Xen-devel mailing list<br>
<a href="mailto:Xen-devel@lists.xenproject.org" target="_blank" rel="noreferrer">Xen-devel@lists.xenproject.org</a><br>
<a href="https://lists.xenproject.org/mailman/listinfo/xen-devel" rel="noreferrer noreferrer" target="_blank">https://lists.xenproject.org/mailman/listinfo/xen-devel</a></blockquote></div></div></div>

[-- Attachment #2: Type: text/plain, Size: 157 bytes --]

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply index

Thread overview: 86+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-30 21:02 [PATCH v2 0/10] iomem memory policy Stefano Stabellini
2019-04-30 21:02 ` [Xen-devel] " Stefano Stabellini
2019-04-30 21:02 ` [PATCH v2 01/10] xen: add a p2mt parameter to map_mmio_regions Stefano Stabellini
2019-04-30 21:02   ` [Xen-devel] " Stefano Stabellini
2019-05-02 14:59   ` Jan Beulich
2019-05-02 14:59     ` [Xen-devel] " Jan Beulich
2019-05-02 18:49     ` Stefano Stabellini
2019-05-02 18:49       ` [Xen-devel] " Stefano Stabellini
2019-05-15 13:39   ` Oleksandr
2019-05-15 13:39     ` [Xen-devel] " Oleksandr
2019-04-30 21:02 ` [PATCH v2 02/10] xen: rename un/map_mmio_regions to un/map_regions Stefano Stabellini
2019-04-30 21:02   ` [Xen-devel] " Stefano Stabellini
2019-05-01  9:22   ` Julien Grall
2019-05-01  9:22     ` [Xen-devel] " Julien Grall
2019-06-17 21:24     ` Stefano Stabellini
2019-06-18 11:05       ` Julien Grall
2019-06-18 20:19         ` Stefano Stabellini
2019-05-02 15:03   ` Jan Beulich
2019-05-02 15:03     ` [Xen-devel] " Jan Beulich
2019-05-02 18:55     ` Stefano Stabellini
2019-05-02 18:55       ` [Xen-devel] " Stefano Stabellini
2019-04-30 21:02 ` [PATCH v2 03/10] xen: extend XEN_DOMCTL_memory_mapping to handle memory policy Stefano Stabellini
2019-04-30 21:02   ` [Xen-devel] " Stefano Stabellini
2019-05-02 15:12   ` Jan Beulich
2019-05-02 15:12     ` [Xen-devel] " Jan Beulich
2019-06-17 21:28     ` Stefano Stabellini
2019-06-18  8:59       ` Jan Beulich
2019-06-18 20:32         ` Stefano Stabellini
2019-06-18 23:15           ` Stefano Stabellini
2019-06-19  6:53             ` Jan Beulich
2019-05-07 16:41   ` Julien Grall
2019-05-07 16:41     ` [Xen-devel] " Julien Grall
2019-06-17 22:43     ` Stefano Stabellini
2019-06-18 11:13       ` Julien Grall
2019-05-15 14:40   ` Oleksandr
2019-05-15 14:40     ` [Xen-devel] " Oleksandr
2019-04-30 21:02 ` [PATCH v2 04/10] libxc: introduce xc_domain_mem_map_policy Stefano Stabellini
2019-04-30 21:02   ` [Xen-devel] " Stefano Stabellini
2019-04-30 21:02 ` [PATCH v2 05/10] libxl/xl: add memory policy option to iomem Stefano Stabellini
2019-04-30 21:02   ` [Xen-devel] " Stefano Stabellini
2019-05-01  9:42   ` Julien Grall
2019-05-01  9:42     ` [Xen-devel] " Julien Grall
2019-06-17 22:32     ` Stefano Stabellini
2019-06-18 11:09       ` Julien Grall
2019-06-18 11:15   ` Julien Grall
2019-06-18 22:07     ` Stefano Stabellini
2019-06-18 22:20       ` Julien Grall [this message]
2019-06-18 22:46         ` Stefano Stabellini
2019-04-30 21:02 ` [PATCH v2 06/10] xen/arm: extend device_tree_for_each_node Stefano Stabellini
2019-04-30 21:02   ` [Xen-devel] " Stefano Stabellini
2019-05-07 17:12   ` Julien Grall
2019-05-07 17:12     ` [Xen-devel] " Julien Grall
2019-04-30 21:02 ` [PATCH v2 07/10] xen/arm: make process_memory_node a device_tree_node_func Stefano Stabellini
2019-04-30 21:02   ` [Xen-devel] " Stefano Stabellini
2019-05-01  9:47   ` Julien Grall
2019-05-01  9:47     ` [Xen-devel] " Julien Grall
2019-04-30 21:02 ` [PATCH v2 08/10] xen/arm: keep track of reserved-memory regions Stefano Stabellini
2019-04-30 21:02   ` [Xen-devel] " Stefano Stabellini
2019-05-01 10:03   ` Julien Grall
2019-05-01 10:03     ` [Xen-devel] " Julien Grall
2019-06-21 23:47     ` Stefano Stabellini
2019-05-07 17:21   ` Julien Grall
2019-05-07 17:21     ` [Xen-devel] " Julien Grall
2019-04-30 21:02 ` [PATCH v2 09/10] xen/arm: map reserved-memory regions as normal memory in dom0 Stefano Stabellini
2019-04-30 21:02   ` [Xen-devel] " Stefano Stabellini
2019-05-07 19:52   ` Julien Grall
2019-05-07 19:52     ` [Xen-devel] " Julien Grall
2019-04-30 21:02 ` [PATCH v2 10/10] xen/arm: add reserved-memory regions to the dom0 memory node Stefano Stabellini
2019-04-30 21:02   ` [Xen-devel] " Stefano Stabellini
2019-05-07 20:15   ` Julien Grall
2019-05-07 20:15     ` [Xen-devel] " Julien Grall
2019-05-10 20:51     ` Stefano Stabellini
2019-05-10 20:51       ` [Xen-devel] " Stefano Stabellini
2019-05-10 21:43       ` Julien Grall
2019-05-10 21:43         ` [Xen-devel] " Julien Grall
2019-05-11 12:40         ` Julien Grall
2019-05-11 12:40           ` [Xen-devel] " Julien Grall
2019-05-20 21:26           ` Stefano Stabellini
2019-05-20 21:26             ` [Xen-devel] " Stefano Stabellini
2019-05-20 22:38             ` Julien Grall
2019-05-20 22:38               ` [Xen-devel] " Julien Grall
2019-06-05 16:30               ` Julien Grall
2019-06-21 23:47                 ` Stefano Stabellini
2019-05-16 16:52 ` [PATCH v2 0/10] iomem memory policy Oleksandr
2019-05-16 16:52   ` [Xen-devel] " Oleksandr
2019-06-21 23:48   ` Stefano Stabellini

Reply instructions:

You may reply publically 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=CAF3u54CHbQo82D18LTOdhbLgq4YfHkVin1c4YDkv0QLuqwUL3Q@mail.gmail.com \
    --to=julien.grall@gmail.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=stefanos@xilinx.com \
    --cc=wei.liu2@citrix.com \
    --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

Xen-Devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/xen-devel/0 xen-devel/git/0.git
	git clone --mirror https://lore.kernel.org/xen-devel/1 xen-devel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 xen-devel xen-devel/ https://lore.kernel.org/xen-devel \
		xen-devel@lists.xenproject.org xen-devel@archiver.kernel.org
	public-inbox-index xen-devel


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.xenproject.lists.xen-devel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox