All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: Neil Horman <nhorman@redhat.com>,
	kexec@lists.infradead.org,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: Kexec command line length
Date: Fri, 25 Jan 2008 10:39:24 -0500	[thread overview]
Message-ID: <20080125153924.GA13287@redhat.com> (raw)
In-Reply-To: <20080125123558.GA5627@hmsreliant.think-freely.org>

On Fri, Jan 25, 2008 at 07:35:58AM -0500, Neil Horman wrote:
> On Tue, Jan 15, 2008 at 12:37:53PM -0500, Vivek Goyal wrote:
> > On Tue, Jan 15, 2008 at 12:09:50PM -0500, Neil Horman wrote:
> > > On Tue, Jan 15, 2008 at 10:27:10AM -0500, Vivek Goyal wrote:
> > > > On Mon, Jan 14, 2008 at 08:43:03AM -0500, Neil Horman wrote:
> > > > > Hey all-
> > > > > 	Regarding this bug:
> > > > > 	http://bugzilla.kernel.org/show_bug.cgi?id=9641
> > > > > 	I'd like to look into putting together a patch for it, and wanted to
> > > > > solicit comments for the best way to go about doing it.  Currently I've got it
> > > > > fixed up in the Red Hat tree by bumping COMMAND_LINE_SIZE to 2048 and
> > > > > eliminating the reserved buffer of the x86_linux_faked_param_header, which works
> > > > > well, but isn't backwards compatible as Bernhard pointed out.  Given that extra
> > > > > constraint, I thought it woudl e best to unify the command line and reserved
> > > > > buffers in x86_linux_faked_param_header to one contiguour 2048 byte block and
> > > > > maintain a separate variable that defines the command line length based on a
> > > > > parsing of the UTS_VERSION.  Does that sound reasonable to everyone, or is there
> > > > > a better way that someone has in mind?
> > > > > 
> > > > 
> > > > Hi Neil,
> > > > 
> > > > Looking at UTS_VERSION and then deciding the command line length seems
> > > > ok. 
> > > > 
> > > > When I look at inclue/asm-x86/bootparam.h in kernel, area starting from
> > > > 0x2d0 to all the way up to 4K has been reserved for e820 maps and EDD buf.
> > > > 
> > > > Does that mean newer boot loaders are putting command line outside of 
> > > > 4K page and only putting the pointer to cmdline in 4K page. If that's the
> > > > case then we might have to do the same for kexec.
> > > > 
> > > 
> > > That would seem to be the case yes, although it appears the kernel still
> > > supports the old boot protocol if you want to restrict the command line length
> > > to the old 256 chars (see copy_boot_data)
> > > 
> > 
> > If that's the case then we probably should not be merging command_line
> > and reserved area. Instead we might have to put command line somewhere
> > else and pass the pointer to it in param page. If command line is with-in
> > 256, then we can continue to pass it in param page. 
> > 
> Actually, Vivek, I take back what I said (at least in part).  Looking at the
> kernel side of this, it seems that the traditional COMMAND_LINE_SIZE has been
> extended as well to 2048 bytes for i386/x86_64.  So unless I'm mistaken (and I
> may be), it looks like we can either:
> 
> a) use the new protocol
> OR
> b) just gobble up the no-longer-existing reserved area which is now used fully
> for command line 
> 
> Clearly the ability to do both would be good, but it would seem my earlier,
> simple approach is workable.  Thoughts?
> 
Hi Neil,

I had a closer look at the code and following are my thoughts.

If I look at the 2.6.24 x86 boot code, I think this code does not expect a
boot loader to put 2048 size command line in 4K page (so called zero page).
I think what it expects is that a boot loader puts command line somewhere
outside the zero page and just pass the pointer to that command line in zero
page.

So far kexec has been putting command line in zero page. I think it worked
because command line was small (256) and zero page had lots of free
reserved area. (E820MAX was 32). 

Now in latest kernel code E820MAX has been increased to 128 and I don't see
lot of free space in bootparam where we can put the 2048 size command line.

If we just continue to do what we are doing and just extend the command
line size to 2048 in kexec-tools, i think this will overlap with some other
area, either with EDD or E820 map etc and real mode code will overwrite part
of command line as passed by kexec, on some systems.

So I think we should modify kexec-tools and start putting the 2048
size command line outside the setup/zero page.

CCing HPA and Eric. They should be able to guide us better.

Thanks
Vivek

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

  reply	other threads:[~2008-01-25 15:39 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 [this message]
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
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=20080125153924.GA13287@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --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.