x86/decompressor: Call trampoline as a normal function
authorArd Biesheuvel <ardb@kernel.org>
Mon, 7 Aug 2023 16:27:06 +0000 (18:27 +0200)
committerBorislav Petkov (AMD) <bp@alien8.de>
Mon, 7 Aug 2023 18:43:13 +0000 (20:43 +0200)
commite8972a76aa90c05a0078043413f806c02fcb3487
tree453fbd3ffba69c6eaeeba14ddab97d9951d88e58
parent00c6b0978ec182f1a672095930872168b9d5b1e2
x86/decompressor: Call trampoline as a normal function

Move the long return to switch to 32-bit mode into the trampoline code
so it can be called as an ordinary function. This will allow it to be
called directly from C code in a subsequent patch.

While at it, reorganize the code somewhat to keep the prologue and
epilogue of the function together, making the code a bit easier to
follow. Also, given that the trampoline is now entered in 64-bit mode, a
simple RIP-relative reference can be used to take the address of the
exit point.

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-10-ardb@kernel.org
arch/x86/boot/compressed/head_64.S
arch/x86/boot/compressed/pgtable.h