public inbox for kexec@lists.infradead.org
 help / color / mirror / Atom feed
From: Vivek Goyal <vgoyal@redhat.com>
To: Kexec Mailing List <kexec@lists.infradead.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Subject: [PATCH] kexec: x86: struct x86_linux_param_header should be packed
Date: Mon, 5 Aug 2013 13:35:11 -0400	[thread overview]
Message-ID: <20130805173510.GD2274@redhat.com> (raw)

I think struct x86_linux_param_header should be packed. Strange that we
did not do it so far. 

Without packing struct size was 3824 (decimal) on my x86_64 machine. With
packing it is 3820. I think there was a padding of 4 bytes at the end. So
it should be harmless.

I tried to introduce more fields and that introduced padding in the
middle of structure and kexec stopped working and that's how I got to
know that bootparam is not packed.

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
---
 include/x86/x86-linux.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: kexec-tools/include/x86/x86-linux.h
===================================================================
--- kexec-tools.orig/include/x86/x86-linux.h	2013-08-05 13:28:33.999338740 -0400
+++ kexec-tools/include/x86/x86-linux.h	2013-08-05 13:28:46.616475104 -0400
@@ -198,7 +198,7 @@ struct x86_linux_param_header {
 	struct 	edd_info eddbuf[EDDMAXNR];	/* 0xd00 */
 						/* 0xeec */
 #define COMMAND_LINE_SIZE 2048
-};
+} __attribute__ ((packed));
 
 struct x86_linux_faked_param_header {
 	struct x86_linux_param_header hdr;	/* 0x00 */

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

             reply	other threads:[~2013-08-05 17:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05 17:35 Vivek Goyal [this message]
2013-09-05  8:48 ` [PATCH] kexec: x86: struct x86_linux_param_header should be packed WANG Chao
2013-09-05  9:06   ` Zhang Yanfei
2013-09-05 14:11   ` Vivek Goyal

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=20130805173510.GD2274@redhat.com \
    --to=vgoyal@redhat.com \
    --cc=ebiederm@xmission.com \
    --cc=kexec@lists.infradead.org \
    /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