All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Ian Jackson <Ian.Jackson@eu.citrix.com>, Jan Beulich <JBeulich@suse.com>
Cc: Julien Grall <julien.grall@citrix.com>,
	xen-devel@lists.xenproject.org, Tim Deegan <tim@xen.org>,
	Keir Fraser <keir@xen.org>,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Subject: Re: [PATCH 4/4] xen/public: arm: rework the macro set_xen_guest_handle_raw
Date: Fri, 6 Nov 2015 12:10:47 +0000	[thread overview]
Message-ID: <1446811847.23065.37.camel@citrix.com> (raw)
In-Reply-To: <22074.14145.634793.537784@mariner.uk.xensource.com>

On Wed, 2015-11-04 at 16:50 +0000, Ian Jackson wrote:
> Jan Beulich writes ("Re: [PATCH 4/4] xen/public: arm: rework the
> macro set_xen_guest_handle_raw"):
> > All quite interesting, but pretty moot with there not being any
> > get_xen_guest_handle() anymore.
> 
> If we don't provide a get_xen_guest_handle, a kernel developer will be
> sorely tempted to make one.
> 
> If they do and they write it in the obvious way, then the compiler
> could `deduce' that the top part of the uint64_t store was dead, and
> eliminate it.

I realise that "correct use of unions" here is orthogonal to "using gcc
extensions", but trying to achieve the former while avoiding the later
is having a multiplicative effect on the complexity of the resulting
macros, so:...

Realistically any OS which did try and implement this would probably
not try and jump through such hoops in order to do it in pure ANSI-C
but would instead just use whatever extension their compiler provided
to make it easier to write such macros (such as typeof).

Perhaps we should follow the lead of xen/include/public/io/ring.h here
and provide a clear, readable and correct version under #if __GNUC__
(which our own tools build would use) using the extensions and an
alternative ANSI-C only one which might have short comings e.g. in
efficiency, maybe evaluating the argument more than once, etc but not
in correctness.

Realistically IMHO the #else case could be "#error you need to
implement this carefully" but I suspect others will not be comfortable
with that approach.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

  parent reply	other threads:[~2015-11-06 12:11 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-30 18:13 [PATCH 0/4] xen/public: arm: rework set_xen_guest_handle_raw Julien Grall
2015-10-30 18:13 ` [PATCH 1/4] xen/public: arm: Clarify the name of guest handle structures Julien Grall
2015-11-02 15:14   ` Stefano Stabellini
2015-10-30 18:13 ` [PATCH 2/4] xen/public: arm: Rework __guest_handle_param* Julien Grall
2015-11-02 15:19   ` Stefano Stabellini
2015-11-02 15:24     ` Julien Grall
2015-11-02 15:35       ` Ian Campbell
2015-11-02 15:39         ` Julien Grall
2015-11-02 15:49           ` Ian Campbell
2015-10-30 18:13 ` [PATCH 3/4] xen/public: Don't expose XEN_GUEST_HANDLE_PARAM outside of the hypervisor Julien Grall
2015-11-02 13:45   ` Jan Beulich
2015-11-02 13:52     ` Stefano Stabellini
2015-10-30 18:13 ` [PATCH 4/4] xen/public: arm: rework the macro set_xen_guest_handle_raw Julien Grall
2015-11-02 15:55   ` Stefano Stabellini
2015-11-02 16:15     ` Jan Beulich
2015-11-03 12:35     ` Ian Campbell
2015-11-03 14:01       ` Julien Grall
2015-11-03 14:34         ` Ian Campbell
2015-11-04 11:17           ` Julien Grall
2015-11-04 11:27             ` Ian Campbell
2015-11-04 11:40               ` Julien Grall
2015-11-04 14:29                 ` Ian Campbell
2015-11-04 14:42                   ` Julien Grall
2015-11-04 14:54                     ` Ian Campbell
2015-11-04 15:19                 ` Stefano Stabellini
2015-11-04 15:20                   ` Ian Jackson
2015-11-04 15:45                     ` Ian Jackson
2015-11-04 15:26                   ` Ian Campbell
2015-11-04 15:46                     ` Ian Jackson
2015-11-04 16:04                       ` Ian Campbell
2015-11-03 14:18   ` Stefano Stabellini
2015-11-03 15:25     ` Julien Grall
2015-11-04 16:22       ` Ian Jackson
2015-11-04 16:24         ` Ian Jackson
2015-11-04 16:39         ` Jan Beulich
2015-11-04 16:50           ` Ian Jackson
2015-11-04 16:59             ` Julien Grall
2015-11-04 17:05             ` Jan Beulich
2015-11-04 17:06               ` Ian Jackson
2015-11-05  8:37                 ` Jan Beulich
2015-11-06 12:10             ` Ian Campbell [this message]
2015-11-02 13:42 ` [PATCH 0/4] xen/public: arm: rework set_xen_guest_handle_raw Jan Beulich
2015-11-02 13:45   ` Julien Grall

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=1446811847.23065.37.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=julien.grall@citrix.com \
    --cc=keir@xen.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@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.