public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jason Baron <jbaron@redhat.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: David Daney <ddaney@caviumnetworks.com>,
	Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>,
	peterz@infradead.org, hpa@zytor.com, mingo@elte.hu,
	tglx@linutronix.de, andi@firstfloor.org, roland@redhat.com,
	rth@redhat.com, masami.hiramatsu.pt@hitachi.com,
	fweisbec@gmail.com, avi@redhat.com, davem@davemloft.net,
	sam@ravnborg.org, michael@ellerman.id.au,
	linux-kernel@vger.kernel.org, Ralf Baechle <ralf@linux-mips.org>
Subject: Re: [PATCH 0/2] jump label: update for .39
Date: Thu, 10 Mar 2011 14:53:44 -0500	[thread overview]
Message-ID: <20110310195343.GA4058@redhat.com> (raw)
In-Reply-To: <1299786329.15854.409.camel@gandalf.stny.rr.com>

On Thu, Mar 10, 2011 at 02:45:29PM -0500, Steven Rostedt wrote:
> On Thu, 2011-03-10 at 14:25 -0500, Steven Rostedt wrote:
> > On Thu, 2011-03-10 at 10:57 -0800, David Daney wrote:
> > > On 03/10/2011 10:53 AM, Steven Rostedt wrote:
> > > > On Thu, 2011-03-10 at 10:47 -0800, David Daney wrote:
> > > >
> > > >> The alignment requested by the assembler will have to satisfy *all* the
> > > >> requested alignments, so manually forcing everything to .align 8 (or
> > > >> .align 4 for 32-bit) should ensure that the linker doesn't put in any holes.
> > > >
> > > > I would agree with the assessment although, I don't know that it is
> > > > documented anywhere that this is what happens. As the previous "bug"
> > > > with the trace_events was solved by me adding .align(4) everywhere, I
> > > > would think that .align(sizeof(long)) would work here too.
> > > >
> > > > It may be a good ideal to force this alignment, and not add wasted
> > > > space. If anything, if this (hypothetical) bug appears, it will most
> > > > likely show up as a crash on boot up. I'm not too concerned about it.
> > > >
> > > 
> > > If the linker put in gratuitous holes, things like  __ex_table would 
> > > break too.
> > 
> > Again, as I have said (although I said extable not __ex_table), there
> > seems to be no problem when the data is of a power of 2 as well. As
> > __ex_table size is a power of 2. We just don't know if the linker will
> > add holes when the size is something other than power of 2.
> 
> Anyway, I think the best thing for now is to have Jason add
> the .align(sizeof(long)) in the inline assembly for all locations and be
> done with it.
> 

agreed. something like the following is all that's needed for x86. Sparc
already has this, so mips just needs something similar. Steve, should I
re-post the entire series. Or can I just post this patch separately?

thanks,

-Jason


diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h
index f217cee..57f31ff 100644
--- a/arch/x86/include/asm/jump_label.h
+++ b/arch/x86/include/asm/jump_label.h
@@ -8,6 +8,7 @@
 #include <asm/asm.h>
 
 #define JUMP_LABEL_NOP_SIZE 5
+#define BYTES_PER_LONG (BITS_PER_LONG / 8)
 
 #define JUMP_LABEL_INITIAL_NOP ".byte 0xe9 \n\t .long 0\n\t"
 
@@ -16,9 +17,10 @@ static __always_inline bool arch_static_branch(struct jump_label_key *key)
 	asm goto("1:"
 		JUMP_LABEL_INITIAL_NOP
 		".pushsection __jump_table,  \"aw\" \n\t"
-		_ASM_PTR "1b, %l[l_yes], %c0 \n\t"
+		".align %c0\n\t"
+		_ASM_PTR "1b, %l[l_yes], %c1 \n\t"
 		".popsection \n\t"
-		: :  "i" (key) : : l_yes);
+		: : "i" BYTES_PER_LONG, "i" (key) : : l_yes);
 	return false;
 l_yes:
 	return true;

  reply	other threads:[~2011-03-10 19:54 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-09 20:47 [PATCH 0/2] jump label: update for .39 Jason Baron
2011-03-09 20:47 ` [PATCH 1/2] jump label: introduce static_branch() interface Jason Baron
2011-03-10 20:54   ` Steven Rostedt
2011-03-10 20:56   ` Steven Rostedt
2011-03-11  2:05     ` Ralf Baechle
2011-03-11  2:15       ` Steven Rostedt
2011-03-10 21:01   ` Steven Rostedt
2011-03-10 21:18     ` Jason Baron
2011-03-11  2:02       ` Ralf Baechle
2011-03-09 20:47 ` [PATCH 2/2] dynamic debug: add jump label support Jason Baron
2011-03-10  3:36 ` [PATCH 0/2] jump label: update for .39 Steven Rostedt
2011-03-10 14:11   ` Mathieu Desnoyers
2011-03-10 14:46   ` Jason Baron
     [not found]   ` <BLU0-SMTP690BB959832A97E002293396C80@phx.gbl>
2011-03-10 15:38     ` Steven Rostedt
2011-03-10 17:27       ` David Daney
2011-03-10 18:04         ` Steven Rostedt
2011-03-10 18:20           ` Jason Baron
2011-03-10 18:35             ` Steven Rostedt
2011-03-10 18:47               ` David Daney
2011-03-10 18:53                 ` Steven Rostedt
2011-03-10 18:57                   ` David Daney
2011-03-10 19:25                     ` Steven Rostedt
2011-03-10 19:45                       ` Steven Rostedt
2011-03-10 19:53                         ` Jason Baron [this message]
2011-03-10 20:01                           ` Steven Rostedt
2011-03-10 21:22                         ` Mathieu Desnoyers
     [not found]                         ` <BLU0-SMTP311155BEBE5F141636A6E596C80@phx.gbl>
2011-03-10 21:42                           ` Steven Rostedt
2011-03-10 22:11                             ` David Daney
2011-03-10 22:24                               ` Steven Rostedt
2011-03-10 22:48                             ` Mathieu Desnoyers
     [not found]                             ` <BLU0-SMTP101D168109508CC1B82F0E496C80@phx.gbl>
2011-03-10 23:16                               ` Steven Rostedt
2011-03-10 23:25                                 ` David Daney
2011-03-10 23:32                                   ` Thomas Gleixner
2011-03-10 23:43                                     ` Steven Rostedt
2011-03-10 23:51                                       ` Thomas Gleixner
     [not found]                         ` <BLU0-SMTP39EE03AE86CF0F0E5C570596C80@phx.gbl>
2011-03-11  0:38                           ` Ralf Baechle
2011-03-11  1:19                             ` Michael Ellerman
2011-03-11  2:39                             ` Mathieu Desnoyers
2011-03-10 21:39                   ` Mathieu Desnoyers
2011-03-10 21:11         ` Mathieu Desnoyers
2011-03-10 21:14       ` Mathieu Desnoyers
     [not found]       ` <BLU0-SMTP2489AC44910467F37596A496C80@phx.gbl>
2011-03-10 21:34         ` Steven Rostedt
2011-03-10 22:02           ` Mathieu Desnoyers
2011-03-10 16:41 ` Jan Glauber

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=20110310195343.GA4058@redhat.com \
    --to=jbaron@redhat.com \
    --cc=andi@firstfloor.org \
    --cc=avi@redhat.com \
    --cc=davem@davemloft.net \
    --cc=ddaney@caviumnetworks.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=michael@ellerman.id.au \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=ralf@linux-mips.org \
    --cc=roland@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=rth@redhat.com \
    --cc=sam@ravnborg.org \
    --cc=tglx@linutronix.de \
    /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