linux-stable/arch/x86/realmode/rm
Kirill A. Shutemov c2cfc23f79 x86/trampoline: Bypass compat mode in trampoline_start64() if not needed
The trampoline_start64() vector is used when a secondary CPU starts in
64-bit mode. The current implementation directly enters compatibility
mode. It is necessary to disable paging and re-enable it in the correct
paging mode: either 4- or 5-level, depending on the configuration.

The X86S[1] ISA does not support compatibility mode in ring 0, and
paging cannot be disabled.

Rework the trampoline_start64() function to only enter compatibility
mode if it is necessary to change the paging mode. If the CPU is
already in the desired paging mode, proceed in long mode.

This allows a secondary CPU to boot on an X86S machine as long as the
CPU is already in the correct paging mode.

In the future, there will be a mechanism to switch between paging modes
without disabling paging.

[1] https://www.intel.com/content/www/us/en/developer/articles/technical/envisioning-future-simplified-architecture.html

[ dhansen: changelog tweaks ]

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Reviewed-by: Andi Kleen <ak@linux.intel.com>
Reviewed-by: Kai Huang <kai.huang@intel.com>
Link: https://lore.kernel.org/all/20240126100101.689090-1-kirill.shutemov%40linux.intel.com
2024-02-23 08:40:29 -08:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
Makefile x86: kmsan: disable instrumentation of unsupported code 2022-10-03 14:03:24 -07:00
bioscall.S x86, realmode: flattened rm hierachy 2012-05-08 11:48:45 -07:00
copy.S x86, realmode: flattened rm hierachy 2012-05-08 11:48:45 -07:00
header.S x86/boot: Add a trampoline for booting APs via firmware handoff 2022-04-07 08:27:52 -07:00
realmode.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
realmode.lds.S x86/vmlinux: Drop unneeded linker script discard of .eh_frame 2020-02-25 14:51:29 +01:00
reboot.S x86/asm: Always set A (accessed) flag in GDT descriptors 2023-12-20 10:57:51 +01:00
regs.c x86, realmode: flattened rm hierachy 2012-05-08 11:48:45 -07:00
stack.S x86/asm/realmode: Use SYM_DATA_* instead of GLOBAL 2019-10-18 11:28:47 +02:00
trampoline_32.S x86/asm/32: Add ENDs to some functions and relabel with SYM_CODE_* 2019-10-18 11:58:33 +02:00
trampoline_64.S x86/trampoline: Bypass compat mode in trampoline_start64() if not needed 2024-02-23 08:40:29 -08:00
trampoline_common.S x86/boot: Add a trampoline for booting APs via firmware handoff 2022-04-07 08:27:52 -07:00
video-bios.c x86, realmode: flattened rm hierachy 2012-05-08 11:48:45 -07:00
video-mode.c x86, realmode: flattened rm hierachy 2012-05-08 11:48:45 -07:00
video-vesa.c x86, realmode: flattened rm hierachy 2012-05-08 11:48:45 -07:00
video-vga.c x86, realmode: flattened rm hierachy 2012-05-08 11:48:45 -07:00
wakemain.c x86/boot: Port I/O: Allow to hook up alternative helpers 2022-04-07 08:27:52 -07:00
wakeup.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
wakeup_asm.S x86/asm/64: Add ENDs to some functions and relabel with SYM_CODE_* 2019-10-18 11:58:16 +02:00