diff options
Diffstat (limited to 'arch/x86/include/asm/bootparam_utils.h')
-rw-r--r-- | arch/x86/include/asm/bootparam_utils.h | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/arch/x86/include/asm/bootparam_utils.h b/arch/x86/include/asm/bootparam_utils.h index 5b5e9cb774b5..653668d140f9 100644 --- a/arch/x86/include/asm/bootparam_utils.h +++ b/arch/x86/include/asm/bootparam_utils.h | |||
@@ -14,13 +14,29 @@ | |||
14 | * analysis of kexec-tools; if other broken bootloaders initialize a | 14 | * analysis of kexec-tools; if other broken bootloaders initialize a |
15 | * different set of fields we will need to figure out how to disambiguate. | 15 | * different set of fields we will need to figure out how to disambiguate. |
16 | * | 16 | * |
17 | * Note: efi_info is commonly left uninitialized, but that field has a | ||
18 | * private magic, so it is better to leave it unchanged. | ||
17 | */ | 19 | */ |
18 | static void sanitize_boot_params(struct boot_params *boot_params) | 20 | static void sanitize_boot_params(struct boot_params *boot_params) |
19 | { | 21 | { |
22 | /* | ||
23 | * IMPORTANT NOTE TO BOOTLOADER AUTHORS: do not simply clear | ||
24 | * this field. The purpose of this field is to guarantee | ||
25 | * compliance with the x86 boot spec located in | ||
26 | * Documentation/x86/boot.txt . That spec says that the | ||
27 | * *whole* structure should be cleared, after which only the | ||
28 | * portion defined by struct setup_header (boot_params->hdr) | ||
29 | * should be copied in. | ||
30 | * | ||
31 | * If you're having an issue because the sentinel is set, you | ||
32 | * need to change the whole structure to be cleared, not this | ||
33 | * (or any other) individual field, or you will soon have | ||
34 | * problems again. | ||
35 | */ | ||
20 | if (boot_params->sentinel) { | 36 | if (boot_params->sentinel) { |
21 | /*fields in boot_params are not valid, clear them */ | 37 | /* fields in boot_params are left uninitialized, clear them */ |
22 | memset(&boot_params->olpc_ofw_header, 0, | 38 | memset(&boot_params->olpc_ofw_header, 0, |
23 | (char *)&boot_params->alt_mem_k - | 39 | (char *)&boot_params->efi_info - |
24 | (char *)&boot_params->olpc_ofw_header); | 40 | (char *)&boot_params->olpc_ofw_header); |
25 | memset(&boot_params->kbd_status, 0, | 41 | memset(&boot_params->kbd_status, 0, |
26 | (char *)&boot_params->hdr - | 42 | (char *)&boot_params->hdr - |