Dimitry Andric
2021-03-26 18:46:33 UTC
Please can someone briefly explain the impact of the following, in
1. WITH_INIT_ALL_PATTERN=
2. WITH_KERNEL_RETPOLINE=
3. WITH_RETPOLINE=
How briefly, exactly? Quoting src.conf(5), in order:1. WITH_INIT_ALL_PATTERN=
2. WITH_KERNEL_RETPOLINE=
3. WITH_RETPOLINE=
WITH_INIT_ALL_PATTERN
Set to build the base system or kernel with stack variables
initialized to (compiler defined) debugging patterns on function
entry. This option requires the clang compiler.
WITH_KERNEL_RETPOLINE
Set to enable the "retpoline" mitigation for CVE-2017-5715 in the
kernel build.
WITH_RETPOLINE
Set to build the base system with the retpoline speculative
execution vulnerability mitigation for CVE-2017-5715.
these aren't enabled by default in arm64. Is there a reason for that?
First of all, because of the performance impact, which can besignificant depending on your specific use case. And secondly, because
compiling with non-default options tends to expose unexpected bugs in
the implementation. (Both in the compiler itself, and in the programs
which are compiled.)
That said, the retpoline mechanisms tend to be fairly well tested by
now, but will still have a non-negligible performance impact, maybe even
a large impact, depending on your workload. There is no simple answer
here, you will have to measure it for yourself.
The init pattern stuff is pretty new, and will almost certainly give
some unexpected effects, such as triggering assertions, and hopefully
exposing bugs. But you will most likely also run into corner cases that
are not handled well by the compiler and/or the software you are
building. The performance impact will certainly not be negligible due
to all the additional memory accesses. :)
-Dimitry