From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752415AbdCARVT (ORCPT ); Wed, 1 Mar 2017 12:21:19 -0500 Received: from mx1.redhat.com ([209.132.183.28]:41116 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751740AbdCARVS (ORCPT ); Wed, 1 Mar 2017 12:21:18 -0500 Date: Wed, 1 Mar 2017 10:53:55 -0600 From: Josh Poimboeuf To: Arnd Bergmann Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Linux Kernel Mailing List , Denys Vlasenko Subject: Re: [PATCH] [RFC] x86: avoid -mtune=atom for objtool warnings Message-ID: <20170301165355.w2kmdmbql2f2ouzg@treble> References: <20161010125709.1870563-1-arnd@arndb.de> <20161011150541.opini6gbolmnpzy5@treble> <20161011155146.icyl3zewdvmms2h2@treble> <2252957.Vm1BYSSRqP@wuerfel> <20170301144008.3ocnbvry4sbl3cnu@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Wed, 01 Mar 2017 16:53:58 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 01, 2017 at 04:27:29PM +0100, Arnd Bergmann wrote: > On Wed, Mar 1, 2017 at 3:40 PM, Josh Poimboeuf wrote: > > On Wed, Mar 01, 2017 at 10:45:03AM +0100, Arnd Bergmann wrote: > > >> Actually, something must have changed in gcc since last month, I also > >> just got a report in another file: > >> > >> drivers/i2c/busses/i2c-img-scb.o: warning: objtool: img_i2c_probe() > >> falls through to next function img_i2c_read_fifo() > > > > This one looks like it could be related to some recent objtool changes > > which affect how it interprets 'ud2'. Which commit were you testing > > with? Can you provide the .config file, and the object file if it's not > > too big? > > This is with my randconfig test series on top of latest linux-next. > I see it with the latest gcc-7.0.1 snapshot as well as an earlier gcc-7.0.0 > build (20161201), but not with gcc-6.3.1 I wonder if this is another gcc bug. gcc inserted two ud2 instructions in img_i2c_probe() for no apparent reason. Here's one of them: 5c3: e8 00 00 00 00 callq 5c8 5c4: R_X86_64_PC32 dev_warn-0x4 5c8: 8b 05 00 00 00 00 mov 0x0(%rip),%eax # 5ce 5ca: R_X86_64_PC32 .data+0xec 5ce: 89 83 70 06 00 00 mov %eax,0x670(%rbx) 5d4: 0f 0b ud2 Which corresponds to the following code block: if (i2c->bitrate > timings[ARRAY_SIZE(timings) - 1].max_bitrate) { dev_warn(i2c->adap.dev.parent, "requested bitrate (%u) is higher than the max bitrate supported (%u)\n", i2c->bitrate, timings[ARRAY_SIZE(timings) - 1].max_bitrate); timing = timings[ARRAY_SIZE(timings) - 1]; i2c->bitrate = timing.max_bitrate; } I see no apparent reason for the ud2. Can you rebuild the object with CONFIG_DEBUG_INFO and use addr2line to see what code lines are associated with the ud2's? -- Josh