]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/kexec: Allocate PGD for x86_64 transition page tables separately
authorDavid Woodhouse <dwmw@amazon.co.uk>
Sun, 24 Nov 2024 10:05:37 +0000 (10:05 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Thu, 5 Dec 2024 15:00:32 +0000 (15:00 +0000)
commit20f977c59ff054c7767730d48a82d8ea12c6122b
tree007c89c31ea3d407ec8795c5f108a4df52fd8fb6
parentb3f8fd05b382f15bbc468d6391de8872ae15e19f
x86/kexec: Allocate PGD for x86_64 transition page tables separately

Now that commit d0ceea662d45 ("x86/mm: Add _PAGE_NOPTISHADOW bit to
avoid updating userspace page tables") stops kernel_ident_mapping_init()
from scribbling over the end of a 4KiB PGD by assuming the following
4KiB will be a userspace PGD, there's no good reason for the kexec PGD
to be part of a single 8KiB allocation with the control_code_page.

(It's not clear that that was the reason for x86_64 kexec doing it that
way in the first place either; there were no comments to that effect and
it seems to have been the case even before PTI came along. It looks like
it was just a happy accident which prevented memory corruption on kexec.)

Either way, it definitely isn't needed now. Just allocate the PGD
separately on x86_64, like i386 already does.

Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
arch/x86/include/asm/kexec.h
arch/x86/kernel/machine_kexec_64.c