Kexec Archive on 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: Mon, 28 Jan 2008 14:37:41 -0500	[thread overview]
Message-ID: <20080128193741.GB32765@redhat.com> (raw)
In-Reply-To: <20080128170811.GA1174@hmsreliant.think-freely.org>

On Mon, Jan 28, 2008 at 12:08:11PM -0500, Neil Horman wrote:
> Patch to clean up kexec-tools command line encoding.  It does four things:
> 
> 1) Move the command line out of the zero page, as per Viveks suggestion.  New
> padding scheme places the command line starting at 4096 bytes
> 
> 2) Increase command line length to support maximum size of 2048 bytes
> 
> 3) Pull in new variables from the latest kernels struct setup_header
> 
> 4) Where appropriate (currently only in bzImage_load) check the cmdline_size in
> setup header to ensure that cmdline_size isn't being violated
> 
> Tested by me, with successful results.
> 
> Regards
> Neil
> 
> Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> 

Hi Neil,

Patch looks good. Some minor nits follow.

> 
>  include/x86/x86-linux.h         |   19 +++++++++++++------
>  kexec/arch/i386/kexec-bzImage.c |    7 +++++++
>  2 files changed, 20 insertions(+), 6 deletions(-)
> 
> 
> diff --git a/include/x86/x86-linux.h b/include/x86/x86-linux.h
> index afe66bd..0794fe0 100644
> --- a/include/x86/x86-linux.h
> +++ b/include/x86/x86-linux.h
> @@ -144,18 +144,22 @@ struct x86_linux_param_header {
>  	/* 2.04+ */
>  	uint32_t kernel_alignment;		/* 0x230 */
>  	uint8_t  relocatable_kernel;		/* 0x234 */
> -	uint8_t  reserved15[0x2d0 - 0x235];	/* 0x230 */
> +	uint8_t  reserved15[3];			/* 0x237 */
> +	uint32_t cmdline_size;			/* 0x23B */
> +	uint32_t hardware_subarch;		/* 0x23F */
> +	uint64_t hardware_subarch_data;		/* 0x247 */

In general convetion for /* xxx */ seems to be that xxx represents the
offset where that data structure starts. We might want to maintain that.

> +	uint8_t  reserved16[0x2d0 - 0x248];	/* 0x248 */
>  #endif
>  	struct e820entry e820_map[E820MAX];	/* 0x2d0 */
>  						/* 0x550 */
> -#define COMMAND_LINE_SIZE 256
> +#define COMMAND_LINE_SIZE 2048 
>  };
>  
>  struct x86_linux_faked_param_header {
>  	struct x86_linux_param_header hdr;	/* 0x00 */
> -	uint8_t reserved16[688];		/* 0x550 */
> -	uint8_t command_line[COMMAND_LINE_SIZE]; /* 0x800 */
> -	uint8_t reserved17[1792];		/* 0x900 - 0x1000 */
> +	uint8_t reserved16[0xab0];		/* 0x550 */

reserved16 is now already used up in x86_linux_param_header. We might
want to bump up the reservation number here.

Ideally I would have liked to put all the 4K page in
x86_linux_param_header and replace that definition with struct bootparam.
But I think thats' fine for the time being. We might want to do that in 
future as reading and mapping the code to kernel boot protocol becomes
easy.

Thanks
Vivek

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

  reply	other threads:[~2008-01-28 19:37 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 [this message]
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=20080128193741.GB32765@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox