linux/drivers/firmware
Ard Biesheuvel cd0d9d92c8 x86/boot: Move mem_encrypt= parsing to the decompressor
The early SME/SEV code parses the command line very early, in order to
decide whether or not memory encryption should be enabled, which needs
to occur even before the initial page tables are created.

This is problematic for a number of reasons:
- this early code runs from the 1:1 mapping provided by the decompressor
  or firmware, which uses a different translation than the one assumed by
  the linker, and so the code needs to be built in a special way;
- parsing external input while the entire kernel image is still mapped
  writable is a bad idea in general, and really does not belong in
  security minded code;
- the current code ignores the built-in command line entirely (although
  this appears to be the case for the entire decompressor)

Given that the decompressor/EFI stub is an intrinsic part of the x86
bootable kernel image, move the command line parsing there and out of
the core kernel. This removes the need to build lib/cmdline.o in a
special way, or to use RIP-relative LEA instructions in inline asm
blocks.

This involves a new xloadflag in the setup header to indicate
that mem_encrypt=on appeared on the kernel command line.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Tested-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://lore.kernel.org/r/20240227151907.387873-17-ardb+git@google.com
2024-03-04 18:12:28 +01:00
..
arm_ffa firmware: arm_ffa: Handle partitions setup failures 2024-01-22 10:07:12 +00:00
arm_scmi firmware: arm_scmi: Fix the clock protocol supported version 2024-01-22 10:01:17 +00:00
broadcom MIPS: BCM47XX: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:51 -07:00
cirrus firmware: cirrus: cs_dsp: Only log list of algorithms in debug build 2023-09-13 18:50:32 +01:00
efi x86/boot: Move mem_encrypt= parsing to the decompressor 2024-03-04 18:12:28 +01:00
google firmware: coreboot_table: Convert to platform remove callback returning void 2024-01-04 17:01:14 +01:00
imx firmware: imx-dsp: Convert to platform remove callback returning void 2024-01-04 17:01:14 +01:00
meson firmware: meson-sm: unmap out_base shmem in error path 2023-11-27 09:17:51 +01:00
microchip firmware: microchip: fix wrong sizeof argument 2024-01-29 18:52:11 +00:00
psci firmware/psci: demote suspend-mode warning to info level 2023-04-14 13:48:56 +02:00
qcom firmware: qcom: qseecom: fix memory leaks in error paths 2023-12-18 21:14:58 -06:00
smccc firmware: smccc: Fix use of uninitialised results structure 2023-07-18 10:08:05 +01:00
tegra SoC driver updates for 6.7 2023-11-01 14:46:51 -10:00
xilinx firmware: xilinx: Export function to use in other module 2024-01-04 17:02:49 +01:00
arm_scpi.c firmware: arm_scpi: Convert to platform remove callback returning void 2024-01-04 17:01:14 +01:00
arm_sdei.c arm64: sdei: abort running SDEI handlers during crash 2023-08-04 17:35:33 +01:00
dmi_scan.c firmware: dmi: Fortify entry point length checks 2022-09-23 14:53:14 +02:00
dmi-id.c driver core: make struct class.dev_uevent() take a const * 2022-11-24 17:12:15 +01:00
dmi-sysfs.c firmware: dmi-sysfs: handle HAS_IOPORT=n 2023-05-31 19:17:29 +01:00
edd.c edd: make kobj_type structure constant 2023-03-09 18:07:33 +01:00
iscsi_ibft_find.c iscsi_ibft: Fix finding the iBFT under Xen Dom 0 2023-06-26 07:47:11 +02:00
iscsi_ibft.c iscsi_ibft: Fix isa_bus_to_virt not working under ARM 2021-09-02 16:22:00 -04:00
Kconfig Core: 2024-01-12 13:54:25 -08:00
Makefile Core: 2024-01-12 13:54:25 -08:00
memmap.c firmware: memmap: use default_groups in kobj_type 2022-01-05 19:17:29 +01:00
mtk-adsp-ipc.c firmware: mtk-adsp-ipc: Convert to platform remove callback returning void 2024-01-04 17:01:14 +01:00
qemu_fw_cfg.c firmware: qemu_fw_cfg: Convert to platform remove callback returning void 2024-01-04 17:01:15 +01:00
raspberrypi.c firmware: raspberrypi: Convert to platform remove callback returning void 2024-01-04 17:01:15 +01:00
stratix10-rsu.c firmware: stratix10-rsu: Convert to platform remove callback returning void 2024-01-04 17:01:15 +01:00
stratix10-svc.c firmware: stratix10-svc: Convert to platform remove callback returning void 2024-01-04 17:01:15 +01:00
sysfb_simplefb.c firmware/sysfb: Fix VESA format selection 2023-04-21 14:27:31 +02:00
sysfb.c Revert "drivers/firmware: Move sysfb_init() from device_initcall to subsys_initcall_sync" 2024-01-24 17:03:44 +01:00
ti_sci.c firmware: ti_sci: Fix an off-by-one in ti_sci_debugfs_create() 2023-11-24 12:49:08 -06:00
ti_sci.h
trusted_foundations.c
turris-mox-rwtm.c firmware: turris-mox-rwtm: Convert to platform remove callback returning void 2024-01-04 17:01:15 +01:00