All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Baron <jbaron@akamai.com>
To: Sachin Sant <sachinp@linux.vnet.ibm.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: linux-next@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
	linuxppc-dev@ozlabs.org, Michael Ellerman <mpe@ellerman.id.au>
Subject: Re: next-20170217 boot on POWER8 LPAR : WARNING @kernel/jump_label.c:287
Date: Tue, 21 Feb 2017 11:37:21 -0500	[thread overview]
Message-ID: <20c53e88-acf5-4c4f-cea9-4dd8745814b5@akamai.com> (raw)
In-Reply-To: <02B52EFB-4608-47F3-A81C-B8B52DB11233@linux.vnet.ibm.com>

On 02/20/2017 10:05 PM, Sachin Sant wrote:
>
>> On 20-Feb-2017, at 8:27 PM, Jason Baron <jbaron@akamai.com
>> <mailto:jbaron@akamai.com>> wrote:
>>
>> Hi,
>>
>> On 02/19/2017 09:07 AM, Sachin Sant wrote:
>>> While booting next-20170217 on a POWER8 LPAR following
>>> warning is displayed.
>>>
>>> Reverting the following commit helps boot cleanly.
>>> commit 3821fd35b5 :  jump_label: Reduce the size of struct static_key
>>>
>>> [   11.393008] ------------[ cut here ]------------
>>> [   11.393031] WARNING: CPU: 5 PID: 2890 at kernel/jump_label.c:287
>>> static_key_set_entries.isra.10+0x3c/0x50
>>
>> Thanks for the report. So this is saying that the jump_entry table is
>> not at least 4-byte aligned. I wonder if this fixes it up?
>>
>
> Yes. With this patch the warning is gone.
>

Hi,

Thanks for testing. We probably need something like the following to 
make sure we don't hit this on other arches. Steve - I will send 4 
separate patches for this to get arch maintainers' acks for this?

Thanks,

-Jason

