Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Young <dyoung@redhat.com>
To: horms@verge.net.au
Cc: kexec@lists.infradead.org
Subject: [PATCH 0/2] kernel probe function fixes
Date: Thu,  6 Feb 2014 14:30:42 +0800	[thread overview]
Message-ID: <1391668244-13631-1-git-send-email-dyoung@redhat.com> (raw)

During my testing for arm zImage, in 2nd kernel the atags pointer and the
machine_id are not valid, I did a lot of debugging in kernel, finally I found
this is caused by a kexec tools bug instead.

It is a regression since bf06cf2095. It changes uImage probe return values as
below:
 *  0		- valid uImage type
 * -1           - If the image is corrupted.
 *  1           - If the image is not a uImage.

Because uImage will be probed before zImage, but the uImage probe return 1 for
a zImage thus kexec will mistakenly think it is ok to use as uImage.

IMHO, return -1 in case it's not an uImage is better instead of 1 like before
It's not really necessary to introduce a new return value. It might be better
for a new patch to return either 0 or -1 for uImage probe.

But I did not fix the uImage return value yet. In this patchset I did below:
 - ppc64 zImage: return 0 instead of 1 in case of success
 - strictly checking if probe return 0 in kexec.c

Tested arm zImage with use_atags only.

Dave Young (2):
  zImage_ppc64_probe: return 0 instead of 1 in case of success
  kernel image probe function return value checking fix

 kexec/arch/ppc64/kexec-zImage-ppc64.c | 5 ++++-
 kexec/kexec.c                         | 2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

-- 
1.8.3.1


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

             reply	other threads:[~2014-02-06  6:30 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06  6:30 Dave Young [this message]
2014-02-06  6:30 ` [PATCH 1/2] zImage_ppc64_probe: return 0 instead of 1 in case of success Dave Young
2014-02-06  7:30   ` Simon Horman
2014-02-06  6:30 ` [PATCH 2/2] kernel image probe function return value checking fix Dave Young
2014-02-06  7:30   ` 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=1391668244-13631-1-git-send-email-dyoung@redhat.com \
    --to=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