-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compile kernel with retpoline GCC support #34383
Comments
Do we have benchmarks on how much this costs, worst-case? I mean, it should absolutely be enabled by default, but there are workloads for which Spectre mitigation is not absolutely required. If the cost is high enough then a configuration flag (with suitably severe wording) might be warranted. |
@Baughn: Please see https://www.phoronix.com/scan.php?page=article&item=linux-retpoline-benchmarks&num=1 for performance numbers, thanks to the awesomely hardworking Michael Larabel. The change references in the PR above should be equivalent to switching from the "Retpoline" numbers to the "Retpoline + GCC" numbers. Yes, the impact is significant. |
Another impact assessment by RedHat. @Baughn: The compiler upgrade triggers retpoline, and that's a surprise performance regression yes. However users can disable it setting "RETPOLINE n" in their kernelPlatform.kernelExtraConfig. I would not expose more knobs and argue that this sticks to the tradition that no other performance relevant kernel knobs are exposed as extra knobs, see common-config.nix. On the fact that this is a surprise regression, I'd say that I take that over a surprise vulnerability any day, and that with the mechanisms above versatile users can disable it. The only question is whether we should document CONFIG_RETPOLINE more extensively but also the nixos manual is not making any recommendations on kernel configurations, so I am not sure where to put such any remarks. Release notes for 18.03 seem most appropriate. I have no good suggestion for a 17.09 backport though. |
All right, fair enough. I'm not going to argue it. If I were, however, than a counterargument might look like this: There is likely to be mitigations application-side as well as kernel-side, and having a single flag to disable all of them would be useful. On the flip side, I'm having trouble thinking of a single decent reason for doing so in e.g. Chrome. |
See #34383 On master the expressions have changed nontrivially, so it's going to be separately done work. (And we expect gcc7 by default for every package on master soon.)
Done in 17.09-small channel; I expect others will follow soon. |
I expect we will revert this after general upgrade to gcc7. See #34383
Channel unstable-small updated as well. The big ones move slower as usual. Enjoy! |
I rebuilt my system from latest master and
Also, gcc6 still seems to be in the kernel closure:
I think this is because of
|
I also see the same thing:
|
@dotlambda: thanks! The real problem is probably a few lines above what you pointed out. I didn't realize this difference from 17.09. |
Tested 17.09-small, to be sure:
|
Our cross-compilation fixes got into the way, as kernel needs two compilers in general, due to also running self-compiled stuff during the build. If you need a fix immediately, use #34882 – I tested it this time :-) |
Re-tested the last version (as 17.09 above) and merged. |
Retpoline is a spectre v2 mitigation technique. GCC 7.3.0 was released last week with support for that. The kernel being the most vulnerable and privileged part should be compiled with retpoline support.
Requirements:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git/commit/?h=v4.14.15&id=3a72bd4b60da338e66922e4f9eded174b3ad147d
Switching kernel compilation to GCC 7 should get us there. At the moment we use gcc 6.4.0.
The text was updated successfully, but these errors were encountered: