mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Fengguang Wu <fengguang.wu@intel.com>
To: "Liang, Kan" <kan.liang@intel.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andy Lutomirski <luto@amacapital.net>,
	gcc@gcc.gnu.org
Subject: [gcc-4.4] Re: arch/x86/events/intel/uncore_snbep.o: warning: objtool: snbep_uncore_msr_enable_event()+0x2e: function has unreachable instruction
Date: Thu, 21 Jul 2016 12:45:28 +0800	[thread overview]
Message-ID: <20160721044528.GA21819@wfg-t540p.sh.intel.com> (raw)
In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F07712C1ACAF@SHSMSX103.ccr.corp.intel.com>

On Thu, Jul 21, 2016 at 11:06:06AM +0800, Liang, Kan wrote:
>Hi Fengguang,
>
>I located the unreachable instruction which is ud2.
>
>This instruction will raise invalid opcode exception. So I think
>normally it should not be reached.  Also ud2 should be generated by
>compiler, not our codes.

It's great to know that!

>I have no idea how to fix it.
>Have you met similar issue before?
>Do you have any suggestions?

The warning shows up when we enabled gcc-4.4 for kernel build tests.
It emits this "function has unreachable instruction" warning for
~10000 kernel functions all over the places.

So it must be a toolchain specific problem.
Let's CC LKML and gcc lists for possible solutions.

>0000000000000e0f <snbep_uncore_msr_enable_event>:
>     e0f:       55                      push   %rbp
>     e10:       48 89 e5                mov    %rsp,%rbp
>     e13:       53                      push   %rbx
>     e14:       83 be 80 01 00 00 ff    cmpl   $0xffffffff,0x180(%rsi)
>     e1b:       48 89 f3                mov    %rsi,%rbx
>     e1e:       74 2b                   je     e4b <snbep_uncore_msr_enable_event+0x3c>
>     e20:       31 f6                   xor    %esi,%esi
>     e22:       e8 00 00 00 00          callq  e27 <snbep_uncore_msr_enable_event+0x18>
>     e27:       48 89 c2                mov    %rax,%rdx
>     e2a:       8b b3 78 01 00 00       mov    0x178(%rbx),%esi
>     e30:       48 c1 ea 20             shr    $0x20,%rdx
>     e34:       48 83 3d 00 00 00 00    cmpq   $0x0,0x0(%rip)        # e3c <snbep_uncore_msr_enable_event+0x2d>
>     e3b:       00
>     e3c:       75 02                   jne    e40 <snbep_uncore_msr_enable_event+0x31>
>     e3e:       0f 0b                   ud2
>     e40:       89 f7                   mov    %esi,%edi
>     e42:       89 c6                   mov    %eax,%esi
>     e44:       ff 14 25 00 00 00 00    callq  *0x0
>
>Thanks,
>Kan
>
>>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
>> master
>> head:   47ef4ad2684d380dd6d596140fb79395115c3950
>> commit: 3b94a891667c30fb4624221497d77fc65d950345
>> perf/x86/intel/uncore: Remove SBOX support for Broadwell server
>> date:   7 weeks ago
>> config: x86_64-randconfig-s0-07191857 (attached as .config)
>> compiler: gcc-4.4 (Debian 4.4.7-8) 4.4.7
>> reproduce:
>>         git checkout 3b94a891667c30fb4624221497d77fc65d950345
>>         # save the attached .config to linux build tree
>>         make ARCH=x86_64
>>
>> All warnings (new ones prefixed by >>):
>>
>> >> arch/x86/events/intel/uncore_snbep.o: warning: objtool:
>> snbep_uncore_msr_enable_event()+0x2e: function has unreachable
>> instruction
>>
>> ---
>> 0-DAY kernel test infrastructure                Open Source Technology Center
>> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

      parent reply	other threads:[~2016-07-21  4:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20  1:25 kbuild test robot
     [not found] ` <37D7C6CF3E00A74B8858931C1DB2F07712C1ACAF@SHSMSX103.ccr.corp.intel.com>
2016-07-21  4:45   ` Fengguang Wu [this message]

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=20160721044528.GA21819@wfg-t540p.sh.intel.com \
    --to=fengguang.wu@intel.com \
    --cc=gcc@gcc.gnu.org \
    --cc=kan.liang@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    /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

all inboxes | Powered by JetHome®