From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Triplett Subject: Re: [RFC 1/8] x86: objtool: use asm macro for better compiler decisions Date: Tue, 15 May 2018 14:37:13 -0700 Message-ID: <20180515213713.GA7298@localhost> References: <20180515141124.84254-1-namit@vmware.com> <20180515141124.84254-2-namit@vmware.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20180515141124.84254-2-namit@vmware.com> Sender: linux-kernel-owner@vger.kernel.org To: Nadav Amit Cc: linux-kernel@vger.kernel.org, nadav.amit@gmail.com, Christopher Li , linux-sparse@vger.kernel.org List-Id: linux-sparse@vger.kernel.org On Tue, May 15, 2018 at 07:11:08AM -0700, Nadav Amit wrote: > GCC considers the number of statements in inlined assembly blocks, > according to new-lines and semicolons, as an indication to the cost of > the block in time and space. This data is distorted by the kernel code, > which puts information in alternative sections. As a result, the > compiler may perform incorrect inlining and branch optimizations. > > In the case of objtool, this distortion is extreme, since anyhow the > annotations of objtool are discarded during linkage. > > The solution is to set an assembly macro and call it from the inlinedv > assembly block. As a result GCC considers the inline assembly block as > a single instruction. > > This patch slightly increases the kernel size. > > text data bss dec hex filename > 18126699 10066728 2936832 31130259 1db0293 ./vmlinux before > 18126824 10067268 2936832 31130924 1db052c ./vmlinux after (+665) With what kernel config? What's the text size change for an allnoconfig?