mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Jones <pjones@redhat.com>
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: linux-kernel@vger.kernel.org, Peter Jones <pjones@redhat.com>
Subject: [PATCH] Be explicit about what the x86 0x020c boot parameter version requires.
Date: Wed,  6 Mar 2013 13:00:23 -0500	[thread overview]
Message-ID: <1362592823-28967-1-git-send-email-pjones@redhat.com> (raw)
In-Reply-To: <51377C3A.3030301@zytor.com>

This should help avoid making the incorrect change in non-compliant
bootloaders.

Signed-off-by: Peter Jones <pjones@redhat.com>
---
 Documentation/x86/boot.txt             | 5 +++--
 arch/x86/include/asm/bootparam_utils.h | 7 +++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Documentation/x86/boot.txt b/Documentation/x86/boot.txt
index 3840b6f..72702db 100644
--- a/Documentation/x86/boot.txt
+++ b/Documentation/x86/boot.txt
@@ -1110,7 +1110,8 @@ firmware, 'table' is the EFI system table - these are the first two
 arguments of the "handoff state" as described in section 2.3 of the
 UEFI specification. 'bp' is the boot loader-allocated boot params.
 
-The boot loader *must* fill out the following fields in bp,
+The boot loader *must* zero the entirity of bp, and then fill out the
+following fields:
 
     o hdr.code32_start
     o hdr.cmd_line_ptr
@@ -1118,4 +1119,4 @@ The boot loader *must* fill out the following fields in bp,
     o hdr.ramdisk_image (if applicable)
     o hdr.ramdisk_size  (if applicable)
 
-All other fields should be zero.
+All other fields should remain zero.
diff --git a/arch/x86/include/asm/bootparam_utils.h b/arch/x86/include/asm/bootparam_utils.h
index 5b5e9cb..b4e8aa8 100644
--- a/arch/x86/include/asm/bootparam_utils.h
+++ b/arch/x86/include/asm/bootparam_utils.h
@@ -17,6 +17,13 @@
  */
 static void sanitize_boot_params(struct boot_params *boot_params)
 {
+	/* Note: do not simply clear this field.  The purpose of this field is
+	 * to guarantee compliance with the x86 boot spec located in
+	 * Documentation/x86/boot.txt .  That spec says that the *whole*
+	 * structure should be cleared.  If you're having an issue because
+	 * the sentinel is set, you need to change the whole structure to be
+	 * cleared, not this (or any other) indidivual field.
+	 */
 	if (boot_params->sentinel) {
 		/*fields in boot_params are not valid, clear them */
 		memset(&boot_params->olpc_ofw_header, 0,
-- 
1.8.1.4


  parent reply	other threads:[~2013-03-06 18:00 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28 20:52 Revert commit 5dcd14ecd4 - breaks EFI boot with SLES11 elilo.efi Robin Holt
2013-02-28 21:05 ` H. Peter Anvin
2013-02-28 21:09   ` Robin Holt
2013-02-28 21:12     ` H. Peter Anvin
2013-02-28 23:02       ` Yinghai Lu
2013-02-28 23:09         ` H. Peter Anvin
2013-03-05  8:15           ` Robin Holt
2013-03-05 15:22             ` H. Peter Anvin
2013-03-05 19:12               ` Yinghai Lu
2013-03-05 19:52                 ` Robin Holt
2013-03-05 20:14                   ` Yinghai Lu
2013-03-05 20:22                     ` Robin Holt
2013-03-06 16:53                 ` Josh Boyer
2013-03-06 17:26                   ` H. Peter Anvin
2013-03-06 17:36                     ` Josh Boyer
2013-03-06 17:37                       ` H. Peter Anvin
2013-03-06 20:40                         ` Josh Boyer
2013-03-06 20:43                           ` H. Peter Anvin
2013-03-07  4:53                       ` [tip:x86/urgent] x86: Don' t clear efi_info even if the sentinel hits tip-bot for Josh Boyer
2013-03-06 18:00                     ` Peter Jones [this message]
2013-03-07  4:31                       ` [PATCH] Be explicit about what the x86 0x020c boot parameter version requires H. Peter Anvin
2013-03-07  8:39                         ` Matt Fleming
2013-03-07  4:54                       ` [tip:x86/urgent] x86, doc: Be explicit about what the x86 struct boot_params requires tip-bot for Peter Jones
2013-03-06 16:55       ` Revert commit 5dcd14ecd4 - breaks EFI boot with SLES11 elilo.efi Peter Jones
2013-03-06 17:14         ` H. Peter Anvin
2013-03-06 17:32           ` Peter Jones

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1362592823-28967-1-git-send-email-pjones@redhat.com \
    --to=pjones@redhat.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome