public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Andrew Morton <akpm@osdl.org>
Cc: Ricky Beam <jfbeam@bluetronic.net>,
	lkml - Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andi Kleen <ak@muc.de>,
	rth@twiddle.net
Subject: Re: __setup()'s not processed in bk-current
Date: Tue, 29 Jun 2004 12:43:41 +1000	[thread overview]
Message-ID: <1088477020.10622.82.camel@bach> (raw)
In-Reply-To: <20040628165707.328cce15.akpm@osdl.org>

On Tue, 2004-06-29 at 09:57, Andrew Morton wrote:
> We're now putting 24-byte structures into .init.setup via __setup.  But
> x86_64's compiler is emitting a `.align 16' in there, so they end up on
> 32-byte boundaries and do_early_param()'s pointer arithmetic goes wrong.
> 
> Fix that up by forcing the compiler to align these structures to sizeof(long).

Um, that's really odd, and at least deserves a comment.

There are a number of places where we assume that we can iterate through
all entries in a section as an array, rth would know if we've just been
lucky...

Thanks,
Rusty.

> diff -puN include/linux/init.h~x86_64-setup-section-alignment-fix include/linux/init.h
> --- 25/include/linux/init.h~x86_64-setup-section-alignment-fix	2004-06-28 16:47:41.000000000 -0700
> +++ 25-akpm/include/linux/init.h	2004-06-28 16:47:41.000000000 -0700
> @@ -119,6 +119,7 @@ struct obs_kernel_param {
>  	static struct obs_kernel_param __setup_##unique_id	\
>  		 __attribute_used__				\
>  		 __attribute__((__section__(".init.setup")))	\
> +		__attribute__((aligned((sizeof(long)))))	\
>  		= { __setup_str_##unique_id, fn, early }
>  
>  #define __setup_null_param(str, unique_id)			\
> 
> _
-- 
Anyone who quotes me in their signature is an idiot -- Rusty Russell


  reply	other threads:[~2004-06-29  2:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-28 21:34 __setup()'s not processed in bk-current Ricky Beam
2004-06-28 23:29 ` Ricky Beam
2004-06-28 23:57 ` Andrew Morton
2004-06-29  2:43   ` Rusty Russell [this message]
2004-06-29  4:40     ` Richard Henderson

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=1088477020.10622.82.camel@bach \
    --to=rusty@rustcorp.com.au \
    --cc=ak@muc.de \
    --cc=akpm@osdl.org \
    --cc=jfbeam@bluetronic.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rth@twiddle.net \
    /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