From: Ian Campbell <ian.campbell@citrix.com>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH v5 2/2] xen/arm: support gzip compressed kernels
Date: Mon, 14 Sep 2015 10:05:50 +0100 [thread overview]
Message-ID: <1442221550.3549.102.camel@citrix.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1509111717240.2672@kaball.uk.xensource.com>
On Fri, 2015-09-11 at 17:20 +0100, Stefano Stabellini wrote:
>
> > > +
> > > + return 0;
> > > +}
> > > +
> > > #ifdef CONFIG_ARM_64
> > > /*
> > > * Check if the image is a 64-bit Image.
> > > @@ -463,6 +522,22 @@ int kernel_probe(struct kernel_info *info)
> > > printk("Loading ramdisk from boot module @ %"PRIpaddr"\n",
> > > info->initrd_bootmodule->start);
> > >
> > > + /* if it is a gzip'ed image, 32bit or 64bit, uncompress it */
> > > + rc = kernel_decompress(info, &start, &size);
> > > + if (rc < 0 && rc != -EINVAL)
> >
> > IMHO kernel_decompress should return success when the decompress is a
> > nop
> > (as represented by EINVAL here) and an error only when the thing needs
> > to
> > be decompressed but cannot be.
>
> That mean collapsing the "nothing to do" and the "decompression
> successful" cases into a single return value, which I think is not a
> good idea. We would be losing information compared to what we have now.
We aren't making any use of that information though, and nor is there any
real reason to do so in the caller.
If you care are about the distinction between "not compressed" and
"successfully decompressed" then logging "Successfully decompressed kernel"
at the end of kernel_decompress would be far more useful than returning
some errno instead of 0.
The more important bit to me though is to move the update of mod
->{size,start} and the freeing of the old memory into the decompress
function, such that it is called and returns in a completely consistent
state, rather than returning in an inconsistent state and requiring the
caller to fix it up.
Ian.
prev parent reply other threads:[~2015-09-14 9:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-07 14:22 [PATCH v5 0/2] support gzipped kernels on arm Stefano Stabellini
2015-09-07 14:25 ` [PATCH v5 1/2] xen: move perform_gunzip to common Stefano Stabellini
2015-09-07 14:25 ` [PATCH v5 2/2] xen/arm: support gzip compressed kernels Stefano Stabellini
2015-09-08 13:35 ` Ian Campbell
2015-09-08 13:42 ` Jan Beulich
2015-09-11 16:20 ` Stefano Stabellini
2015-09-14 9:05 ` Ian Campbell [this message]
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=1442221550.3549.102.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=stefano.stabellini@eu.citrix.com \
--cc=xen-devel@lists.xensource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).