Re: [PATCH v2 05/11] x86: add CONFIG_X86_64_NATIVE option
From: Josh Triplett
Date: Tue Dec 10 2024 - 16:03:09 EST
On Tue, Dec 10, 2024 at 03:49:39PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@xxxxxxxx>
>
> As a replacement for the obsole MK8/MPSC/MCORE2 configuration options,
> allow building a specialized kernel for the local CPU, which is useful
> for users building their own kernels, and does not require maintaining
> a list of possible CPU options.
>
> Between -march=native and -mtune=native, I pick the former in order
> to give the best performance through the use of extra instructions,
> but at the cost of not being able to run on older CPUs at all. This
> creates a small risk of running into illegal instruction faults when
> the resulting binary ends up being run on a machine other than the
> one it was built on.
Setting this option makes the kernel build non-reproducible (as it'll
build differently on different systems).
I personally think this is a little questionable, as opposed to having
well-defined optimization levels that are tested and supported and
selecting one of those with a `make nativeconfig`. But if this does get
added:
- Could you please document in
Documentation/kbuild/reproducible-builds.rst that this option should
not be set if you want reproducible builds?
- Could you add something similar to the config options LTO uses, to
make `allyesconfig` and `allmodconfig` turn this back *off*?