linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	live-patching@vger.kernel.org, Michal Marek <mmarek@suse.cz>,
	Peter Zijlstra <peterz@infradead.org>,
	Andy Lutomirski <luto@kernel.org>, Borislav Petkov <bp@alien8.de>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andi Kleen <andi@firstfloor.org>, Pedro Alves <palves@redhat.com>,
	Namhyung Kim <namhyung@gmail.com>,
	Bernd Petrovitsch <bernd@petrovitsch.priv.at>,
	Chris J Arges <chris.j.arges@canonical.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Jiri Slaby <jslaby@suse.cz>,
	Arnaldo Carvalho de Melo <acme@kernel.org>
Subject: Re: [PATCH 09/11] tools/objtool: Copy hashtable.h into tools directory
Date: Wed, 9 Mar 2016 19:39:45 +0100	[thread overview]
Message-ID: <20160309183945.GA17956@gmail.com> (raw)
In-Reply-To: <20160309160941.GA21308@treble.redhat.com>


* Josh Poimboeuf <jpoimboe@redhat.com> wrote:

> > So it would be nice to also add a build time warning if the 'upstream' copy of 
> > hashtable.h deviates from the tooling file.
> > 
> > Just like you are already doing it for other files:
> > 
> > objtool/Makefile:       diff -I'^#include' arch/x86/insn/insn.c ../../arch/x86/lib/insn.c >/dev/null && \
> > 
> > Btw., eventually we might want to factor out such duplication into a single 
> > place in tools/lib/ or so, to only have a 'master copy' (upstream kernel 
> > source), and the tooling copy.
> 
> Yeah, since we already have at least two instances of this type of diffing in 
> the tools tree, it would be good to generalize these diffs in a common place 
> with a common kernel build target.  I'll add it to my TODOs.
> 
> BTW, do you know why the policy is to copy them instead of just including the 
> kernel versions?

Yeah, so we started with that, but it occasionally resulted in build failures 
being introduced on the kernel side, which wasn't noticed on the tooling side 
immediately. (as you don't normally build tooling if you build the kernel.)

Linus (rightfully) complained about that kind of overly tight coupling, and we 
figured out the diff method you can see on the tooling side: we copy files but 
don't let them stay forked too long: we detect differences and warn about them in 
a soft fashion (just emit a warning), without breaking the tooling side or the 
kernel side.

And you are perfectly right that this should be made an integral, easy to utilize 
part of the tooling build system.

> Or if the goal is only to make it possible to compile kernel headers in user 
> space, then we may only need to copy or recreate some headers and I may have 
> been overzealous with my copying.

So the goal is to have all the benefits of sharing code (kernel libraries and 
headers are cool and well-maintained), without any of the disadvantages of such 
tight code sharing! ;-)

That's why we came up with this method, which is essentially a distributed file 
system with a manual, high latency cache coherency protocol.

Thanks,

	Ingo

  reply	other threads:[~2016-03-09 18:39 UTC|newest]

