x86/slaunch: Implement secure launch for legacy boot via a callback
Implement secure launch (D-RTM) of the decompressed kernel via a
callback interface exposed by the Secure Launch Resource Table (SLRT), a
reference to which is added to struct boot_params.
This permits a bootloader to set up the secure launch, let the
decompressor execute up to the point where it would otherwise boot the
core kernel, and at that point, perform the secure launch in a
architecture/vendor specific manner. This is similar to how EFI boot
achieves this, using a EFI protocol exposed by the bootloader.
This requires that the decompressor unpacks the kernel into the buffer that
it was started from itself, and so physical KASLR needs to be omitted
(although the bootloader is free to place the decompressor at any
suitably aligned locations in system memory, and so it can perform the
physical randomization itself).
It also relies on the demand paging logic in the decompressor, to ensure
that the SLRT and the entry point it describes are callable, at least to
the extent that allows the callback code to re-establish its own
execution environment.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
7 files changed