Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1148235imm; Tue, 15 May 2018 14:39:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqTVzvMPFtEvU6a6PKzWqQXKO7xu+XPnZZ7Gs/eCr4UyaH3zoY0c0TcnQpl7JT95k/zXgz9 X-Received: by 2002:a17:902:6ac3:: with SMTP id i3-v6mr15872337plt.378.1526420361214; Tue, 15 May 2018 14:39:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526420361; cv=none; d=google.com; s=arc-20160816; b=0OYU3eUAXDgR9kwCA0Ujm3runkGMaUzjW6ouIdVio6mip0sTJb2Cuo9lEPcoGpCF8K kJNvDC0XM5cU+mWQ3bgaL19H7fOIEoQ5o9s5Bd8BcWg4LW1muvpmN6G2M+BBuzEInbCL r6vPmFtPW41XMnDTogVHC7AXq8rqdNJ+IJATxA7MCL7rn61s+f7PWJkoFeKmltbwm4EU S2Mc5lblLflzpAl7jMl4Z0K/z4s1XrKXQDxuo8oKyX48Ls35PFGVrgn53heQL+Ona0zk mBuv1IyRCGS/FmgiaGWKJ9jYFvyaRMrvQwABuW6fKEOGhQqSkM1QbuRJxXtmYPH3goWP h+UA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=LToPibls6zUlUhcQFRSdW9ZjrrbYMpvzsXvWaUpw2sI=; b=KjNa/CnzBSjIr7BwTSBRMy1DQPSfMe9CHLzPtklEU+nq7sdzE5Uapdu2ctld5uSe5v dr8A3Ag0vZpA3rT2stFaeiP3vCpfZ2EchKJbTrbt/zLXM4CUxHmD/W8J8+VQPrY22Y5q LygIX5JMcI41yk4I0MnOJhrZ0+U83gf5K0ZoDjpYjsbjFxHUu7MxcQWZZqFQ23cvVnNX 2Ai1RHTpQNtelU0HTgds4GED+5vpLo6Hn8GCG7p2o+fCXzIakCyROmoDrS4SXSxoeA+8 f8/ZYotoTUmU9y8f8NN+Kqo7HSlVaPep8dGyfbWLcZchOGuLSFZ0bkquI/aOWNstbsFZ 6oKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v81-v6si987645pfi.22.2018.05.15.14.39.06; Tue, 15 May 2018 14:39:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752211AbeEOVhk (ORCPT + 99 others); Tue, 15 May 2018 17:37:40 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:35387 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751233AbeEOVhh (ORCPT ); Tue, 15 May 2018 17:37:37 -0400 X-Originating-IP: 134.134.139.76 Received: from localhost (unknown [134.134.139.76]) (Authenticated sender: josh@joshtriplett.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 4949360014; Tue, 15 May 2018 23:37:33 +0200 (CEST) Date: Tue, 15 May 2018 14:37:13 -0700 From: Josh Triplett To: Nadav Amit Cc: linux-kernel@vger.kernel.org, nadav.amit@gmail.com, Christopher Li , linux-sparse@vger.kernel.org Subject: Re: [RFC 1/8] x86: objtool: use asm macro for better compiler decisions 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 Content-Disposition: inline In-Reply-To: <20180515141124.84254-2-namit@vmware.com> User-Agent: Mutt/1.9.5 (2018-04-13) X-Spam-Level: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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?