All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <ddaney@caviumnetworks.com>
To: Jason Baron <jbaron@akamai.com>,
	David Daney <ddaney@caviumnetworks.com>,
	Michael Ellerman <mpe@ellerman.id.au>,
	Steven Rostedt <rostedt@goodmis.org>,
	Sachin Sant <sachinp@linux.vnet.ibm.com>
Cc: linux-mips@linux-mips.org, Chris Metcalf <cmetcalf@mellanox.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Ralf Baechle <ralf@linux-mips.org>,
	Russell King <linux@armlinux.org.uk>,
	Rabin Vincent <rabin@rab.in>, Paul Mackerras <paulus@samba.org>,
	Anton Blanchard <anton@samba.org>,
	linuxppc-dev@lists.ozlabs.org, Ingo Molnar <mingo@kernel.org>,
	linux-arm-kernel@lists.infradead.org, Zhigang Lu <zlu@ezchip.com>
Subject: Re: [PATCH] jump_label: align jump_entry table to at least 4-bytes
Date: Wed, 1 Mar 2017 13:12:22 -0800	[thread overview]
Message-ID: <d6e62866-4e7b-53cf-8198-35cadc1c8c2f@caviumnetworks.com> (raw)
In-Reply-To: <cd989fed-a136-5110-f22e-d334d923ca8b@akamai.com>

On 03/01/2017 12:02 PM, Jason Baron wrote:
>
>
> On 03/01/2017 11:40 AM, David Daney wrote:
>> On 02/28/2017 10:34 PM, Michael Ellerman wrote:
>>> Jason Baron <jbaron@akamai.com> writes:
>>> ...
>>>> I also checked all the other .ko files and they were properly aligned.
>>>> So I think this should hopefully work, and I like that its not a
>>>> per-arch fix.
>>>>
>>>> Sachin, sorry to bother you again, but I'm hoping you can try David's
>>>> latest patch to scripts/module-common.lds, just to test in your setup.
>>>
>>> It does fix the problem.
>>>
>>> I was reproducing with crc_t10dif:
>>>
>>> [  695.890552] ------------[ cut here ]------------
>>> [  695.890709] WARNING: CPU: 15 PID: 3019 at
>>> ../kernel/jump_label.c:287 static_key_set_entries+0x74/0xa0
>>> [  695.890710] Modules linked in: crc_t10dif(+) crct10dif_generic
>>> crct10dif_common ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat
>>> nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 xt_addrtype
>>> iptable_filter ip_tables xt_conntrack x_tables nf_nat nf_conntrack
>>> bridge stp llc dm_thin_pool dm_persistent_data dm_bio_prison dm_bufio
>>> libcrc32c kvm virtio_balloon binfmt_misc autofs4 virtio_net virtio_pci
>>> virtio_ring virtio
>>>
>>> Which had:
>>>
>>>   [21] __jump_table      PROGBITS        0000000000000000 0004e8
>>> 000018 00  WA  0   0  1
>>>
>>>
>>> And now has:
>>>
>>>   [18] __jump_table      PROGBITS        0000000000000000 0004d0
>>> 000018 00  WA  0   0  8
>>>
>>> And all other modules have an alignment of 8 on __jump_table, as
>>> expected.
>>>
>>> I'm inclined to merge a version of the balign patch for powerpc anyway,
>>> just to be on the safe side. I guess the old code was coping fine with
>>> the unaligned keys, but it still makes me nervous.
>>
>>
>> The original "balign patch" has a couple of problems:
>>
>> 1) 4-byte alignment is not sufficient for 64-bit kernels
>>
>> 2) It is redundant if the linker script patch is accepted.
>>
>>
>
> The linker script patch seems reasonable to me.
>
> Maybe its worth adding a comment that the alignment is necessary because
> the core jump_label makes use of the 2 lsb bits of its __jump_table
> pointer due to commit:
>
> 3821fd3 jump_label: Reduce the size of struct static_key
>
> Also, in the comment it says that it fixes an oops. We hit a WARN_ON()
> not an oops, although bad things are likely to happen when the branch is
> updated.
>

OK, I guess I will send a proper patch e-mail with an updated changelog 
with the improvements you suggest.

Thanks,
David.

WARNING: multiple messages have this Message-ID (diff)
From: ddaney@caviumnetworks.com (David Daney)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] jump_label: align jump_entry table to at least 4-bytes
Date: Wed, 1 Mar 2017 13:12:22 -0800	[thread overview]
Message-ID: <d6e62866-4e7b-53cf-8198-35cadc1c8c2f@caviumnetworks.com> (raw)
In-Reply-To: <cd989fed-a136-5110-f22e-d334d923ca8b@akamai.com>

