]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - arch/x86/kernel/reboot.c
x86/mm: Flush global TLB when switching to trampoline page-table
authorJoerg Roedel <jroedel@suse.de>
Thu, 2 Dec 2021 15:32:25 +0000 (16:32 +0100)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 10:02:31 +0000 (11:02 +0100)
commit0bd1962d634c405018d78923325dc008bab2222a
treef761fefcffa4fb9001770246ecb26ed7e1135a43
parentbfc1306e8628410adc459233c1a5fcb78ca3392f
x86/mm: Flush global TLB when switching to trampoline page-table

BugLink: https://bugs.launchpad.net/bugs/1959376
[ Upstream commit 71d5049b053876afbde6c3273250b76935494ab2 ]

Move the switching code into a function so that it can be re-used and
add a global TLB flush. This makes sure that usage of memory which is
not mapped in the trampoline page-table is reliably caught.

Also move the clearing of CR4.PCIDE before the CR3 switch because the
cr4_clear_bits() function will access data not mapped into the
trampoline page-table.

Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Link: https://lore.kernel.org/r/20211202153226.22946-4-joro@8bytes.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/x86/include/asm/realmode.h
arch/x86/kernel/reboot.c
arch/x86/realmode/init.c