public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Oskar Schirmer" <os@emlix.com>
To: Paul Mundt <lethal@linux-sh.org>
Cc: Johannes Weiner <jw@emlix.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Oskar Schirmer <os@emlix.com>,
	David Howells <dhowells@redhat.com>,
	Russell King <rmk@arm.linux.org.uk>,
	Bryan Wu <cooloney@kernel.org>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] binfmt_flat: fix data sections alignment
Date: Wed, 4 Mar 2009 12:39:38 +0100	[thread overview]
Message-ID: <E1LepRq-0006nu-VT@mailer.emlix.com> (raw)
In-Reply-To: <20090303182801.GA6907@linux-sh.org>

On Wed, Mar 04, 2009 at 03:28:02 +0900, Paul Mundt wrote:
> On Tue, Mar 03, 2009 at 05:33:13PM +0100, Johannes Weiner wrote:
> > The flat loader uses an architecture's flat_stack_align() to align the
> > stack but assumes word-alignment is enough for the data sections.
> > 
> > However, on the Xtensa S6000 we need an alignment of more than
> > wordsize for data that is loaded to 128bit wide registers.
> > 
> > This patch replaces the specific flat_stack_align() with a more
> > generic flat_data_align() that is then used for both stack, the data
> > and bss section.
> > 
> > It also fixes m32r which was obviously kaput, aligning an
> > uninitialized stack entry instead of the stack pointer.
> > 
> Can you provide a bit more information about this for your platform? I
> note that while this patch is aimed to generalize things for your
> platform, there is no Xtensa patch included here, making it difficult to
> Ack without having more context to go on.

You are right, currently there is no variant which
really needs these fixes. But the Xtensa noMMU port
(will follow as soon as possible) wont work without
these.

> Based on your description, it looks like you need register size alignment
> in the case where your registers are greater than BYTES_PER_WORD, or the

This is right. Xtensa S6000 provides an additional set of
wide registers (128 bit), and load/store instructions to
fill them. These load/store cycles need to be 16 byte aligned.

> pointer size. If this is the case, then you are going to have the same
> issues with the slab caches and need to set ARCH_SLAB_MINALIGN
> accordingly. This is presently a situation that exists for certain ARM
> and SH platforms already today, but none that are actively used in nommu
> configurations. It would be preferable to generalize this, rather than
> duplicating the special-cased alignment.

This sounds like a good proposal.
We will rewrite the patch to use the more generic
ARCH_SLAB_MINALIGN and send it soon.

  Oskar
-- 
oskar schirmer, emlix gmbh, http://www.emlix.com
fon +49 551 30664-0, fax -11, bahnhofsallee 1b, 37081 göttingen, germany
geschäftsführung: dr. uwe kracke, dr. cord seele, ust-idnr.: de 205 198 055
sitz der gesellschaft: göttingen, amtsgericht göttingen hr b 3160

emlix - your embedded linux partner

      reply	other threads:[~2009-03-04 11:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-03 16:33 [patch] binfmt_flat: fix data sections alignment Johannes Weiner
2009-03-03 16:37 ` Russell King
2009-03-03 18:28 ` Paul Mundt
2009-03-04 11:39   ` Oskar Schirmer [this message]

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=E1LepRq-0006nu-VT@mailer.emlix.com \
    --to=os@emlix.com \
    --cc=akpm@linux-foundation.org \
    --cc=cooloney@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=geert@linux-m68k.org \
    --cc=jw@emlix.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rmk@arm.linux.org.uk \
    /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