Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tony Jones <tonyj@suse.de>
To: kexec@lists.infradead.org
Cc: Simon Horman <horms@verge.net.au>, dyoung@redhat.com
Subject: PATCH: kexec/i386: fix erroneous memory descriptor message
Date: Wed, 26 Mar 2014 21:54:03 -0700	[thread overview]
Message-ID: <5333AEEB.4090100@suse.de> (raw)

On non-EFI systems, efi_info section of boot_params is zero filled resulting 
in an erroneous message from kexec regarding "efi memory descriptor" version.

Caused by commit: e1ffc9e9a0769e1f54185003102e9bec428b84e8 "Passing efi related 
data via setup_data"

# od -j 448 -N 32 -v -x /sys/kernel/boot_params/data 
0000700 0000 0000 0000 0000 0000 0000 0000 0000
0000720 0000 0000 0000 0000 0000 0000 0000 0000
0000740

# kexec -l --reuse-cmdline --initrd=/boot/initrd-`uname -r` /boot/vmlinuz-`uname -r`
efi memory descriptor version 0 is not supported!

Signed-off-by: Tony Jones <tonyj@suse.de>

---
 kexec/arch/i386/x86-linux-setup.c |   14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

--- a/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec/arch/i386/x86-linux-setup.c
@@ -687,17 +687,25 @@ static void setup_efi_info(struct kexec_
 	ret = get_bootparam(&real_mode->efi_info, offset, 32);
 	if (ret)
 		return;
+	if (((struct efi_info *)real_mode->efi_info)->efi_memmap_size == 0)
+		/* zero filled efi_info */
+		goto out;
 	desc_version = get_efi_mem_desc_version(real_mode);
 	if (desc_version != 1) {
 		fprintf(stderr,
 			"efi memory descriptor version %d is not supported!\n",
 			desc_version);
-		memset(&real_mode->efi_info, 0, 32);
-		return;
+		goto out;
 	}
 	ret = setup_efi_data(info, real_mode);
 	if (ret)
-		memset(&real_mode->efi_info, 0, 32);
+		goto out;
+
+	return;
+
+out:
+	memset(&real_mode->efi_info, 0, 32);
+	return;
 }
 
 void setup_linux_system_parameters(struct kexec_info *info,

_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

             reply	other threads:[~2014-03-27  4:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-27  4:54 Tony Jones [this message]
2014-03-27  5:47 ` PATCH: kexec/i386: fix erroneous memory descriptor message Dave Young
2014-03-28 16:44   ` Simon Horman

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=5333AEEB.4090100@suse.de \
    --to=tonyj@suse.de \
    --cc=dyoung@redhat.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.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