diff --git a/arch/arm/include/asm/jump_label.h 
b/arch/arm/include/asm/jump_label.h
index 34f7b6980d21..9720c2f1850b 100644
--- a/arch/arm/include/asm/jump_label.h
+++ b/arch/arm/include/asm/jump_label.h
@@ -13,6 +13,7 @@ static __always_inline bool arch_static_branch(struct 
static_key *key, bool bran
         asm_volatile_goto("1:\n\t"
                  WASM(nop) "\n\t"
                  ".pushsection __jump_table,  \"aw\"\n\t"
+                ".balign 4 \n\t"
                  ".word 1b, %l[l_yes], %c0\n\t"
                  ".popsection\n\t"
                  : :  "i" (&((char *)key)[branch]) :  : l_yes);
@@ -27,6 +28,7 @@ static __always_inline bool 
arch_static_branch_jump(struct static_key *key, bool
         asm_volatile_goto("1:\n\t"
                  WASM(b) " %l[l_yes]\n\t"
                  ".pushsection __jump_table,  \"aw\"\n\t"
+                ".balign 4 \n\t"
                  ".word 1b, %l[l_yes], %c0\n\t"
                  ".popsection\n\t"
                  : :  "i" (&((char *)key)[branch]) :  : l_yes);
diff --git a/arch/mips/include/asm/jump_label.h 
b/arch/mips/include/asm/jump_label.h
index e77672539e8e..51ce97dda3cc 100644
--- a/arch/mips/include/asm/jump_label.h
+++ b/arch/mips/include/asm/jump_label.h
@@ -31,6 +31,7 @@ static __always_inline bool arch_static_branch(struct 
static_key *key, bool bran
         asm_volatile_goto("1:\t" NOP_INSN "\n\t"
                 "nop\n\t"
                 ".pushsection __jump_table,  \"aw\"\n\t"
+               ".balign 4 \n\t"
                 WORD_INSN " 1b, %l[l_yes], %0\n\t"
                 ".popsection\n\t"
                 : :  "i" (&((char *)key)[branch]) : : l_yes);
@@ -45,6 +46,7 @@ static __always_inline bool 
arch_static_branch_jump(struct static_key *key, bool
         asm_volatile_goto("1:\tj %l[l_yes]\n\t"
                 "nop\n\t"
                 ".pushsection __jump_table,  \"aw\"\n\t"
+               ".balign 4 \n\t"
                 WORD_INSN " 1b, %l[l_yes], %0\n\t"
                 ".popsection\n\t"
                 : :  "i" (&((char *)key)[branch]) : : l_yes);
diff --git a/arch/powerpc/include/asm/jump_label.h 
b/arch/powerpc/include/asm/jump_label.h
index 9a287e0ac8b1..f870a85bac46 100644
--- a/arch/powerpc/include/asm/jump_label.h
+++ b/arch/powerpc/include/asm/jump_label.h
@@ -24,6 +24,7 @@ static __always_inline bool arch_static_branch(struct 
static_key *key, bool bran
         asm_volatile_goto("1:\n\t"
                  "nop # arch_static_branch\n\t"
                  ".pushsection __jump_table,  \"aw\"\n\t"
+                ".balign 4 \n\t"
                  JUMP_ENTRY_TYPE "1b, %l[l_yes], %c0\n\t"
                  ".popsection \n\t"
                  : :  "i" (&((char *)key)[branch]) : : l_yes);
@@ -38,6 +39,7 @@ static __always_inline bool 
arch_static_branch_jump(struct static_key *key, bool
         asm_volatile_goto("1:\n\t"
                  "b %l[l_yes] # arch_static_branch_jump\n\t"
                  ".pushsection __jump_table,  \"aw\"\n\t"
+                ".balign 4 \n\t"
                  JUMP_ENTRY_TYPE "1b, %l[l_yes], %c0\n\t"
                  ".popsection \n\t"
                  : :  "i" (&((char *)key)[branch]) : : l_yes);
@@ -63,6 +65,7 @@ struct jump_entry {
  #define ARCH_STATIC_BRANCH(LABEL, KEY)         \
  1098:  nop;                                    \
         .pushsection __jump_table, "aw";        \
+       .balign 4;                              \
         FTR_ENTRY_LONG 1098b, LABEL, KEY;       \
         .popsection
  #endif
diff --git a/arch/tile/include/asm/jump_label.h 
b/arch/tile/include/asm/jump_label.h
index cde7573f397b..c9f6125c41ef 100644
--- a/arch/tile/include/asm/jump_label.h
+++ b/arch/tile/include/asm/jump_label.h
@@ -25,6 +25,7 @@ static __always_inline bool arch_static_branch(struct 
static_key *key,
         asm_volatile_goto("1:\n\t"
                 "nop" "\n\t"
                 ".pushsection __jump_table,  \"aw\"\n\t"
+               ".balign 4 \n\t"
                 ".quad 1b, %l[l_yes], %0 + %1 \n\t"
                 ".popsection\n\t"
                 : :  "i" (key), "i" (branch) : : l_yes);
@@ -39,6 +40,7 @@ static __always_inline bool 
arch_static_branch_jump(struct static_key *key,
         asm_volatile_goto("1:\n\t"
                 "j %l[l_yes]" "\n\t"
                 ".pushsection __jump_table,  \"aw\"\n\t"
+               ".balign 4 \n\t"
                 ".quad 1b, %l[l_yes], %0 + %1 \n\t"
                 ".popsection\n\t"
                 : :  "i" (key), "i" (branch) : : l_yes);

  reply	other threads:[~2017-02-21 16:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-19 14:07 next-20170217 boot on POWER8 LPAR : WARNING @kernel/jump_label.c:287 Sachin Sant
2017-02-19 14:07 ` Sachin Sant
2017-02-20 14:57 ` Jason Baron
2017-02-21  3:05   ` Sachin Sant
2017-02-21  3:05     ` Sachin Sant
2017-02-21 16:37     ` Jason Baron [this message]
2017-02-22  5:38       ` Michael Ellerman
2017-02-22 15:11         ` Jason Baron
2017-02-27 15:22       ` Steven Rostedt
2017-02-27 15:22         ` Steven Rostedt

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=20c53e88-acf5-4c4f-cea9-4dd8745814b5@akamai.com \
    --to=jbaron@akamai.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=rostedt@goodmis.org \
    --cc=sachinp@linux.vnet.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.