All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@citrix.com>
To: Jan Beulich <jbeulich@suse.com>,
	Stefano Stabellini <sstabellini@kernel.org>
Cc: Stefano Stabellini <stefanos@xilinx.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>,
	"julien.grall@arm.com" <julien.grall@arm.com>,
	George Dunlap <George.Dunlap@citrix.com>,
	Andrew Cooper <Andrew.Cooper3@citrix.com>
Subject: Re: [PATCH v11 9/9] xen: explicit casts when DECLARE_BOUNDS cannot be used [and 1 more messages] [and 1 more messages]
Date: Fri, 8 Mar 2019 15:39:45 +0000	[thread overview]
Message-ID: <23682.36033.541097.178160@mariner.uk.xensource.com> (raw)
In-Reply-To: <alpine.DEB.2.10.1903071451180.17248@sstabellini-ThinkPad-X260>, <5C8227AD020000780015016A@prv1-mh.provo.novell.com>

Jan Beulich writes ("Re: [PATCH v11 9/9] xen: explicit casts when DECLARE_BOUNDS cannot be used [and 1 more messages]"):
> Ian Jackson <ian.jackson@citrix.com> 03/07/19 4:26 PM >>>
> >Jan, I'm not sure exactly what you are suggesting.  Currently the
> >array has one pointer per element.  Are you suggesting it should have
> >two pointers (start and end), with different notional types ?
> 
> Yes.

Right.

> >If that is OK from a perf point of view then it is an easy answer
> >(although a bit tiresome since more linker symbols will have to be
> >generated).
> 
> This is init-time code and init-time data, so to me neither the performance
> aspect nor the doubled storage requirements would really matter.

Jolly good.

> Both could perhaps even be eliminated by using an array of unions.

If there are no compelling perf reassons to do otherwise, let us do
something which is obviously correct, rather than complicating
matters.


Stefano Stabellini writes ("Re: [PATCH v11 9/9] xen: explicit casts when DECLARE_BOUNDS cannot be used [and 1 more messages]"):
> On Thu, 7 Mar 2019, Ian Jackson wrote:
> > Jan has one suggestion, which I don't fully understand (see below).
> > Alternatively I suggest the following ad-hoc approach:

Probably, we should follow Jan's suggestion and not mine.


> > I also disagree with the wording of the comment.  It is seriously
> > misleading.  These symbols do in fact refer to the same object!
> > The problem is that the compiler thinks otherwise.  You need wording
> > like that in DECLARE_BOUNDS.  (Or a reference to it.)
> > 
> > > and if you think it is correct, then no
> > > matter what you do the behavior is undefined. Instead I view the
> > > entirety of the .bug_frames.* sections as a single array, with
> > > labels placed not only at start and end, but also in the middle. I
> > > think the code here would better also be taken care of by the
> > > DECLARE_BOUNDS() machinery, dividing the single array into
> > > multiple smaller ones.
> > 
> > Jan, I'm not sure exactly what you are suggesting.  Currently the
> > array has one pointer per element.  Are you suggesting it should have
> > two pointers (start and end), with different notional types ?
> 
> I am not fully understanding the suggestion either.
> 
> Even if we split it into multiple start-end pairs, still we won't be
> able to compare start/end of a pair with start/end of different pair
> without casts.

I don't think this bug_frames code does that ?  Maybe I have misread
it.


> This makes sense. Also, I understand _stext and __2M_rwdata_end better
> than the bug_frames and I should be able to write an half-decent
> explanation here. FYI _stext is already converted to DEFINE_BOUNDS in
> this series, but you are right that __2M_rwdata_end is not. I'll fix
> that.

Thanks.

Ian.

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

  reply	other threads:[~2019-03-08 15:39 UTC|newest]

