Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1199057imm; Tue, 15 May 2018 15:35:37 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr1BF9+nOHu8Yr28PQGSaQfdY5X8Zxsq+raR14ooVAVmXIpQiNEwtnCYlTPyM/2jvp14wdo X-Received: by 2002:a17:902:8e8b:: with SMTP id bg11-v6mr15932722plb.95.1526423737603; Tue, 15 May 2018 15:35:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526423737; cv=none; d=google.com; s=arc-20160816; b=JlklG34Ibn1Qy1VFPIfiyVPY6hcHqgeu0PUd9+kqZfmoavjtyzG1FSGGeuqrBD4sXI b9tBibyMRRRRUMio6rbQ5/WslNB6lXFxLxR2A7OMbtxGk327trxyuSABw7ZlL2mfiTxv IWGHiiBfOB0egdYd5cP4i5FX82gHBYRkjD61zuZ2oM2sLq863WeLRmXrI27DUBv008W7 gL7/94eatSXBe+8clOl3sroXFZnj/6X9ETUEcxHavtnX+7J1jrI7Q/CtbYVjZHhieeyl PyFB3FEylhQSINTwcppGLaybfdgU4dixi+YrMk9zj9sRmgC5k7ElrLXyxkrlBTiqflqb pdCw== 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=UjlJZMQGOkTCNjZyQTV1bVoaEMxd3DbPN55fBMd0bP8=; b=lhxgnpmY/xLGKmkGC9o7vkRCU7PcNTtMBw94CKT0H0rdgmK+ExKw2gaTkWhMa9tR0U PS5cYjD/PJtO95XGLWAxnofXxJw68nF3y27A4p3NHN938GLSPwgFa8qY/58rbGY1jDqe CAWKz6o0h1raJA0XhnuUc7lXoKO5luf9q3KrMm5hTTuFbepu5LfwcWK0xvCPwAb/zqt6 72cO+RMBPs91Fjf9y8vZhmdk3elzIK8RqzE/A21IJYLrFpmi1WDUiqj6t0FfiIbWTEBx GQyZSpHoXuzOyUipuMmPx8Tx6TVWl7AA2owVfhVnZH6uEzOYXOMwYXvKjaCqwcLN9RkX jnXQ== 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 bd8-v6si766243plb.559.2018.05.15.15.35.22; Tue, 15 May 2018 15:35:37 -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 S1752162AbeEOWfF (ORCPT + 99 others); Tue, 15 May 2018 18:35:05 -0400 Received: from mslow2.mail.gandi.net ([217.70.178.242]:36512 "EHLO slow1-d.mail.gandi.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752024AbeEOWfE (ORCPT ); Tue, 15 May 2018 18:35:04 -0400 Received: from relay1-d.mail.gandi.net (unknown [217.70.183.193]) by slow1-d.mail.gandi.net (Postfix) with ESMTP id 933FE3A2CD7; Tue, 15 May 2018 23:56:01 +0200 (CEST) X-Originating-IP: 134.134.139.76 Received: from localhost (unknown [134.134.139.76]) (Authenticated sender: josh@joshtriplett.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 43BB0240005; Tue, 15 May 2018 23:56:00 +0200 (CEST) Date: Tue, 15 May 2018 14:55:41 -0700 From: Josh Triplett To: Nadav Amit Cc: linux-kernel@vger.kernel.org, Christopher Li , linux-sparse@vger.kernel.org Subject: Re: [RFC 1/8] x86: objtool: use asm macro for better compiler decisions Message-ID: <20180515215540.GB7298@localhost> References: <20180515141124.84254-1-namit@vmware.com> <20180515141124.84254-2-namit@vmware.com> <20180515213713.GA7298@localhost> <4E72C06C-7A4B-4E18-83DA-8E0C9F701854@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4E72C06C-7A4B-4E18-83DA-8E0C9F701854@gmail.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 02:53:52PM -0700, Nadav Amit wrote: > Josh Triplett wrote: > > > 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? > > I use my custom config and to include the drivers in the image. Other > configs were not too appropriate: defconfig does not enable paravirt and > allyesconfig is too heavy. > > There is no effect with allnoconfig on size: > > text data bss dec hex filename > 1018441 230148 1215604 2464193 2599c1 ./vmlinux > 1018441 230148 1215604 2464193 2599c1 ./vmlinux > > I think it is expected since CONFIG_STACK_VALIDATION is off. No? Thanks for checking; fine by me then. :)