Skip to contentSkip to conversation

module: set __jump_table alignment to 8

PATCH In review David Daney 6 participants 10 messages Mar 1, 2017 – Mar 3, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 module: set __jump_table alignment to 8

For powerpc the __jump_table section in modules is not aligned, this causes a WARN_ON() splat when loading a module containing a __jump_table.

Strict alignment became necessary with commit 3821fd35b58d ("jump_label: Reduce the size of struct static_key"), currently in linux-next, which uses the two least significant bits of pointers to __jump_table elements.

Fix by forcing __jump_table to 8, which is the same alignment used for this section in the kernel proper.

---
 scripts/module-common.lds | 2 ++
 1 file changed, 2 insertions(+)
scripts/module-common.lds +2 -0
index 73a2c7d..53234e8 100644
@@ -19,4 +19,6 @@ SECTIONS {
 
 	. = ALIGN(8);
 	.init_array		0 : { *(SORT(.init_array.*)) *(.init_array) }
+
+	__jump_table		0 : ALIGN(8) { KEEP(*(__jump_table)) }
 }
Signature · 1 line
2.9.3
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · David Daney

For powerpc the __jump_table section in modules is not aligned, this causes a WARN_ON() splat when loading a module containing a __jump_table.

Thanks for doing the patch.

If it helps:

Quoted 4 lines

Strict alignment became necessary with commit 3821fd35b58d ("jump_label: Reduce the size of struct static_key"), currently in linux-next, which uses the two least significant bits of pointers to __jump_table elements.

It would obviously be nice if this could go in before the commit that exposes the breakage, but I guess that's problematic because Steve doesn't want to rebase the tracing tree.

Steve I think you've already sent your pull request for this cycle? So I guess if this can go in your first batch of fixes?

Or we could just send it directly to Linus?

cheers

Quoted 22 lines

Fix by forcing __jump_table to 8, which is the same alignment used for this section in the kernel proper.

---
 scripts/module-common.lds | 2 ++
 1 file changed, 2 insertions(+)
scripts/module-common.lds +2 -0
index 73a2c7d..53234e8 100644
@@ -19,4 +19,6 @@ SECTIONS {
 
 	. = ALIGN(8);
 	.init_array		0 : { *(SORT(.init_array.*)) *(.init_array) }
+
+	__jump_table		0 : ALIGN(8) { KEEP(*(__jump_table)) }
 }
Signature · 1 line
2.9.3
#2 lore raw
Quoted 6 lines · Michael Ellerman
Quoted 4 lines · David Daney

Strict alignment became necessary with commit 3821fd35b58d ("jump_label: Reduce the size of struct static_key"), currently in linux-next, which uses the two least significant bits of pointers to __jump_table elements.

Quoted 6 lines

It would obviously be nice if this could go in before the commit that exposes the breakage, but I guess that's problematic because Steve doesn't want to rebase the tracing tree.

Steve I think you've already sent your pull request for this cycle? So I guess if this can go in your first batch of fixes?

Ugh. Was looking at the wrong tree - Linus has already merged the commit in question, so the above is all moot.

cheers

#3 lore raw
Quoted 11 lines · On Thu, 02 Mar 2017 22:18:30 +1100 Michael Ellerman <[email protected]> wrote:
Quoted 10 lines · Michael Ellerman
Quoted 4 lines · David Daney

Strict alignment became necessary with commit 3821fd35b58d ("jump_label: Reduce the size of struct static_key"), currently in linux-next, which uses the two least significant bits of pointers to __jump_table elements.

It would obviously be nice if this could go in before the commit that exposes the breakage, but I guess that's problematic because Steve doesn't want to rebase the tracing tree.

Quoted 5 lines
Quoted 2 lines

Steve I think you've already sent your pull request for this cycle? So I guess if this can go in your first batch of fixes?

Ugh. Was looking at the wrong tree - Linus has already merged the commit in question, so the above is all moot.

No problem. I've got some other "fixes" to push to Linus. That's what the -rc releases are for. To fix up breakage from the merge window ;-)

I'll pull this into my tree.

Thanks!

-- Steve

#4 lore raw
Quoted 13 lines · Steven Rostedt
Quoted 11 lines · On Thu, 02 Mar 2017 22:18:30 +1100 Michael Ellerman <[email protected]> wrote:
Quoted 10 lines · Michael Ellerman
Quoted 4 lines · David Daney

Strict alignment became necessary with commit 3821fd35b58d ("jump_label: Reduce the size of struct static_key"), currently in linux-next, which uses the two least significant bits of pointers to __jump_table elements.

It would obviously be nice if this could go in before the commit that exposes the breakage, but I guess that's problematic because Steve doesn't want to rebase the tracing tree.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

Steve I think you've already sent your pull request for this cycle? So I guess if this can go in your first batch of fixes?

Ugh. Was looking at the wrong tree - Linus has already merged the commit in question, so the above is all moot.

No problem. I've got some other "fixes" to push to Linus. That's what the -rc releases are for. To fix up breakage from the merge window ;-)

Yep, no drama.

Quoted 1 line

I'll pull this into my tree.

Thanks.

cheers

Reviewed-by on v1 1/1
#5 lore raw
In reply to David Daney
Quoted 8 lines · David Daney

For powerpc the __jump_table section in modules is not aligned, this causes a WARN_ON() splat when loading a module containing a __jump_table.

Strict alignment became necessary with commit 3821fd35b58d ("jump_label: Reduce the size of struct static_key"), currently in linux-next, which uses the two least significant bits of pointers to __jump_table elements.

Quoted 6 lines

