diff options
author | Ard Biesheuvel <ardb@kernel.org> | 2023-08-07 18:27:10 +0200 |
---|---|---|
committer | Borislav Petkov (AMD) <bp@alien8.de> | 2023-08-07 20:48:09 +0200 |
commit | f97b67a773cd84bd8b55c0a0ec32448a87fc56bb (patch) | |
tree | 962837b9038ab088edc420a4a2c3569a9d398575 /arch/parisc/lib | |
parent | 64ef578b6b6866bec012544416946533444036c8 (diff) | |
download | linux-stable-f97b67a773cd84bd8b55c0a0ec32448a87fc56bb.tar.gz linux-stable-f97b67a773cd84bd8b55c0a0ec32448a87fc56bb.tar.bz2 linux-stable-f97b67a773cd84bd8b55c0a0ec32448a87fc56bb.zip |
x86/decompressor: Only call the trampoline when changing paging levels
Since the current and desired number of paging levels are known when the
trampoline is being prepared, avoid calling the trampoline at all if it
is clear that calling it is not going to result in a change to the
number of paging levels.
Given that the CPU is already running in long mode, the PAE and LA57
settings are necessarily consistent with the currently active page
tables, and other fields in CR4 will be initialized by the startup code
in the kernel proper. So limit the manipulation of CR4 to toggling the
LA57 bit, which is the only thing that really needs doing at this point
in the boot. This also means that there is no need to pass the value of
l5_required to toggle_la57(), as it will not be called unless CR4.LA57
needs to toggle.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Acked-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Link: https://lore.kernel.org/r/20230807162720.545787-14-ardb@kernel.org
Diffstat (limited to 'arch/parisc/lib')
0 files changed, 0 insertions, 0 deletions