Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp4801183imm; Fri, 18 May 2018 10:52:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpPMm8foYN9rWr+d6FyqCPdhZ+SX+e9dzbvHjg0UkPrRtX6qv93jT7fvEJJvOrR6n5Z4eqi X-Received: by 2002:a65:4945:: with SMTP id q5-v6mr6267890pgs.177.1526665949473; Fri, 18 May 2018 10:52:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526665949; cv=none; d=google.com; s=arc-20160816; b=NTYiYV/nvwpdZ1ujthnXvro7vTrulQPNFFqRLtFVM9zXKDUrGUcAIv7zNvhzpJ9XUk PBboFHAF/Nde9P4w6vveGqQRlYTMA3fF6goTt/LzLK5s3ZZ7Q06Z6c+1Gs52DCWm1soT LiS+wqaWsQGKoCyrUu/g7NSY4rXyGQzKww2nRbJs4DTNPi6fzyIaiOPzkZwI4duAna3g 9D6471DkWFw+vqpWtoCiVyGr1Gu3CF893MnFB8Z/8eH9mo+zgqSKZ76PMzndcCEkV8J7 d9GhpIwu7VqNF+27g168fN+to9RdZ4Ox1ESIJfPnLjFovQhrHu+MfrpYUiC6O2iXhU7u JzZA== 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:dkim-signature:arc-authentication-results; bh=/+SUeKWeyqVHbQ9mJiBjG5zbYrs6tFU1JascWuRHRz8=; b=JDasZuByIauEaoJhjJrqHQ9IM/Vj8lp8ukcA7KOCYyi3Ui+Vd7l6O376SLFOi+DX9B Dz7jO0OMrYWNDqH8ivzer6IFxuQv0oh0sw5FidmajguKvb4hNF9P5eN4wsWMKemGHOD6 0Htp+fNG00cFm5x0Rj1cvPSx98pz+82iJg1pEy4C5blkyDcQ3FnwyFBcbj/vY/k7EJh6 LdHDSPcalUIAbyJVfVNrWLUxt3iWeZXKZDwxZDFXM9wPw848w+euQTIR2jyjF7jsXgPa Mp5JvnZ4nvx9wicTc065sbWvnGR01ib84wl4n61/qUhCd6VNwwPJWYVgXJBn+fFJpdW1 ns9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=BNP6EHVE; 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 e20-v6si6163262pgn.130.2018.05.18.10.52.14; Fri, 18 May 2018 10:52:29 -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=BNP6EHVE; 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 S1752525AbeERRvo (ORCPT + 99 others); Fri, 18 May 2018 13:51:44 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:55079 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752401AbeERRvl (ORCPT ); Fri, 18 May 2018 13:51:41 -0400 Received: by mail-wm0-f68.google.com with SMTP id f6-v6so15416425wmc.4 for ; Fri, 18 May 2018 10:51:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=/+SUeKWeyqVHbQ9mJiBjG5zbYrs6tFU1JascWuRHRz8=; b=BNP6EHVE2O2qvcRdI6OTaQksEoCCzYkX+D95N5rA3Yjxml1pExPwE7+SRpQPS8IrPW rnDjQYTAEDI3rBfoEzTdBLYtrntxnwdc2kcXj244rqtK8qiQ8sYg84Iq3BFqPjBPiKL1 g2W+10FNQsqcWJ0A/D3fGDCjbgSAT5Zt0iWwDgQTsXzJ0KOsF9iS0k85KliyG2WVbOtn z0IzPNdsVVbRe07C8wLtRjUgKQQFcD0jRQ3RjfF0Fkyg7CpAk/MlTX+/j7k7CTCYTkFY KMCqyHjhfFRm2km410IciDFbEB6AyiuUAYGRfXaLRjK2vdJIBvarJQkO088Vy0USlhbO HeCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=/+SUeKWeyqVHbQ9mJiBjG5zbYrs6tFU1JascWuRHRz8=; b=bVvdYW7Ro+gAZcxLt9ALh6rCpdIW2yLxOtQUZKgC743wsNNkAvtlWr9rQJonLMVarx 3O/aS+ud3OkQvhKKIWQ61KWMZ7BvwFhuIX7fXHHDaaYrBZJ6BmZodoejJkXSmYdQRJdF oQBhMszew89wnR73VOFxW2Gu+hv21HKidvBfW3grJv+Qadiqpuvf5gBq89J53xQq+95g pD6n3c3PvsY70Fs5q2V92DqGLJvMbERavgV8ZzCJChRFiFQYZLMs/iL4XDm+uA9VcbBv WBfHm5D1SWHIq3AONkhvH1zQa08AWUuyoRkqtb8OKaAkgRGrkejsuBy5hR/22EcA/gVJ rytQ== X-Gm-Message-State: ALKqPwcEQToJvyN0W22YoGntgUo/GYhAA9KnpyNN2XK/6JrI+3J8/bBz Z3NHahCiXyx+2JvwTmzKug== X-Received: by 2002:a1c:48c4:: with SMTP id v187-v6mr5052847wma.115.1526665899929; Fri, 18 May 2018 10:51:39 -0700 (PDT) Received: from avx2 (nat4-minsk-pool-46-53-177-92.telecom.by. [46.53.177.92]) by smtp.gmail.com with ESMTPSA id 137-v6sm12941783wmk.38.2018.05.18.10.51.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 May 2018 10:51:39 -0700 (PDT) Date: Fri, 18 May 2018 20:51:36 +0300 From: Alexey Dobriyan To: Ingo Molnar Cc: Josh Poimboeuf , Linus Torvalds , Peter Anvin , kernel test robot , Thomas Gleixner , Andrew Lutomirski , Borislav Petkov , Brian Gerst , Denys Vlasenko , Peter Zijlstra , Linux Kernel Mailing List , Peter Anvin , tipbuild@zytor.com, LKP Subject: Re: [PATCH] objtool: Detect assembly code falling through to INT3 padding Message-ID: <20180518175136.GB2055@avx2> References: <20180515214337.GA18021@avx2> <20180515222211.ods5hzne46hozojq@treble> <20180515224354.zmygmsnlqj5lrdbo@treble> <20180516033044.odb74pdgcn5nacwb@treble> <20180517134934.eog2fgoby5azq5a7@treble> <20180518071814.GB26358@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180518071814.GB26358@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 18, 2018 at 09:18:14AM +0200, Ingo Molnar wrote: > The concept of built-in kernel tooling working at the machine code level is just > so powerful - we should have added our own KCC compiler 20 years ago. ...for two very serious reasons * C as a language moves very slowly, last help from the comittee were C99 intializers which are OK, but, say, memory model was explictly rejected. However the project expands and becomes more complex much faster than C working group sets up meetings. Compiler authors help with extensions but ultimately can not be relied on (see "inline" saga). Recently everyone was celebrating new and improved min() and max() macros admiring creativity and knowledge of intricate language details (me too, don't get this wrong). Now this is how it can be done in a language which is not stupid: constexpr int min(int a, int b) { return a < b ? a : b; } That's literally all. And you can also do template void min(T a, char b) = delete; template void min(char a, T b) = delete; because "char" is char. Having control over compiler things like that can be addded more quickly. * insulating the project from the whims of compiler authors who every once in a while use "undefined behaviour" or other kinds of language lawyering to do strange things. Other serious projects do this too. Database people use O_DIRECT to insulate themselves from kernel people for the very same reasons.