mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: Mike Frysinger <vapier.adi@gmail.com>,
	Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Linux kernel mailing list <linux-kernel@vger.kernel.org>,
	Rusty Russell <rusty@rustcorp.com.au>,
	Alan Jenkins <alan-jenkins@tuffmail.co.uk>
Subject: Re: missing .data.shared_align placement in vmlinux
Date: Wed, 4 Aug 2010 22:40:02 +0200	[thread overview]
Message-ID: <20100804204002.GA22147@merkur.ravnborg.org> (raw)
In-Reply-To: <20100804202806.GA22134@merkur.ravnborg.org>

[Resend - this time with Jeremy included in To: ]

Jeremy - you introduced this in ("x86/i386: Put aligned
stack-canary in percpu shared_aligned section")
53f824520b6d84ca5b4a8fd71addc91dbf64357e

Does the following simple fix look correct to you?
[See below]

	Sam

> 
On Wed, Aug 04, 2010 at 10:28:06PM +0200, Sam Ravnborg wrote:
> On Wed, Aug 04, 2010 at 02:12:03PM -0400, Mike Frysinger wrote:
> > On Wed, Aug 4, 2010 at 07:56, Sam Ravnborg wrote:
> > > On Fri, May 21, 2010 at 04:58:53PM -0400, Mike Frysinger wrote:
> > >> am i missing something or does the .data.shared_align section lack
> > >> definition in vmlinux.lds.h and all arch vmlinux.lds.S files ?
> > >>
> > >> with the recent change "net: remove time limit in process_backlog()",
> > >> the softnet_data variable changed from "DEFINE_PER_CPU()" to
> > >> "DEFINE_PER_CPU_ALIGNED()" which moved it from the .data section to
> > >> the .data.shared_align section.  i'm not saying this patch is wrong,
> > >> just that is what caused me to notice this larger problem.  no one
> > >> else in the kernel is using this aligned macro variant, so i imagine
> > >> that's why no one has noticed yet.
> > >>
> > >> since .data.shared_align isnt declared in any vmlinux files that i can
> > >> see, the linker just places it last.  this "just works" for most
> > >> people, but when building a ROM kernel on Blackfin systems, it causes
> > >> section overlap errors:
> > >> bfin-uclinux-ld.real: section .init.data [00000000202e06b8 ->
> > >> 00000000202e48b7] overlaps section .data.shared_aligned
> > >> [00000000202e06b8 -> 00000000202e0723]
> > >> i imagine other arches which support the ROM config option and thus do
> > >> funky placement would see similar issues ...
> > >>
> > >> on x86, it is stuck in a dedicated section:
> > >>   [ 8] .data             PROGBITS        ffffffff810ec000 2ec000
> > >> 0303a8 00  WA  0   0 4096
> > >>   [ 9] .data.shared_alig PROGBITS        ffffffff8111c3c0 31c3c0
> > >> 0000c8 00  WA  0   0 64
> > >>
> > >> the ifdef forest in asm-generic/percpu.h is beyond a quick glance &
> > >> fix, so i leave it up to someone else ;)
> > >
> > > as there any resolution on this?
> > > I briefly looked at it some time ago.
> > > And it looks like a plain oversight.
> > 
> > no, it's still broken in 2.6.35 :(
> > $ make ARCH=blackfin BF537-STAMP_defconfig
> > $ make ARCH=blackfin -s -j4
> > $ readelf -WS vmlinux | grep '\<data\>'
> >   [10] .data             PROGBITS        0018369c 17269c 012964 00  WA  0   0  4
> >   [11] .data..shared_aligned PROGBITS        00196000 185000 00006c 00
> >  WA  0   0  4
> 

diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index 030a954..e87260f 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -150,6 +150,7 @@
 #define DATA_DATA							\
 	*(.data)							\
 	*(.ref.data)							\
+	*(.data..shared_aligned) /* percpu related */			\
 	DEV_KEEP(init.data)						\
 	DEV_KEEP(exit.data)						\
 	CPU_KEEP(init.data)						\

  reply	other threads:[~2010-08-04 20:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-21 20:58 Mike Frysinger
2010-08-04 11:56 ` Sam Ravnborg
2010-08-04 18:12   ` Mike Frysinger
2010-08-04 20:28     ` Sam Ravnborg
2010-08-04 20:40       ` Sam Ravnborg [this message]
2010-08-05  5:14         ` Jeremy Fitzhardinge
2010-08-26  7:19           ` Mike Frysinger
2010-08-28  6:00         ` Mike Frysinger
2010-10-18  6:27 ` [PATCH] vmlinux.lds.h: gather .data..shared_aligned sections in DATA_DATA Mike Frysinger
2010-10-18  6:30   ` Mike Frysinger
2010-10-18 15:32     ` Sam Ravnborg

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=20100804204002.GA22147@merkur.ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=alan-jenkins@tuffmail.co.uk \
    --cc=jeremy@xensource.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rusty@rustcorp.com.au \
    --cc=vapier.adi@gmail.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

all inboxes | Powered by JetHome®