[PATCH 0/3] avoid unnecessary recompilations in x86 boot code

From: Jann Horn
Date: Tue Feb 20 2024 - 14:22:08 EST


It's been bugging me that every time I rebuild the kernel, kaslr.o and
misc.o get rebuilt just because they pull in one or two things from some
headers that change on every build. So this series moves them into a
separate file that should be faster to build.

This doesn't seem to actually make a difference in terms of wall clock
time, I think because these compiler invocations run in parallel with
kernel compression; but when I tested with an earlier version of this
patch series, I saw something like a 500ms reduction in CPU time used.

Not exactly a major win, and I guess CPU time isn't really the metric
that matters here, but still, I think this makes sense as a cleanup?


Jann Horn (3):
x86/boot: fix KASLR hashing to use full input
x86/boot: avoid recompiling misc.c for incremental rebuilds
x86/boot: avoid recompiling kaslr.c for incremental rebuilds

arch/x86/boot/compressed/Makefile | 4 ++--
arch/x86/boot/compressed/dynamic_vars.c | 17 +++++++++++++++
arch/x86/boot/compressed/dynamic_vars.h | 14 ++++++++++++
arch/x86/boot/compressed/kaslr.c | 29 +++++++++++++++----------
arch/x86/boot/compressed/misc.c | 6 ++---
5 files changed, 53 insertions(+), 17 deletions(-)
create mode 100644 arch/x86/boot/compressed/dynamic_vars.c
create mode 100644 arch/x86/boot/compressed/dynamic_vars.h

--
2.44.0.rc0.258.g7320e95886-goog