On 03/01/2017 12:02 PM, Jason Baron wrote:
>
>
> On 03/01/2017 11:40 AM, David Daney wrote:
>> On 02/28/2017 10:34 PM, Michael Ellerman wrote:
>>> Jason Baron <jbaron@akamai.com> writes:
>>> ...
>>>> I also checked all the other .ko files and they were properly aligned.
>>>> So I think this should hopefully work, and I like that its not a
>>>> per-arch fix.
>>>>
>>>> Sachin, sorry to bother you again, but I'm hoping you can try David's
>>>> latest patch to scripts/module-common.lds, just to test in your setup.
>>>
>>> It does fix the problem.
>>>
>>> I was reproducing with crc_t10dif:
>>>
>>> [  695.890552] ------------[ cut here ]------------
>>> [  695.890709] WARNING: CPU: 15 PID: 3019 at
>>> ../kernel/jump_label.c:287 static_key_set_entries+0x74/0xa0
>>> [  695.890710] Modules linked in: crc_t10dif(+) crct10dif_generic
>>> crct10dif_common ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat
>>> nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 xt_addrtype
>>> iptable_filter ip_tables xt_conntrack x_tables nf_nat nf_conntrack
>>> bridge stp llc dm_thin_pool dm_persistent_data dm_bio_prison dm_bufio
>>> libcrc32c kvm virtio_balloon binfmt_misc autofs4 virtio_net virtio_pci
>>> virtio_ring virtio
>>>
>>> Which had:
>>>
>>>   [21] __jump_table      PROGBITS        0000000000000000 0004e8
>>> 000018 00  WA  0   0  1
>>>
>>>
>>> And now has:
>>>
>>>   [18] __jump_table      PROGBITS        0000000000000000 0004d0
>>> 000018 00  WA  0   0  8
>>>
>>> And all other modules have an alignment of 8 on __jump_table, as
>>> expected.
>>>
>>> I'm inclined to merge a version of the balign patch for powerpc anyway,
>>> just to be on the safe side. I guess the old code was coping fine with
>>> the unaligned keys, but it still makes me nervous.
>>
>>
>> The original "balign patch" has a couple of problems:
>>
>> 1) 4-byte alignment is not sufficient for 64-bit kernels
>>
>> 2) It is redundant if the linker script patch is accepted.
>>
>>
>
> The linker script patch seems reasonable to me.
>
> Maybe its worth adding a comment that the alignment is necessary because
> the core jump_label makes use of the 2 lsb bits of its __jump_table
> pointer due to commit:
>
> 3821fd3 jump_label: Reduce the size of struct static_key
>
> Also, in the comment it says that it fixes an oops. We hit a WARN_ON()
> not an oops, although bad things are likely to happen when the branch is
> updated.
>

OK, I guess I will send a proper patch e-mail with an updated changelog 
with the improvements you suggest.

Thanks,
David.

  reply	other threads:[~2017-03-01 21:27 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-27 18:49 [PATCH] jump_label: align jump_entry table to at least 4-bytes Jason Baron
2017-02-27 18:49 ` Jason Baron
2017-02-27 18:57 ` David Daney
2017-02-27 18:57   ` David Daney
2017-02-27 19:18   ` Jason Baron
2017-02-27 19:18     ` Jason Baron
2017-02-27 19:59     ` David Daney
2017-02-27 19:59       ` David Daney
2017-02-27 21:06       ` Steven Rostedt
2017-02-27 21:06         ` Steven Rostedt
2017-02-27 21:41         ` David Daney
2017-02-27 21:41           ` David Daney
2017-02-27 22:09           ` Steven Rostedt
2017-02-27 22:09             ` Steven Rostedt
2017-02-27 22:21             ` David Daney
2017-02-27 22:21               ` David Daney
2017-02-27 22:21               ` David Daney
2017-02-27 22:36               ` Steven Rostedt
2017-02-27 22:36                 ` Steven Rostedt
2017-02-27 22:45                 ` David Daney
2017-02-27 22:45                   ` David Daney
2017-02-27 22:50                   ` Jason Baron
2017-02-27 22:50                     ` Jason Baron
2017-02-27 23:34                     ` David Daney
2017-02-27 23:34                       ` David Daney
2017-02-28  4:55                     ` Sachin Sant
2017-02-28 16:21                       ` Steven Rostedt
2017-02-28 16:21                         ` Steven Rostedt
2017-02-28 18:16                         ` David Daney
2017-02-28 18:16                           ` David Daney
2017-02-28 18:39                           ` Jason Baron
2017-02-28 18:39                             ` Jason Baron
2017-02-28 19:05                             ` David Daney
2017-02-28 19:05                               ` David Daney
2017-02-28 19:22                               ` David Daney
2017-02-28 19:22                                 ` David Daney
2017-02-28 19:34                                 ` Jason Baron
2017-02-28 19:34                                   ` Jason Baron
2017-02-28 20:15                                   ` David Daney
2017-02-28 20:15                                     ` David Daney
2017-02-28 20:15                                     ` David Daney
2017-02-28 22:41                                     ` Jason Baron
2017-02-28 22:41                                       ` Jason Baron
2017-03-01  6:34                                       ` Michael Ellerman
2017-03-01  6:34                                         ` Michael Ellerman
2017-03-01 16:40                                         ` David Daney
2017-03-01 16:40                                           ` David Daney
2017-03-01 20:02                                           ` Jason Baron
2017-03-01 20:02                                             ` Jason Baron
2017-03-01 21:12                                             ` David Daney [this message]
2017-03-01 21:12                                               ` David Daney
2017-03-01  7:12                                       ` Sachin Sant
2017-03-01  7:12                                         ` Sachin Sant
2017-02-27 22:58                   ` Steven Rostedt
2017-02-27 22:58                     ` Steven Rostedt
2017-03-06  2:16               ` [PATCH] MIPS: jump_lable: Give __jump_table elements an entsize kbuild test robot
2017-03-06  2:16                 ` kbuild test robot

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=d6e62866-4e7b-53cf-8198-35cadc1c8c2f@caviumnetworks.com \
    --to=ddaney@caviumnetworks.com \
    --cc=anton@samba.org \
    --cc=cmetcalf@mellanox.com \
    --cc=jbaron@akamai.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux@armlinux.org.uk \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mingo@kernel.org \
    --cc=mpe@ellerman.id.au \
    --cc=paulus@samba.org \
    --cc=rabin@rab.in \
    --cc=ralf@linux-mips.org \
    --cc=rostedt@goodmis.org \
    --cc=sachinp@linux.vnet.ibm.com \
    --cc=zlu@ezchip.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.