[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <99446363-152f-43a8-8b74-26f0d883a364@zytor.com>
Date: Tue, 1 Oct 2024 14:13:05 -0700
From: "H. Peter Anvin" <hpa@...or.com>
To: Ard Biesheuvel <ardb+git@...gle.com>, linux-kernel@...r.kernel.org
Cc: Ard Biesheuvel <ardb@...nel.org>, x86@...nel.org,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>, Uros Bizjak <ubizjak@...il.com>,
Dennis Zhou <dennis@...nel.org>, Tejun Heo <tj@...nel.org>,
Christoph Lameter <cl@...ux.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Juergen Gross <jgross@...e.com>,
Boris Ostrovsky
<boris.ostrovsky@...cle.com>,
Greg Kroah-Hartman
<gregkh@...uxfoundation.org>,
Arnd Bergmann <arnd@...db.de>, Masahiro Yamada <masahiroy@...nel.org>,
Kees Cook <kees@...nel.org>, Nathan Chancellor <nathan@...nel.org>,
Keith Packard <keithp@...thp.com>,
Justin Stitt <justinstitt@...gle.com>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Arnaldo Carvalho de Melo <acme@...nel.org>,
Namhyung Kim <namhyung@...nel.org>, Jiri Olsa <jolsa@...nel.org>,
Ian Rogers <irogers@...gle.com>,
Adrian Hunter <adrian.hunter@...el.com>,
Kan Liang <kan.liang@...ux.intel.com>, linux-doc@...r.kernel.org,
linux-pm@...r.kernel.org, kvm@...r.kernel.org,
xen-devel@...ts.xenproject.org, linux-efi@...r.kernel.org,
linux-arch@...r.kernel.org, linux-sparse@...r.kernel.org,
linux-kbuild@...r.kernel.org, linux-perf-users@...r.kernel.org,
rust-for-linux@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [RFC PATCH 25/28] x86: Use PIE codegen for the core kernel
On 9/25/24 08:01, Ard Biesheuvel wrote:
> From: Ard Biesheuvel <ardb@...nel.org>
>
> As an intermediate step towards enabling PIE linking for the 64-bit x86
> kernel, enable PIE codegen for all objects that are linked into the
> kernel proper.
>
> This substantially reduces the number of relocations that need to be
> processed when booting a relocatable KASLR kernel.
>
This really seems like going completely backwards to me.
You are imposing a more restrictive code model on the kernel, optimizing
for boot time in a way that will exert a permanent cost on the running
kernel.
There is a *huge* difference between the kernel and user space here:
KERNEL MEMORY IS PERMANENTLY ALLOCATED, AND IS NEVER SHARED.
Dirtying user pages requires them to be unshared and dirty, which is
undesirable. Kernel pages are *always* unshared and dirty.
> It also brings us much closer to the ordinary PIE relocation model used
> for most of user space, which is therefore much better supported and
> less likely to create problems as we increase the range of compilers and
> linkers that need to be supported.
We have been resisting *for ages* making the kernel worse to accomodate
broken compilers. We don't "need" to support more compilers -- we need
the compilers to support us. We have working compilers; any new compiler
that wants to play should be expected to work correctly.
-hpa
Powered by blists - more mailing lists