From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752641AbcJJUaE (ORCPT ); Mon, 10 Oct 2016 16:30:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42184 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751991AbcJJUaD (ORCPT ); Mon, 10 Oct 2016 16:30:03 -0400 Date: Mon, 10 Oct 2016 15:23:22 -0500 From: Josh Poimboeuf To: Arnd Bergmann Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [RFC] x86: avoid -mtune=atom for objtool warnings Message-ID: <20161010202322.labiotb5dsf4oyfi@treble> References: <20161010125709.1870563-1-arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20161010125709.1870563-1-arnd@arndb.de> 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]); Mon, 10 Oct 2016 20:23:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 10, 2016 at 02:56:56PM +0200, Arnd Bergmann wrote: > I have no idea what is actually going on here, but building an x86 kernel > with CONFIG_MATOM results in countless warnings from objtool, such as > > arch/x86/events/intel/ds.o: warning: objtool: intel_pmu_pebs_del()+0x43: call without frame pointer save/setup > security/keys/keyring.o: warning: objtool: keyring_read()+0x59: call without frame pointer save/setup > kernel/signal.o: warning: objtool: __dequeue_signal()+0xd8: call without frame pointer save/setup > kernel/signal.o: warning: objtool: kill_pid()+0x15: call without frame pointer save/setup > kernel/signal.o: warning: objtool: SyS_signal()+0x27: call without frame pointer save/setup > mm/page_alloc.o: warning: objtool: zone_watermark_ok_safe()+0x27: call without frame pointer save/setup > fs/exec.o: warning: objtool: read_code()+0x18: call without frame pointer save/setup > mm/swap.o: warning: objtool: get_kernel_page()+0x24: call without frame pointer save/setup > mm/swap.o: warning: objtool: pagevec_move_tail.constprop.25()+0x26: call without frame pointer save/setup > block/bio.o: warning: objtool: bio_map_kern()+0x47: call without frame pointer save/setup > arch/x86/crypto/poly1305_glue.o: warning: objtool: poly1305_simd_mult()+0x2d: call without frame pointer save/setup > crypto/skcipher.o: warning: objtool: skcipher_encrypt_ablkcipher()+0x58: call without frame pointer save/setup > crypto/skcipher.o: warning: objtool: skcipher_decrypt_ablkcipher()+0x58: call without frame pointer save/setup > fs/inode.o: warning: objtool: ilookup()+0x5d: call without frame pointer save/setup > fs/inode.o: warning: objtool: proc_nr_inodes()+0x3e: call without frame pointer save/setup > fs/namei.o: warning: objtool: lookup_one_len_unlocked()+0x21: call without frame pointer save/setup > block/elevator.o: warning: objtool: elv_rb_add()+0x5b: call without frame pointer save/setup > crypto/shash.o: warning: objtool: shash_async_init()+0x1e: call without frame pointer save/setup > crypto/shash.o: warning: objtool: shash_async_import()+0x1e: call without frame pointer save/setup > mm/vmscan.o: warning: objtool: pfmemalloc_watermark_ok()+0xb9: call without frame pointer save/setup > > I have not looked at whether this is a bug in gcc or in objtool, however > I found that not using -mtune=atom reliably avoids the problem. I could > reproduce the problem with gcc versions 4.7 through 6.1. Thanks for reporting it. It looks like 'mtune=atom' sometimes makes a slight change to one of the stack frame setup instructions. Instead of: move rsp, rbp It sometimes does: lea (%rsp),%rbp They're two different instructions, but they have the same result. It's an easy fix for objtool. I'll post a patch soon. -- Josh