Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1161949imm; Tue, 15 May 2018 14:54:55 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpkqI58Q4nu4C86j3mWSwWQyXbHtFEyDgKValeRaQPQ0gSbzeKsm+tJ7t+2VtK0R8RpfcPK X-Received: by 2002:a63:7a48:: with SMTP id j8-v6mr13912016pgn.101.1526421295078; Tue, 15 May 2018 14:54:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526421295; cv=none; d=google.com; s=arc-20160816; b=j48TzemZT5ALe4UqRKLz/yeeLRICOiIapHLpQC2CqQnI1DKRyMISYCm1iQ89bL99UQ f9VQCH4Go3AeR7xHFnAFKJnE9JoBc1ZvSOzLcjO4rlaI0fBrTm3GE3wjupCFtpGyl6O9 p631G0/J36OUn70pR1pW6xB/KYPQYlg8X4bRk9fitjonYuEPVTr3cy/mBTYm0I38eWvn KYyih8IynIbGRs6A9w7FB+iGpMwQDHHMr4T93rXMQRWBEU+hHR4rvV5FN3xo3G8sOLJn vPNstgpUB1NDVTKLsIwY3zYlFg7u14JtL7ICNa6dW5HxajQwQRS6u2bpA+MCowHrkx7K WnVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=3g0KxJDoaPJlZasfqK8MMO3yT1+NpZ3SVKrxCH43S/s=; b=0EpkTI1nxxdCyI3l+6LdHYDKuPguQ3wMsNRpM8FDE6HKL7SjZhE9MihgEJFDREaAUl DnVjHIi2+6JMMtK7mXw6gnShYwDPkm2zA/ovb0KG5TcTaZSIcjsrHXZcTmhyw3YzGT1B R5WmJzSfyMjLsv9USUYhf0M2VCpjWoKbVWal8e3qTAPgydP/QzdlsxAbj8TnKUtxiRgn 4ioVZ7fnzGbv+RrlwO2OqiRZQJ2wlMSn+gWja7LWnY6q3pf9mnwPd2uvynonzNyNuHTg UXTlPhzoTpIrfWkV4LWjFKHU7s+4ZLT2k8mGBJAV+d/01PY8tgErX9K81U8LVl4zP7QZ HWow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KUo72MDQ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x187-v6si816364pgb.335.2018.05.15.14.54.40; Tue, 15 May 2018 14:54:55 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KUo72MDQ; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752351AbeEOVx5 (ORCPT + 99 others); Tue, 15 May 2018 17:53:57 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:38172 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752236AbeEOVxz (ORCPT ); Tue, 15 May 2018 17:53:55 -0400 Received: by mail-pf0-f196.google.com with SMTP id o76-v6so704220pfi.5; Tue, 15 May 2018 14:53:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3g0KxJDoaPJlZasfqK8MMO3yT1+NpZ3SVKrxCH43S/s=; b=KUo72MDQKIsYqOJnRn5GyMwpTXuu0tW0jxodNiCjpuiMxdr0E+0ByT6CffwSyoIUaU J4RHrR66vp03a8sPGxErfrVo7HxAKMgM40sis21VpZKqFVT+sy9NsbjVWlLYQRdCeVfF KKYLrO/rEL4JElcKPyevYCqPaDP0CWMFm64nH4xF/saH8r2nq+FkK966q0rMYwMnyLDy TH2CaJKZS3ynDJHh/PpTTrhr8ndjEYUmBqXjFA2fUoAGjoPcXh2D9WaoE7/PG+5f3vJg 0/bsBVuxBDZMuzGR9LqgWSl9pskMbLrKGokt/zBiEg4v45Sw0uE5vd17eAPSQDwcLtj+ 1Deg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=3g0KxJDoaPJlZasfqK8MMO3yT1+NpZ3SVKrxCH43S/s=; b=c7K3NpOyyYyhFYI0p59QWapAGf4OOdRi18JYLxx2eR1NR+T/OmNUM3LJG26/mRvdRT wvfYkzuPxAaiHqBIWHrtU7zxQ5ll8WHr6M182ZUv0Vf2Cp81mdmAqXw2ZE4Xyplz8xEY GWgpvPHAof0eN0+oH3a3PU3y2SfrdObl2UXNyeHr79zl5hRhcbI6n5Z+RO1UMo4t+6s6 QJ9SKNw8rnoiB9AbPVnLWUuKmgq8oRDy8unJv9gUd/u6ihPXyvxnnjDzk1WxCsRxU9N5 i/IqixoUAU5SOTT4xvm3vjwjO+XP7wiYAqpyz4rjE3ZBTHyG99xLMtBuMmTn2saxNf/7 jB3Q== X-Gm-Message-State: ALKqPweVxMzGGBUP+W8t+knZNaF2QEv39mMy4VK3RJaoaudWF0kfcLlu iVh3Pcer7vwnV5V4meNBrPM= X-Received: by 2002:a62:d605:: with SMTP id r5-v6mr17075723pfg.8.1526421234913; Tue, 15 May 2018 14:53:54 -0700 (PDT) Received: from [10.2.101.129] ([208.91.2.2]) by smtp.gmail.com with ESMTPSA id 76-v6sm1325851pfm.178.2018.05.15.14.53.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 14:53:53 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 10.3 \(3273\)) Subject: Re: [RFC 1/8] x86: objtool: use asm macro for better compiler decisions From: Nadav Amit In-Reply-To: <20180515213713.GA7298@localhost> Date: Tue, 15 May 2018 14:53:52 -0700 Cc: linux-kernel@vger.kernel.org, Christopher Li , linux-sparse@vger.kernel.org Content-Transfer-Encoding: 7bit Message-Id: <4E72C06C-7A4B-4E18-83DA-8E0C9F701854@gmail.com> References: <20180515141124.84254-1-namit@vmware.com> <20180515141124.84254-2-namit@vmware.com> <20180515213713.GA7298@localhost> To: Josh Triplett X-Mailer: Apple Mail (2.3273) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, Nadav