xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Stefano Stabellini <sstabellini@kernel.org>
To: Jan Beulich <JBeulich@suse.com>
Cc: edgar.iglesias@xilinx.com, Tim Deegan <tim@xen.org>,
	Stefano Stabellini <sstabellini@kernel.org>,
	Wei Liu <wei.liu2@citrix.com>,
	Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	George Dunlap <George.Dunlap@eu.citrix.com>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	Stefano Stabellini <stefanos@xilinx.com>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>,
	xen-devel@lists.xen.org, Julien Grall <julien.grall@arm.com>,
	saeed.nowshadi@xilinx.com
Subject: Re: [PATCH v5 4/7] xen: introduce mfn_init macro
Date: Tue, 4 Dec 2018 11:38:24 -0800 (PST)	[thread overview]
Message-ID: <alpine.DEB.2.10.1812041131340.527@sstabellini-ThinkPad-X260> (raw)
In-Reply-To: <5C0656330200007800202993@prv1-mh.provo.novell.com>

On Tue, 4 Dec 2018, Jan Beulich wrote:
> >>> On 03.12.18 at 22:03, <sstabellini@kernel.org> wrote:
> > To be used in constant initializations of mfn_t variables, such as:
> > 
> > static mfn_t node = mfn_init(MM_ADDR);
> > 
> > It is necessary because static inline functions cannot be used as static
> > initializers.
> 
> We had been at this point once (quite some time ago), and got
> away without such an addition. Did you try to find that old
> discussion? Are there any new reasons to have such a construct?
> Do you need this for other than setting a value to INVALID_MFN,
> in which case INVALID_MFN_INITIALIZER ought to be suitable?
> 
> This is not to say I'm entirely opposed.
> 
> If we were to have such a construct, I wonder though whether
> mfn_init() is suitable as a name. Simply MFN() perhaps, and then
> also consistently have GFN() and DFN()?

Hi Jan,

I am happy with any name, and MFN() together with GFN() and DFN() look
like a good option.

The reason why it is needed is that without it I cannot introduce a
statically initialized array of mfn_t type like the one in the following
patch in the series:

+static const struct pm_access pm_node_access[] = {
+    /* MM_RPU grants access to all RPU Nodes.  */
+    [NODE_RPU] = { mfn_init(MM_RPU) },
+    [NODE_RPU_0] = { mfn_init(MM_RPU) },
+    [NODE_RPU_1] = { mfn_init(MM_RPU) },
+    [NODE_IPI_RPU_0] = { mfn_init(MM_RPU) },

[...]

Where MM_RPU is a mfn, and the NODE_* are IDs defined as enum:

#define MM_RPU  0xff9a0

enum pm_node_id {
	NODE_RPU = 6,
	NODE_RPU_0,
	NODE_RPU_1,

[...]


Originally I had:

  [NODE_RPU] = { MM_RPU },

but I changed the type to be mfn_t to address one of Julien's comments.
You might get a better idea of the issue if you give a look at this
branch:

http://xenbits.xenproject.org/git-http/people/sstabellini/xen-unstable.git zynqmp-v5

See:

xen/include/asm-arm/platforms/xilinx-zynqmp-eemi.h
xen/arch/arm/platforms/xilinx-zynqmp-eemi.c

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

  reply	other threads:[~2018-12-04 19:38 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 21:02 [PATCH v5 0/7] zynqmp: Add forwarding of platform specific firmware calls Stefano Stabellini
2018-12-03 21:03 ` [PATCH v5 1/7] xen/arm: introduce platform_smc Stefano Stabellini
2018-12-03 21:07   ` Stefano Stabellini
2018-12-11 14:54   ` Julien Grall
2018-12-03 21:03 ` [PATCH v5 2/7] xen/arm: zynqmp: Forward plaform specific firmware calls Stefano Stabellini
2018-12-11 15:03   ` Julien Grall
2018-12-11 18:50     ` Stefano Stabellini
2018-12-11 19:09       ` Julien Grall
2018-12-11 20:19         ` Stefano Stabellini
2018-12-11 20:27           ` Julien Grall
2018-12-03 21:03 ` [PATCH v5 3/7] xen/arm: zynqmp: introduce zynqmp specific defines Stefano Stabellini
2018-12-11 15:21   ` Julien Grall
2018-12-11 19:22     ` Stefano Stabellini
2018-12-12 10:29       ` Julien Grall
2018-12-12 23:55         ` Stefano Stabellini
2018-12-13 15:50           ` Julien Grall
2018-12-03 21:03 ` [PATCH v5 4/7] xen: introduce mfn_init macro Stefano Stabellini
2018-12-04 10:25   ` Jan Beulich
2018-12-04 19:38     ` Stefano Stabellini [this message]
2018-12-05  8:27       ` Jan Beulich
2018-12-12 23:56         ` Stefano Stabellini
2018-12-03 21:03 ` [PATCH v5 5/7] xen/arm: zynqmp: eemi access control Stefano Stabellini
2018-12-11 15:37   ` Julien Grall
2018-12-12 23:57     ` Stefano Stabellini
2018-12-13 15:58       ` Julien Grall
2018-12-03 21:03 ` [PATCH v5 6/7] xen/arm: zynqmp: implement zynqmp_eemi Stefano Stabellini
2018-12-11 15:55   ` Julien Grall
2018-12-11 22:23     ` Stefano Stabellini
2018-12-12 10:48       ` Julien Grall
2018-12-12 23:56         ` Stefano Stabellini
2018-12-13 15:59           ` Julien Grall
2018-12-03 21:03 ` [PATCH v5 7/7] xen/arm: zynqmp: Remove blacklist of ZynqMP's PM node Stefano Stabellini

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.10.1812041131340.527@sstabellini-ThinkPad-X260 \
    --to=sstabellini@kernel.org \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=edgar.iglesias@xilinx.com \
    --cc=julien.grall@arm.com \
    --cc=konrad.wilk@oracle.com \
    --cc=saeed.nowshadi@xilinx.com \
    --cc=stefanos@xilinx.com \
    --cc=tim@xen.org \
    --cc=wei.liu2@citrix.com \
    --cc=xen-devel@lists.xen.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).