All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cedric Le Goater <clg@fr.ibm.com>
To: Laurent Dufour <ldufour@linux.vnet.ibm.com>, kexec@lists.infradead.org
Cc: horms@verge.net.au
Subject: Re: [PATCH 3/7] ppc64: detect zImage files and load the uncompressed vmlinux
Date: Mon, 12 May 2014 17:58:05 +0200	[thread overview]
Message-ID: <5370EF8D.3040604@fr.ibm.com> (raw)
In-Reply-To: <53709ABF.8060707@linux.vnet.ibm.com>

Hi Laurent,

[ ... ]

>> +int zImage_ppc64_unzip(struct mem_ehdr *ehdr, void **buf, int *len)
>> +{
>> +	struct mem_shdr *shdr;
>> +	void *vmlinuz_addr;
>> +	unsigned long vmlinuz_size;
>> +	unsigned int *vmlinux_sizep;
>> +
>> +	void *vmlinux_addr;
>> +	int vmlinux_size;
>> +
>> +	shdr = elf_rel_find_section(ehdr, ".kernel:vmlinux.strip");
>> +	if (!shdr)
>> +		return -1;
>> +
>> +	vmlinuz_addr = (void *) shdr->sh_data;
>> +	vmlinuz_size = shdr->sh_size;
>> +
>> +	 /* The size of the uncompressed file is stored in the last 4
>> +	  * bytes. The vmlinux size should be less than 4G ... */
>> +	vmlinux_sizep = (vmlinuz_addr + vmlinuz_size) - 4;
>> +
>> +	fprintf(stderr, "Found vmlinuz at %p, unzipping %d bytes\n",
>> +		vmlinuz_addr, *vmlinux_sizep);
> 
> Hi Cédric,
> 
> I'd rather use dbgprintf instead of directly call fprintf here.

Sure. Thanks for the review. I have a new version of this patch which 
also fixes the way the uncompressed size is read, as it is stored as 
a little endian uint.

Simon, do you want a resend of the patchset or a fix on top of it ? 

Cheers, 

C.


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

  reply	other threads:[~2014-05-12 15:58 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-18 14:08 [PATCH 0/7] ppc64: little endian zImage support Cédric Le Goater
2014-04-18 14:08 ` [PATCH 1/7] kexec: add a elf_rel_find_section service Cédric Le Goater
2014-04-18 14:08 ` [PATCH 2/7] kexec: bypass check on interp program header for ppc64le zImage Cédric Le Goater
2014-04-18 14:08 ` [PATCH 3/7] ppc64: detect zImage files and load the uncompressed vmlinux Cédric Le Goater
2014-05-12  9:56   ` Laurent Dufour
2014-05-12 15:58     ` Cedric Le Goater [this message]
2014-04-18 14:08 ` [PATCH 4/7] ppc64, cleanup: cmdline_len variables are unused Cédric Le Goater
2014-04-18 14:08 ` [PATCH 5/7] ppc64, cleanup: remove dead code in kexec-zImage-ppc64 Cédric Le Goater
2014-04-18 14:08 ` [PATCH 6/7] ppc64, cleanup: fix implicit declaration compile warnings Cédric Le Goater
2014-04-18 14:08 ` [PATCH 7/7] ppc64, cleanup: fix unused variable compile warning Cédric Le Goater

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=5370EF8D.3040604@fr.ibm.com \
    --to=clg@fr.ibm.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=ldufour@linux.vnet.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.