From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Martin Pohlack <mpohlack@amazon.com>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
Wei Liu <wei.liu2@citrix.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
AndrewCooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>,
mpohlack@amazon.de, philippe.gabriel@citrix.com,
Jan Beulich <JBeulich@suse.com>,
Xen-devel <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v3] gcov: add new interface and 3.4 and 4.7 format support
Date: Wed, 12 Oct 2016 12:21:03 -0400 [thread overview]
Message-ID: <20161012162103.GA6318@char.us.oracle.com> (raw)
In-Reply-To: <eb898094-5685-a46f-0deb-424d049e99df@amazon.com>
On Wed, Oct 12, 2016 at 04:17:57PM +0200, Martin Pohlack wrote:
> On 12.10.2016 15:44, Konrad Rzeszutek Wilk wrote:
> > On Wed, Oct 12, 2016 at 07:31:52AM -0600, Jan Beulich wrote:
> > > > > > On 12.10.16 at 15:23, <konrad.wilk@oracle.com> wrote:
> > > > > And then - how is all of this supposed to be working in conjucntion
> > > > > with live patching, where the patch may have been created by yet
> > > > > another compiler version?
> > > >
> > > > Uh, I hope one does not create a livepatch patch with another compiler
> > > > version!
> > > >
> > > > Let me put on the TODO to make livepatch-build-tools check gcc against
> > > > compile.h so that one does not try this.
> > >
> > > What's wrong with mixing compiler versions in general?
> >
> > Besides scaring me?
> >
> > The one issue we had encountered was with compilers generating random named
> > symbols for the switch tables. Those end up being called "CSWTCH.XYZ"
> > where the XYZ depends on the position of the moon along with how many
> > goats you have sacrificied to the altar of GCC gods.
> >
> > Older compilers don't neccessarily do it, newer ones do, and every time
> > you build an livepatch the naming is different. Frustrating.
> >
> > It maybe that newer versions of GCC are more predictable about this
> > naming.
> >
> > Maybe Martin can share some of his experience? CC-ing him.
>
> There are a couple of naming conventions for internal symbols and also
> static symbols where you basically have to pray that gcc implementation does
> not change. Interestingly, icc has some conventions that make those symbol
> names a bit more stable.
>
> The tricky thing is matchmaking between the existing build and the new build
> to construct the binary diff and to match up symbols for which you want to
> provide replacement code.
>
> We use a reproducible build environment to construct hotpatches for an
> existing build in the absolutely same environment (gcc version, lib
> versions, gas version, binutils etc.). This sidesteps most of the problems.
I think the matchmaking process does not solve per say some tricky CSWTCH issues.
If a patch mucks with a switch statement (e.g. add a new case) we are pretty much
guaranteed to get in trouble. And really a change in any control structure may cause
gcc to take different code path, causing it to renumber CSWTCH. Or worst, renumber
it to the one that the hypervisor is using for some other switch statements.
I think the size of the symbol vs the one in the hypervisor is different
so one can check for this. Bad things happen if it is the same size, but bcmp
can come in handy there.
Are there any ways to make GCC be predictable or some patches
to make GCC be less random. Perhaps instead of XYZ it would use the function name..
P.S.
GCC scares me because the code comes in these big patches with not much explanation
on how it suppose to work. It probably is a piece of cake for folks who
have been marinating in compilers but for a newbie like me it is hardcore
black magic.
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2016-10-12 16:21 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-10 9:40 [PATCH v2 0/9] Rework gcov support in Xen Wei Liu
2016-10-10 9:40 ` [PATCH v2 1/9] Kconfig: use tab instead of space Wei Liu
2016-10-10 11:21 ` Jan Beulich
2016-10-10 9:40 ` [PATCH v2 2/9] Kconfig: add BROKEN config Wei Liu
2016-10-10 11:22 ` Jan Beulich
2016-10-10 9:40 ` [PATCH v2 3/9] xen: delete gcno files in clean target Wei Liu
2016-10-10 11:23 ` Jan Beulich
2016-10-10 9:40 ` [PATCH v2 4/9] xen, tools: rip out old gcov implementation Wei Liu
2016-10-10 11:24 ` Jan Beulich
2016-10-10 9:40 ` [PATCH v2 5/9] gcov: add new interface and 3.4 and 4.7 format support Wei Liu
2016-10-10 11:56 ` Jan Beulich
2016-10-10 12:23 ` Andrew Cooper
2016-10-10 12:56 ` Jan Beulich
2016-10-10 13:12 ` Wei Liu
2016-10-10 13:11 ` Wei Liu
2016-10-10 14:43 ` Wei Liu
2016-10-11 10:31 ` [PATCH v3] " Wei Liu
2016-10-12 12:42 ` Jan Beulich
2016-10-12 13:06 ` Wei Liu
2016-10-12 13:11 ` Jan Beulich
2016-10-12 13:24 ` George Dunlap
2016-10-12 13:26 ` George Dunlap
2016-10-12 13:31 ` Wei Liu
2016-10-12 13:33 ` Jan Beulich
2016-10-12 13:34 ` Andrew Cooper
2016-10-12 13:41 ` George Dunlap
2016-10-12 13:43 ` Andrew Cooper
2016-10-12 13:29 ` Konrad Rzeszutek Wilk
2016-10-12 13:40 ` Wei Liu
2016-10-12 13:46 ` Konrad Rzeszutek Wilk
2016-10-12 13:50 ` Wei Liu
2016-10-12 13:23 ` Konrad Rzeszutek Wilk
2016-10-12 13:31 ` Jan Beulich
2016-10-12 13:44 ` Konrad Rzeszutek Wilk
2016-10-12 14:08 ` Jan Beulich
2016-10-12 14:17 ` Martin Pohlack
2016-10-12 16:21 ` Konrad Rzeszutek Wilk [this message]
2016-10-13 8:05 ` Martin Pohlack
2016-10-12 15:33 ` Wei Liu
2016-10-12 15:42 ` Jan Beulich
2016-10-12 17:07 ` Wei Liu
2016-10-13 8:29 ` Jan Beulich
2016-10-13 8:49 ` Wei Liu
2016-10-13 9:15 ` Jan Beulich
2016-10-13 9:20 ` Wei Liu
2016-10-10 9:40 ` [PATCH v2 6/9] gcov: userspace tools to extract and split gcov data Wei Liu
2016-10-10 15:44 ` Ian Jackson
2016-10-10 9:40 ` [PATCH v2 7/9] Config.mk: expand cc-ver a bit Wei Liu
2016-10-10 11:57 ` Jan Beulich
2016-10-10 9:40 ` [PATCH v2 8/9] Config.mk: introduce cc-ifversion Wei Liu
2016-10-10 12:00 ` Jan Beulich
2016-10-10 13:18 ` Wei Liu
2016-10-10 13:22 ` Jan Beulich
2016-10-10 13:24 ` Wei Liu
2016-10-10 9:40 ` [PATCH v2 9/9] gcov: provide the capability to select gcov format automatically Wei Liu
2016-10-10 12:00 ` Jan Beulich
2016-10-10 15:47 ` [PATCH v2 0/9] Rework gcov support in Xen Ian Jackson
2016-10-10 15:58 ` Jan Beulich
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=20161012162103.GA6318@char.us.oracle.com \
--to=konrad.wilk@oracle.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=JBeulich@suse.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=mpohlack@amazon.com \
--cc=mpohlack@amazon.de \
--cc=philippe.gabriel@citrix.com \
--cc=sstabellini@kernel.org \
--cc=tim@xen.org \
--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
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).