From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750923AbcGUEpd (ORCPT ); Thu, 21 Jul 2016 00:45:33 -0400 Received: from mga14.intel.com ([192.55.52.115]:61023 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750801AbcGUEpc (ORCPT ); Thu, 21 Jul 2016 00:45:32 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,397,1464678000"; d="scan'208";a="850348475" Date: Thu, 21 Jul 2016 12:45:28 +0800 From: Fengguang Wu To: "Liang, Kan" Cc: LKML , Andy Lutomirski , 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 Message-ID: <20160721044528.GA21819@wfg-t540p.sh.intel.com> References: <201607200941.I2Mgxr9T%fengguang.wu@intel.com> <37D7C6CF3E00A74B8858931C1DB2F07712C1ACAF@SHSMSX103.ccr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <37D7C6CF3E00A74B8858931C1DB2F07712C1ACAF@SHSMSX103.ccr.corp.intel.com> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 : > 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 > e20: 31 f6 xor %esi,%esi > e22: e8 00 00 00 00 callq e27 > 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 > e3b: 00 > e3c: 75 02 jne e40 > 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