]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/kexec: Invoke copy of relocate_kernel() instead of the original
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 12 Nov 2024 12:18:50 +0000 (12:18 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 5 Dec 2024 15:05:07 +0000 (15:05 +0000)
commitaf9cdfeaf253fae61c5b86482e652dc492b6a447
tree3f3bb26ce84f7987cc428722fc6a350c8e37c40c
parentffea397a8d5c75e5e40c554b19040e839f3cc5a8
x86/kexec: Invoke copy of relocate_kernel() instead of the original

This currently calls set_memory_x() from machine_kexec_prepare() just
like the 32-bit version does. That's actually a bit earlier than I'd
like, as it leaves the page RWX all the time the image is even *loaded*.

Subsequent commits will eliminate all the writes to the page between the
point it's marked executable in machine_kexec_prepare() the time that
relocate_kernel() is running and has switched to the identmap %cr3, so
that it can be ROX. But that can't happen until it's moved to the .data
section of the kernel, and *that* can't happen until we start executing
the copy instead of executing it in place in the kernel .text. So break
the circular dependency in those commits by letting it be RWX for now.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
arch/x86/kernel/machine_kexec_64.c
arch/x86/kernel/relocate_kernel_64.S