linux-stable/arch/x86/include/uapi/asm
Ard Biesheuvel 046545314c x86/boot: Move mem_encrypt= parsing to the decompressor
commit cd0d9d92c8 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-04-10 16:36:07 +02:00
..
Kbuild
a.out.h
amd_hsmp.h amd_hsmp: Add HSMP protocol version 5 messages 2022-04-27 21:45:44 +02:00
auxvec.h x86/elf: Support a new ELF aux vector AT_MINSIGSTKSZ 2021-05-19 12:18:45 +02:00
bitsperlong.h
boot.h
bootparam.h x86/boot: Move mem_encrypt= parsing to the decompressor 2024-04-10 16:36:07 +02:00
byteorder.h treewide: add "WITH Linux-syscall-note" to SPDX tag of uapi headers 2019-07-25 11:05:10 +02:00
debugreg.h x86/traps: Handle #DB for bus lock 2021-03-28 22:52:15 +02:00
e820.h
hw_breakpoint.h
hwcap2.h x86/elf: Use _BITUL() macro in UAPI headers 2021-05-21 11:12:52 +02:00
ist.h
kvm.h KVM: x86: Redefine 'longmode' as a flag for KVM_EXIT_HYPERCALL 2023-04-05 12:07:41 +01:00
kvm_para.h KVM: x86: Make sure KVM_CPUID_FEATURES really are KVM_CPUID_FEATURES 2021-11-11 10:56:21 -05:00
kvm_perf.h
ldt.h
mce.h x86/mce: Drop bogus comment about mce.kflags 2020-04-17 11:12:21 +02:00
mman.h x86: Remove the arch_calc_vm_prot_bits() macro from the UAPI 2023-09-06 23:50:46 +02:00
msgbuf.h x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
msr.h
mtrr.h x86/mtrr: Don't let mtrr_type_lookup() return MTRR_TYPE_INVALID 2023-06-01 15:04:33 +02:00
perf_regs.h
posix_types.h
posix_types_32.h
posix_types_64.h
posix_types_x32.h
prctl.h x86/shstk: Add ARCH_SHSTK_STATUS 2023-08-02 15:01:51 -07:00
processor-flags.h x86: CPUID and CR3/CR4 flags for Linear Address Masking 2023-03-16 13:08:39 -07:00
ptrace-abi.h
ptrace.h
sembuf.h arch: sembuf.h: make uapi asm/sembuf.h self-contained 2019-12-04 19:44:14 -08:00
setup.h
sgx.h x86/sgx: Support complete page removal 2022-07-07 10:13:03 -07:00
shmbuf.h shmbuf.h: add asm/shmbuf.h to UAPI compile-test coverage 2022-02-17 09:09:37 +01:00
sigcontext.h x86: Fix various typos in comments 2021-03-18 15:31:53 +01:00
sigcontext32.h treewide: add "WITH Linux-syscall-note" to SPDX tag of uapi headers 2019-07-25 11:05:10 +02:00
siginfo.h
signal.h signal.h: add linux/signal.h and asm/signal.h to UAPI compile-test coverage 2022-02-17 09:09:36 +01:00
stat.h
statfs.h
svm.h x86/sev: Add SEV-SNP guest feature negotiation support 2023-01-19 17:29:58 +01:00
swab.h
ucontext.h
unistd.h x86/syscalls: Revert "x86/syscalls: Make __X32_SYSCALL_BIT be unsigned long" 2020-05-26 16:42:43 +02:00
vm86.h x86/vm86/32: Remove VM86_SCREEN_BITMAP support 2021-01-21 20:08:53 +01:00
vmx.h KVM: VMX: Enable Notify VM exit 2022-06-08 05:56:24 -04:00
vsyscall.h