All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Neil Horman <nhorman@redhat.com>
Cc: horms@verge.net.au, kexec@lists.infradead.org,
	Neil Horman <nhorman@tuxdriver.com>
Subject: Re: Kexec command line length
Date: Wed, 30 Jan 2008 16:45:51 -0500	[thread overview]
Message-ID: <20080130214551.GC15415@redhat.com> (raw)
In-Reply-To: <20080130211834.GC5660@hmsendeavour.rdu.redhat.com>

On Wed, Jan 30, 2008 at 04:18:34PM -0500, Neil Horman wrote:
> On Wed, Jan 30, 2008 at 04:08:15PM -0500, Vivek Goyal wrote:
> > On Wed, Jan 30, 2008 at 03:59:47PM -0500, Neil Horman wrote:
> > > On Wed, Jan 30, 2008 at 03:53:23PM -0500, Vivek Goyal wrote:
> > > > On Tue, Jan 29, 2008 at 02:57:53PM -0500, Neil Horman wrote:
> > > > > 
> > > > > Ok, I've got a new patch here.  In response to Bernhard and Viveks concerns,
> > > > > I've added a few checks.  Bernhard, thank you for digging into the history of
> > > > > the addition of the 2048 byte command line.  As I understand what you've posted
> > > > > heres what we need to capture:
> > > > > 
> > > > > On X86:
> > > > > 	Boot loader version >= 2.06
> > > > > 		error if cmdline_len > setup_header.cmdline_size
> > > > > 	2.05 > Boot loader version > 2.06
> > > > > 		warn if cmdline_len > 255
> > > > > 	Boot loader version < 2.05
> > > > > 		error if cmdline_len > 255
> > > > > 
> > > > > on X86_64:
> > > > > 	Boot loader version >= 2.04
> > > > > 		error if cmdline_len > setup_header.cmdline_size
> > > > 
> > > > cmdline_size was introduced only in version 2.06. So this will run
> > > > into trouble on x86_64 version 2.04 and 2.05, isn't it?
> > > > 
> > > Then how did version 2.04 on x86_64 determine its maximum command line length?
> > > Or did it just assume a max length of 2048 bytes?
> > 
> > I think it just did not tell. There was no way for a kernel bzImage to
> > tell boot-loader what's the supported command line size is (Pre 2.06).
> > 
> So, for 2.04 on x86_64, we should just assume a 2048 byte command line length
> then?
> 

No. 2.04 is really old. As per boot.txt, it was introduced in 2.6.14.

Anyway, thinking about it more, Large command lines were introduced in
2.6.21 kernel (for both i386 and x86_64). cmdline_size was introduced
in 2.6.22 (for both i386 and x86_64). So how about following test
condition for both the arch.

if (boot_protocol >= 2.06)
	error message based on cmdline_size field
else
	Warn user if command line is more than 256 but continue to work.
  	Let the user know that it is not known if kernel being loaded
	supports command line size greater than 256. Command line will
	be truncated by destination kernel if it does not support large
	command lines. User is taking a chance

I think above will work both for i386 and x86_64. This is not precise
message. If we want to do better, then we shall have to rely on linux
version string. But If somebody is building custom kernel with their
own versioning, then we will run into issues. So I think, for the time
being we are good with above simple condition.

Thanks
Vivek

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

  reply	other threads:[~2008-01-30 21:46 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-14 13:43 Kexec command line length Neil Horman
2008-01-14 14:50 ` Bernhard Walle
2008-01-14 15:40   ` Neil Horman
2008-01-15 15:27 ` Vivek Goyal
2008-01-15 17:09   ` Neil Horman
2008-01-15 17:37     ` Vivek Goyal
2008-01-25 12:35       ` Neil Horman
2008-01-25 15:39         ` Vivek Goyal
2008-01-25 15:44           ` H. Peter Anvin
2008-01-25 19:50             ` Neil Horman
2008-01-25 19:54               ` H. Peter Anvin
2008-01-25 20:11                 ` Neil Horman
2008-01-25 20:13               ` Vivek Goyal
2008-01-25 20:54                 ` Neil Horman
2008-01-28 17:08                   ` Neil Horman
2008-01-28 19:37                     ` Vivek Goyal
2008-01-28 20:07                       ` Neil Horman
2008-01-28 20:20                         ` Vivek Goyal
2008-01-28 20:53                           ` Neil Horman
2008-01-28 21:09                             ` Vivek Goyal
2008-01-28 21:29                             ` Bernhard Walle
2008-01-29  1:01                               ` Neil Horman
2008-01-29 15:41                                 ` Vivek Goyal
2008-01-29 18:17                                   ` Bernhard Walle
2008-01-29 18:52                                     ` Neil Horman
2008-01-29 19:57                                     ` Neil Horman
2008-01-30 20:53                                       ` Vivek Goyal
2008-01-30 20:59                                         ` Neil Horman
2008-01-30 21:08                                           ` Vivek Goyal
2008-01-30 21:18                                             ` Neil Horman
2008-01-30 21:45                                               ` Vivek Goyal [this message]
2008-01-31  0:10                                                 ` Neil Horman
2008-01-31  7:16                                                 ` Bernhard Walle
2008-02-12 21:11                                                   ` Neil Horman
2008-02-18  3:14                                                     ` 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=20080130214551.GC15415@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.org \
    --cc=nhorman@redhat.com \
    --cc=nhorman@tuxdriver.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.