Thread overview: 54+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-05 22:38 [PATCH v11 0/9] misc safety certification fixes Stefano Stabellini
2019-03-05 22:38 ` [PATCH v11 1/9] xen: use __UINTPTR_TYPE__ for uintptr_t Stefano Stabellini
2019-03-06  7:47   ` Jan Beulich
2019-03-06 21:16     ` Stefano Stabellini
2019-03-07  8:29       ` Jan Beulich
2019-03-07 15:43         ` Ian Jackson
2019-03-08  7:23           ` Jan Beulich
2019-03-08 14:18   ` Andrew Cooper
2019-03-08 15:19     ` Ian Jackson
2019-03-05 22:38 ` [PATCH v11 2/9] xen: introduce ptrdiff_t Stefano Stabellini
2019-03-05 22:38 ` [PATCH v11 3/9] xen: introduce DECLARE_BOUNDS Stefano Stabellini
2019-03-06 15:24   ` Jan Beulich
2019-03-06 20:55     ` Stefano Stabellini
2019-03-07  8:39       ` Jan Beulich
2019-03-07 14:16         ` Ian Jackson
2019-03-08  8:15           ` Jan Beulich
2019-03-08 15:31             ` Ian Jackson
2019-03-05 22:38 ` [PATCH v11 4/9] xen/arm: use DECLARE_BOUNDS as required Stefano Stabellini
2019-03-05 22:38 ` [PATCH v11 5/9] xen/x86: " Stefano Stabellini
2019-03-06 15:33   ` Jan Beulich
2019-03-06 21:05     ` Stefano Stabellini
2019-03-07  8:40       ` Jan Beulich
2019-03-07 14:02       ` Ian Jackson
2019-03-07 14:42         ` George Dunlap
2019-03-08  8:46         ` Jan Beulich
2019-03-08  8:55           ` Juergen Gross
2019-03-08 15:33           ` Ian Jackson
2019-03-06 15:48   ` Jan Beulich
2019-03-06 21:38     ` Stefano Stabellini
2019-03-07  8:50       ` Jan Beulich
2019-03-07 14:43         ` Ian Jackson
2019-03-08  8:22           ` Jan Beulich
2019-03-08 15:36             ` Ian Jackson
2019-03-08 15:57               ` Jan Beulich
2019-03-07 14:00       ` Ian Jackson
2019-03-08 15:43   ` Ian Jackson
2019-03-08 15:49     ` Jan Beulich
2019-03-05 22:38 ` [PATCH v11 6/9] xen/common: " Stefano Stabellini
2019-03-06 15:37   ` Jan Beulich
2019-03-06 21:08     ` Stefano Stabellini
2019-03-05 22:38 ` [PATCH v11 7/9] xen: " Stefano Stabellini
2019-03-05 22:38 ` [PATCH v11 8/9] xen: use DECLARE_BOUNDS in alternative.c Stefano Stabellini
2019-03-06 16:35   ` Jan Beulich
2019-03-06 21:38     ` Stefano Stabellini
2019-03-05 22:38 ` [PATCH v11 9/9] xen: explicit casts when DECLARE_BOUNDS cannot be used Stefano Stabellini
2019-03-07 11:40   ` Jan Beulich
2019-03-07 15:25     ` [PATCH v11 9/9] xen: explicit casts when DECLARE_BOUNDS cannot be used [and 1 more messages] Ian Jackson
2019-03-07 22:55       ` Stefano Stabellini
2019-03-08 15:39         ` Ian Jackson [this message]
2019-03-08  8:28       ` Jan Beulich
2019-03-08 15:26 ` SRSL People... [PATCH v11 0/9] misc safety certification fixes Andrew Cooper
2019-03-08 15:44   ` Ian Jackson
2019-03-08 15:46   ` Jan Beulich
2019-03-08 20:14     ` 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=23682.36033.541097.178160@mariner.uk.xensource.com \
    --to=ian.jackson@citrix.com \
    --cc=Andrew.Cooper3@citrix.com \
    --cc=George.Dunlap@citrix.com \
    --cc=jbeulich@suse.com \
    --cc=julien.grall@arm.com \
    --cc=sstabellini@kernel.org \
    --cc=stefanos@xilinx.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
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.