From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: Re: [PATCH v1 1/7] lib: Add a generic implementation of current_text_addr() Date: Tue, 10 May 2016 10:18:20 +0200 Message-ID: <1462868300.4858.21.camel@citrix.com> References: <1462549688-29263-1-git-send-email-ross.lagerwall@citrix.com> <1462549688-29263-2-git-send-email-ross.lagerwall@citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2512395196848431859==" Return-path: In-Reply-To: <1462549688-29263-2-git-send-email-ross.lagerwall@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" To: Ross Lagerwall , xen-devel@lists.xen.org Cc: Andrew Cooper , Jan Beulich , Roger Pau Monne List-Id: xen-devel@lists.xenproject.org --===============2512395196848431859== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="=-sZTL9sd2F0Zq3bZhociP" --=-sZTL9sd2F0Zq3bZhociP Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable [adding Roger] On Fri, 2016-05-06 at 16:48 +0100, Ross Lagerwall wrote: > Remove the unused x86 implementation. >=20 Hey, this is actually very useful, for another thing I'm working on... Thanks! :-P > --- a/xen/common/lib.c > +++ b/xen/common/lib.c > @@ -499,6 +499,18 @@ void __init init_constructors(void) > =C2=A0} > =C2=A0 > =C2=A0/* > + * The GCC docs state that the function must be marked noinline to > have the > + * expected result: > + * "When inlining the expected behavior is that the function returns > the > + * address of the function that is returned to. To work around this > behavior > + * use the noinline function attribute." > + */ > +noinline void *current_text_addr(void) > +{ > +=C2=A0=C2=A0=C2=A0=C2=A0return __builtin_return_address(0); > +} > + Since we started to care about clang, what's the situation about it? =46rom what I read in the links below, it looks like it's similar, and that noinline would actually be ok there too... in which case, it's probably worth making the comment either reference both docs, or be a bit more abstract/generic. http://lists.llvm.org/pipermail/llvm-dev/2015-December/092893.html http://llvm.org/docs/LangRef.html#llvm-returnaddress-intrinsic Regards, Dario --=20 <> (Raistlin Majere) ----------------------------------------------------------------- Dario Faggioli, Ph.D, http://about.me/dario.faggioli Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK) --=-sZTL9sd2F0Zq3bZhociP Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJXMZlNAAoJEBZCeImluHPu4MYQAJt46zBpP2ZwOCZmio3wGtPG KXIpM/6+YCW6PIcwNe9Gy9ADrVvnbIrrsLK8swC1Iw1RqzbZIlsRN9mcwfPFwoHs SbP7i0raPOVhJbo6rzrJ7/imhzWW5B5jombPgstufgUTH4d641+iZB2wmqGyTaV/ t1LHjK4UYxdZSF84yMd3+PuR/sqp15r/hY5FLe6o7wjimNor5JuQImjrd5eFw1Jt NxTnyNyaodxad+vMna85I1xKUvccVvbBPUQqFkHFFZqlxBYDB1YCSOcCQC0+OYX5 F/+afVmw1HJagbEXuGHC9nhrIty1alv9p55dyefl2nuEcelFMjeoMAgOcAdD7zNc DEYLzS2mY2zlC7v5r2eUv8UnxwEDRL7tx/eYjKtSsXv8wuCp1C0h2XHgvLfJvrpK eKmVI3pC4djnqvA21CYV+HcwnXiNY9z7KJNRZ63kF0EeAtcHs+A3rtmOgqk/v/NA D5E9xxsAJjRJnh7fM4wdVTFuzxZXHbZoeKj4+NS2DzZ+mJ7UqoQC2j4hr/SzOR59 F/QKcBNH/0itq/CjxoL9MsIB4NS6WYLggTdtJ4dulUgaJaaohLh/RJgxA9/D/6NR sK+ML1OIQ9nJ5TKAc1q+UHq+P/vbvLmaF8FTK8boXQj+gA8AE6/kgjePH1BQi70F VJEEeY6cKZBYlLo4axyL =5HMA -----END PGP SIGNATURE----- --=-sZTL9sd2F0Zq3bZhociP-- --===============2512395196848431859== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KWGVuLWRldmVs IG1haWxpbmcgbGlzdApYZW4tZGV2ZWxAbGlzdHMueGVuLm9yZwpodHRwOi8vbGlzdHMueGVuLm9y Zy94ZW4tZGV2ZWwK --===============2512395196848431859==--