xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@suse.com>
To: andrew.cooper3@citrix.com, xen-devel@lists.xen.org
Subject: Re: [PATCH] x86/alternatives: Force inline stac() and clac()
Date: Mon, 18 Aug 2014 21:40:05 +0100	[thread overview]
Message-ID: <53F272B502000078000BABA7@mail.emea.novell.com> (raw)
In-Reply-To: <1408378137-16138-1-git-send-email-andrew.cooper3@citrix.com>

>>> Andrew Cooper <andrew.cooper3@citrix.com> 08/18/14 6:16 PM >>>
>In this case, we know better than the compiler.
>
>gcc 4.7 (Debian Wheezy) chooses to create translation-unit-local functions
>(even for non-debug builds) named stac() and clac(), and calls them.
>
>$ objdump -d xen-syms | grep -c "<stac>:"
>6
>
>$ objdump -d xen-syms | grep -o "callq  [0-9a-f]\+ <stac>" | uniq -c
      >5 callq  ffff82d0801166c9 <stac>
     >20 callq  ffff82d08015ef99 <stac>
      >4 callq  ffff82d080165169 <stac>
      >8 callq  ffff82d080188cb9 <stac>
      >3 callq  ffff82d080228779 <stac>
      >4 callq  ffff82d08022c5c9 <stac>
>
>Forcing always_inline removes these functions, and replaces each of the callqs
>with the expected 3byte nops.

I'm fine putting the patch in, but isn't this a compiler bug? Creating a 5-byte
call instruction instead of a 3-byte inline expansion should even preclude out
of line placement under -Os (which otherwise is the most likely reason for
functions not getting inlined).

Jan

  reply	other threads:[~2014-08-18 20:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-18 16:08 [PATCH] x86/alternatives: Force inline stac() and clac() Andrew Cooper
2014-08-18 20:40 ` Jan Beulich [this message]
2014-08-18 23:21   ` Andrew Cooper

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=53F272B502000078000BABA7@mail.emea.novell.com \
    --to=jbeulich@suse.com \
    --cc=andrew.cooper3@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).