mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: hpa@zytor.com
To: Alexey Dobriyan <adobriyan@gmail.com>, Ingo Molnar <mingo@kernel.org>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Anvin <h.peter.anvin@intel.com>,
	kernel test robot <xiaolong.ye@intel.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Andrew Lutomirski <luto@kernel.org>,
	Borislav Petkov <bp@alien8.de>, Brian Gerst <brgerst@gmail.com>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	tipbuild@zytor.com, LKP <lkp@01.org>
Subject: Re: [PATCH] objtool: Detect assembly code falling through to INT3 padding
Date: Sat, 19 May 2018 01:18:59 -0700	[thread overview]
Message-ID: <84F157C1-AD98-473D-9CF6-2A26A499DECF@zytor.com> (raw)
In-Reply-To: <20180518175136.GB2055@avx2>

On May 18, 2018 10:51:36 AM PDT, Alexey Dobriyan <adobriyan@gmail.com> wrote:
>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<typename T>
>	void min(T a, char b) = delete;
>
>	template<typename T>
>	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.

Sounds like you are proposing switching to C++ more than anything else.

*Steps aside and grabs popcorn*
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

  reply	other threads:[~2018-05-19  8:20 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-15  8:00 [lkp-robot] [x86/asm] 51bad67ffb: int3:#[##] kernel test robot
2018-05-15 21:07 ` Alexey Dobriyan
     [not found]   ` <C40DC70F50313144AB3AF8625D4F407F90689B42@ORSMSX101.amr.corp.intel.com>
2018-05-15 21:43     ` Alexey Dobriyan
2018-05-15 22:22       ` Josh Poimboeuf
2018-05-15 22:26         ` Thomas Gleixner
2018-05-15 22:28         ` Linus Torvalds
2018-05-15 22:43           ` Josh Poimboeuf
2018-05-15 22:52             ` Linus Torvalds
2018-05-15 23:05               ` Linus Torvalds
2018-05-16  3:30                 ` Josh Poimboeuf
2018-05-17 13:49                   ` [PATCH] objtool: Detect assembly code falling through to INT3 padding Josh Poimboeuf
2018-05-17 14:01                     ` Peter Zijlstra
2018-05-18  7:24                       ` Ingo Molnar
2018-05-18  7:18                     ` Ingo Molnar
2018-05-18  7:27                       ` H. Peter Anvin
2018-05-18 16:06                         ` Borislav Petkov
2018-05-18  7:27                       ` Ingo Molnar
2018-05-18 17:51                       ` Alexey Dobriyan
2018-05-19  8:18                         ` hpa [this message]
2018-05-19  7:00                 ` "interesting" entry in hibernation code was Re: [lkp-robot] [x86/asm] 51bad67ffb: int3:#[##] Pavel Machek
2018-05-19  8:35                   ` Rafael J. Wysocki
2018-05-18  7:15               ` Ingo Molnar
2018-05-15 22:25       ` Thomas Gleixner
2018-05-15 22:29         ` Andy Lutomirski
2018-05-15 22:27       ` Linus Torvalds
2018-05-15 22:50         ` Alexey Dobriyan
2018-05-15 22:58           ` [PATCH v2] x86/asm: Pad assembly functions with INT3 instructions Alexey Dobriyan
2018-05-15 23:28             ` Linus Torvalds
2018-05-18  7:36             ` Ingo Molnar
2018-05-18 13:02               ` Josh Poimboeuf
2018-05-18 17:34                 ` Alexey Dobriyan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=84F157C1-AD98-473D-9CF6-2A26A499DECF@zytor.com \
    --to=hpa@zytor.com \
    --cc=adobriyan@gmail.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dvlasenk@redhat.com \
    --cc=h.peter.anvin@intel.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@01.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=tipbuild@zytor.com \
    --cc=torvalds@linux-foundation.org \
    --cc=xiaolong.ye@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®