Fix by forcing __jump_table to 8, which is the same alignment used for this section in the kernel proper.

---

Looks good to me.

Thanks,

-Jason

#6 lore raw
In reply to David Daney

Can I get an Ack from a module maintainer?

Thanks!

-- Steve

Quoted 28 lines · On Wed, 1 Mar 2017 14:04:53 -0800 David Daney <[email protected]> wrote:

For powerpc the __jump_table section in modules is not aligned, this causes a WARN_ON() splat when loading a module containing a __jump_table.

Strict alignment became necessary with commit 3821fd35b58d ("jump_label: Reduce the size of struct static_key"), currently in linux-next, which uses the two least significant bits of pointers to __jump_table elements.

Fix by forcing __jump_table to 8, which is the same alignment used for this section in the kernel proper.

---
 scripts/module-common.lds | 2 ++
 1 file changed, 2 insertions(+)
scripts/module-common.lds +2 -0
index 73a2c7d..53234e8 100644
@@ -19,4 +19,6 @@ SECTIONS {
 
 	. = ALIGN(8);
 	.init_array		0 : { *(SORT(.init_array.*)) *(.init_array) }
+
+	__jump_table		0 : ALIGN(8) { KEEP(*(__jump_table)) }
 }
Acked-by
#7 lore raw

+++ Steven Rostedt [02/03/17 13:11 -0500]:

Quoted 2 lines

Can I get an Ack from a module maintainer?

Thanks!

Jessica

Quoted 32 lines
Quoted 28 lines · On Wed, 1 Mar 2017 14:04:53 -0800 David Daney <[email protected]> wrote:

For powerpc the __jump_table section in modules is not aligned, this causes a WARN_ON() splat when loading a module containing a __jump_table.

Strict alignment became necessary with commit 3821fd35b58d ("jump_label: Reduce the size of struct static_key"), currently in linux-next, which uses the two least significant bits of pointers to __jump_table elements.

Fix by forcing __jump_table to 8, which is the same alignment used for this section in the kernel proper.

---
 scripts/module-common.lds | 2 ++
 1 file changed, 2 insertions(+)
scripts/module-common.lds +2 -0
index 73a2c7d..53234e8 100644
@@ -19,4 +19,6 @@ SECTIONS {
 
 	. = ALIGN(8);
 	.init_array		0 : { *(SORT(.init_array.*)) *(.init_array) }
+
+	__jump_table		0 : ALIGN(8) { KEEP(*(__jump_table)) }
 }
#8 lore raw
Quoted 9 lines · Jessica Yu

+++ Steven Rostedt [02/03/17 13:11 -0500]:

Quoted 2 lines

Can I get an Ack from a module maintainer?

Thanks!

Jessica

Thanks Jessica,

Can you also add scripts/module-common.lds to MAINTAINERS so that get_maintainers.pl will indicate that Jessica Yu and Rusty Russell be CCed on things like this in the future?

Quoted 34 lines
Quoted 34 lines
Quoted 29 lines · On Wed, 1 Mar 2017 14:04:53 -0800 David Daney <[email protected]> wrote:

For powerpc the __jump_table section in modules is not aligned, this causes a WARN_ON() splat when loading a module containing a __jump_table.

Strict alignment became necessary with commit 3821fd35b58d ("jump_label: Reduce the size of struct static_key"), currently in linux-next, which uses the two least significant bits of pointers to __jump_table elements.

Fix by forcing __jump_table to 8, which is the same alignment used for this section in the kernel proper.

---
 scripts/module-common.lds | 2 ++
 1 file changed, 2 insertions(+)
scripts/module-common.lds +2 -0
index 73a2c7d..53234e8 100644
@@ -19,4 +19,6 @@ SECTIONS {
 
     . = ALIGN(8);
     .init_array        0 : { *(SORT(.init_array.*)) *(.init_array) }
+
+    __jump_table        0 : ALIGN(8) { KEEP(*(__jump_table)) }
 }
#9 lore raw

+++ David Daney [02/03/17 11:24 -0800]:

Quoted 9 lines · Jessica Yu
Quoted 8 lines

+++ Steven Rostedt [02/03/17 13:11 -0500]:

Quoted 2 lines

Can I get an Ack from a module maintainer?

Thanks!

Quoted 7 lines
Quoted 1 line

Jessica

Thanks Jessica,

Can you also add scripts/module-common.lds to MAINTAINERS so that get_maintainers.pl will indicate that Jessica Yu and Rusty Russell be CCed on things like this in the future?

Sure thing. Thanks for the heads up!

Jessica

Quoted 34 lines
Quoted 33 lines
Quoted 33 lines
Quoted 29 lines · On Wed, 1 Mar 2017 14:04:53 -0800 David Daney <[email protected]> wrote:

For powerpc the __jump_table section in modules is not aligned, this causes a WARN_ON() splat when loading a module containing a __jump_table.

Strict alignment became necessary with commit 3821fd35b58d ("jump_label: Reduce the size of struct static_key"), currently in linux-next, which uses the two least significant bits of pointers to __jump_table elements.

Fix by forcing __jump_table to 8, which is the same alignment used for this section in the kernel proper.

---
scripts/module-common.lds | 2 ++

1 file changed, 2 insertions(+)
scripts/module-common.lds +2 -0
index 73a2c7d..53234e8 100644
@@ -19,4 +19,6 @@ SECTIONS {
 
    . = ALIGN(8);
    .init_array        0 : { *(SORT(.init_array.*)) *(.init_array) }
+
+    __jump_table        0 : ALIGN(8) { KEEP(*(__jump_table)) }
 }