linux/arch/x86/realmode
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
..
rm x86/trampoline: Bypass compat mode in trampoline_start64() if not needed 2024-02-23 08:40:29 -08:00
init.c arch/x86: Fix typos 2024-01-03 11:46:22 +01:00
Makefile x86, objtool: Dont exclude arch/x86/realmode/ 2021-05-12 14:54:54 +02:00
rmpiggy.S x86/asm/realmode: Use SYM_DATA_* instead of GLOBAL 2019-10-18 11:28:47 +02:00