Thread overview: 55+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29  4:22 [PATCH v19 00/10] Compile-time stack metadata validation Josh Poimboeuf
2016-02-29  4:22 ` [PATCH v19 01/10] objtool: Mark non-standard files and directories Josh Poimboeuf
2016-02-29 10:58   ` [tip:core/objtool] objtool: Mark non-standard object " tip-bot for Josh Poimboeuf
2016-02-29  4:22 ` [PATCH v19 02/10] objtool: Add STACK_FRAME_NON_STANDARD macro Josh Poimboeuf
2016-02-29 10:58   ` [tip:core/objtool] objtool: Add STACK_FRAME_NON_STANDARD() macro tip-bot for Josh Poimboeuf
2016-02-29  4:22 ` [PATCH v19 03/10] x86/xen: Mark xen_cpuid() stack frame as non-standard Josh Poimboeuf
2016-02-29 10:59   ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-02-29  4:22 ` [PATCH v19 04/10] bpf: Mark __bpf_prog_run() " Josh Poimboeuf
2016-02-29 10:59   ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-02-29  4:22 ` [PATCH v19 05/10] sched: Mark __schedule() " Josh Poimboeuf
2016-02-29 10:59   ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-02-29  4:22 ` [PATCH v19 06/10] sched: always inline context_switch() Josh Poimboeuf
2016-02-29 11:00   ` [tip:core/objtool] sched: Always " tip-bot for Josh Poimboeuf
2016-02-29  4:22 ` [PATCH v19 07/10] x86/kprobes: Mark kretprobe_trampoline() stack frame as non-standard Josh Poimboeuf
2016-02-29 11:00   ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-02-29  4:22 ` [PATCH v19 08/10] objtool: Compile-time stack metadata validation Josh Poimboeuf
2016-02-29 11:01   ` [tip:core/objtool] objtool: Add tool to perform compile-time " tip-bot for Josh Poimboeuf
2016-02-29  4:22 ` [PATCH v19 09/10] objtool: Add CONFIG_STACK_VALIDATION option Josh Poimboeuf
2016-02-29 11:01   ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-03 14:12     ` Sebastian Andrzej Siewior
2016-03-03 14:56       ` Josh Poimboeuf
2016-02-29  4:22 ` [PATCH v19 10/10] objtool: Enable stack metadata validation on x86_64 Josh Poimboeuf
2016-02-29 11:01   ` [tip:core/objtool] objtool: Enable stack metadata validation on 64-bit x86 tip-bot for Josh Poimboeuf
2016-03-08 10:37 ` [PATCH v19 00/10] Compile-time stack metadata validation Ingo Molnar
2016-03-08 12:29   ` Josh Poimboeuf
2016-03-08 13:44     ` Ingo Molnar
2016-03-08 14:21       ` Josh Poimboeuf
2016-03-08 15:15         ` Ingo Molnar
2016-03-08 15:49           ` Ingo Molnar
2016-03-09  6:06             ` [PATCH 00/11] Various objtool fixes Josh Poimboeuf
2016-03-09  6:06               ` [PATCH 01/11] objtool: Prevent infinite recursion in noreturn detection Josh Poimboeuf
2016-03-09 11:42                 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09  6:06               ` [PATCH 02/11] objtool: Detect infinite recursion Josh Poimboeuf
2016-03-09 11:43                 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09  6:06               ` [PATCH 03/11] objtool: Compile with debugging symbols Josh Poimboeuf
2016-03-09 11:43                 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09  6:06               ` [PATCH 04/11] objtool: Fix false positive warnings related to sibling calls Josh Poimboeuf
2016-03-09 11:43                 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09  6:06               ` [PATCH 05/11] objtool: Add helper macros for traversing instructions Josh Poimboeuf
2016-03-09 11:44                 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09  6:06               ` [PATCH 06/11] objtool: Remove superflous INIT_LIST_HEAD Josh Poimboeuf
2016-03-09 11:44                 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09  6:06               ` [PATCH 07/11] objtool: Rename some variables and functions Josh Poimboeuf
2016-03-09 11:45                 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09  6:06               ` [PATCH 08/11] objtool: Fix false positive warnings for functions with multiple switch statements Josh Poimboeuf
2016-03-09 11:45                 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09  6:06               ` [PATCH 09/11] tools/objtool: Copy hashtable.h into tools directory Josh Poimboeuf
2016-03-09  9:47                 ` Ingo Molnar
2016-03-09 16:09                   ` Josh Poimboeuf
2016-03-09 18:39                     ` Ingo Molnar [this message]
2016-03-09 11:45                 ` [tip:core/objtool] tools: " tip-bot for Josh Poimboeuf
2016-03-09  6:07               ` [PATCH 10/11] objtool: Add several performance improvements Josh Poimboeuf
2016-03-09 11:46                 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf
2016-03-09  6:07               ` [PATCH 11/11] objtool: Only print one warning per function Josh Poimboeuf
2016-03-09 11:46                 ` [tip:core/objtool] " tip-bot for Josh Poimboeuf

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=20160309183945.GA17956@gmail.com \
    --to=mingo@kernel.org \
    --cc=acme@infradead.org \
    --cc=acme@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=andi@firstfloor.org \
    --cc=bernd@petrovitsch.priv.at \
    --cc=bp@alien8.de \
    --cc=chris.j.arges@canonical.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=live-patching@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mmarek@suse.cz \
    --cc=namhyung@gmail.com \
    --cc=palves@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).