aboutsummaryrefslogtreecommitdiff
path: root/arch/x86/boot/compressed/early_serial_console.c
AgeCommit message (Collapse)AuthorFilesLines
2022-04-20x86/boot: Put globals that are accessed early into the .data sectionMichael Roth1-1/+2
The helpers in arch/x86/boot/compressed/efi.c might be used during early boot to access the EFI system/config tables, and in some cases these EFI helpers might attempt to print debug/error messages, before console_init() has been called. __putstr() checks some variables to avoid printing anything before the console has been initialized, but this isn't enough since those variables live in .bss, which may not have been cleared yet. This can lead to a triple-fault occurring, primarily when booting in legacy/CSM mode (where EFI helpers will attempt to print some debug messages). Fix this by declaring these globals in .data section instead so there is no dependency on .bss being cleared before accessing them. Fixes: c01fce9cef849 ("x86/compressed: Add SEV-SNP feature detection/setup") Reported-by: Borislav Petkov <[email protected]> Suggested-by: Thomas Lendacky <[email protected]> Signed-off-by: Michael Roth <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2014-08-17x86, boot: Don't compile early_serial_console.c when !CONFIG_EARLY_PRINTKJosh Triplett1-4/+0
All the code in early_serial_console.c gets compiled out if !CONFIG_EARLY_PRINTK, but early_serial_console.o itself still gets compiled in. Eliminate it from the compile entirely in that case. This does not change the generated code at all, in either case. Signed-off-by: Josh Triplett <[email protected]>
2012-07-21x86, boot: Exclude early_serial_console.c if can't use it.Joe Millenbach1-0/+4
Removes early_serial_console.c code if we don't have the config option that enables it (EARLY_PRINTK). When disabling this code, make early_serial_base a constant 0 to allow the compiler to optimize away the code that checks for early_serial_base. Signed-off-by: Joe Millenbach <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Gokul Caushik <[email protected]> Reviewed-by: Josh Triplett <[email protected]> Signed-off-by: H. Peter Anvin <[email protected]>
2010-08-02x86, setup: enable early console output from the decompressorYinghai Lu1-0/+5
This enables the decompressor output to be seen on the serial console. Most of the code is shared with the regular boot code. We could add printf to the decompressor if needed, but currently there is no sufficiently compelling user. -v2: define BOOT_BOOT_H to avoid include boot.h -v3: early_serial_base need to be static in misc.c ? -v4: create seperate string.c printf.c cmdline.c early_serial_console.c after hpa's patch that allow global variables in compressed/misc stage -v5: remove printf.c related Signed-off-by: Yinghai Lu <[email protected]> Signed-off-by: H. Peter Anvin <[email protected]>