From: Stephen Boyd <hidden> Date: 2012-07-30 21:30:12
Add the ARM machine identifier to sortextable and select the
config option so that we can sort the exception table at compile
time. sortextable relies on a section named __ex_table existing
in the vmlinux, but ARM's linker script places the exception
table in the data section. Give the exception table its own
section so that sortextable can find it.
This allows us to skip the runtime sorting step during boot.
Signed-off-by: Stephen Boyd <redacted>
Cc: David Daney <redacted>
---
I can't find any information on why the exception table lives in the data
section. If there's a good reason for that, I'll look into changing
sortextable to look for the __start___ex_table symbol.
arch/arm/Kconfig | 1 +
arch/arm/kernel/vmlinux.lds.S | 19 +++++++++----------
scripts/sortextable.c | 1 +
3 files changed, 11 insertions(+), 10 deletions(-)
From: Sam Ravnborg <hidden> Date: 2012-07-30 21:51:22
On Mon, Jul 30, 2012 at 02:30:03PM -0700, Stephen Boyd wrote:
quoted hunk
Add the ARM machine identifier to sortextable and select the
config option so that we can sort the exception table at compile
time. sortextable relies on a section named __ex_table existing
in the vmlinux, but ARM's linker script places the exception
table in the data section. Give the exception table its own
section so that sortextable can find it.
This allows us to skip the runtime sorting step during boot.
Signed-off-by: Stephen Boyd <redacted>
Cc: David Daney <redacted>
---
I can't find any information on why the exception table lives in the data
section. If there's a good reason for that, I'll look into changing
sortextable to look for the __start___ex_table symbol.
arch/arm/Kconfig | 1 +
arch/arm/kernel/vmlinux.lds.S | 19 +++++++++----------
scripts/sortextable.c | 1 +
3 files changed, 11 insertions(+), 10 deletions(-)
Here you should be able to use the macro EXCEPTION_TABLE from
vmlinux.lds.h.
I cannot see why the ifdef for not NON-MMU case is needed,
but if it is needed the macro is not good...
Sam
From: Russell King - ARM Linux <hidden> Date: 2012-07-30 21:56:54
On Mon, Jul 30, 2012 at 02:30:03PM -0700, Stephen Boyd wrote:
Add the ARM machine identifier to sortextable and select the
config option so that we can sort the exception table at compile
time. sortextable relies on a section named __ex_table existing
in the vmlinux, but ARM's linker script places the exception
table in the data section. Give the exception table its own
section so that sortextable can find it.
This allows us to skip the runtime sorting step during boot.
Signed-off-by: Stephen Boyd <redacted>
Cc: David Daney <redacted>
---
I can't find any information on why the exception table lives in the data
section. If there's a good reason for that, I'll look into changing
sortextable to look for the __start___ex_table symbol.
Be careful about the placement of this, especially with XIP.
From: Russell King - ARM Linux <hidden> Date: 2012-07-30 22:19:26
On Mon, Jul 30, 2012 at 11:51:18PM +0200, Sam Ravnborg wrote:
Here you should be able to use the macro EXCEPTION_TABLE from
vmlinux.lds.h.
I cannot see why the ifdef for not NON-MMU case is needed,
but if it is needed the macro is not good...
Because you can not mention the same input section in two different
places and end up with predictable output from the linker.
We discard the __ex_table for noMMU, but I think the start/stop
symbols are still referenced somewhere. Dunno, I don't have much to
do with noMMU ARM, and the only platform I'd be interested in never
got merged.
From: Stephen Boyd <hidden> Date: 2012-07-30 22:38:53
On 07/30/12 14:56, Russell King - ARM Linux wrote:
On Mon, Jul 30, 2012 at 02:30:03PM -0700, Stephen Boyd wrote:
quoted
Add the ARM machine identifier to sortextable and select the
config option so that we can sort the exception table at compile
time. sortextable relies on a section named __ex_table existing
in the vmlinux, but ARM's linker script places the exception
table in the data section. Give the exception table its own
section so that sortextable can find it.
This allows us to skip the runtime sorting step during boot.
Signed-off-by: Stephen Boyd <redacted>
Cc: David Daney <redacted>
---
I can't find any information on why the exception table lives in the data
section. If there's a good reason for that, I'll look into changing
sortextable to look for the __start___ex_table symbol.
Be careful about the placement of this, especially with XIP.
Thanks for the hint. I'm unfamiliar with how XIP works so I'll take a
closer look there.
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
From: Stephen Boyd <hidden> Date: 2012-07-30 22:40:42
On 07/30/12 15:19, Russell King - ARM Linux wrote:
On Mon, Jul 30, 2012 at 11:51:18PM +0200, Sam Ravnborg wrote:
quoted
Here you should be able to use the macro EXCEPTION_TABLE from
vmlinux.lds.h.
I cannot see why the ifdef for not NON-MMU case is needed,
but if it is needed the macro is not good...
Because you can not mention the same input section in two different
places and end up with predictable output from the linker.
We discard the __ex_table for noMMU, but I think the start/stop
symbols are still referenced somewhere. Dunno, I don't have much to
do with noMMU ARM, and the only platform I'd be interested in never
got merged.
I was thinking, perhaps we can ifdef out the exception fixup sections in
the places where they're added? Then we can just use the EXCEPTION_TABLE
macro from vmlinux.lds.h knowing that there are no __ex_table sections
in the input object files?
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
From: Stephen Boyd <hidden> Date: 2012-07-31 20:01:23
On 07/30/12 15:38, Stephen Boyd wrote:
On 07/30/12 14:56, Russell King - ARM Linux wrote:
quoted
On Mon, Jul 30, 2012 at 02:30:03PM -0700, Stephen Boyd wrote:
quoted
Add the ARM machine identifier to sortextable and select the
config option so that we can sort the exception table at compile
time. sortextable relies on a section named __ex_table existing
in the vmlinux, but ARM's linker script places the exception
table in the data section. Give the exception table its own
section so that sortextable can find it.
This allows us to skip the runtime sorting step during boot.
Signed-off-by: Stephen Boyd <redacted>
Cc: David Daney <redacted>
---
I can't find any information on why the exception table lives in the data
section. If there's a good reason for that, I'll look into changing
sortextable to look for the __start___ex_table symbol.
Be careful about the placement of this, especially with XIP.
Thanks for the hint. I'm unfamiliar with how XIP works so I'll take a
closer look there.
Ok. It looks like the exception table is placed in the data section so
that XIP kernels can boot up and sort the exception table (otherwise the
exception table would be in read-only flash). Now that the exception
table is sorted at compile time, we should be able to place the
exception table in the rodata area, essentially placing the table in the
non-volatile storage on XIP kernels.
I propose we move the exception table right after the rodata. Other
arches (x86/mips) may actually want to put the exception table into the
rodata, but that looks like a larger change.
--
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
From: Stephen Boyd <hidden> Date: 2012-08-22 18:56:38
Add the ARM machine identifier to sortextable and select the
config option so that we can sort the exception table at compile
time. sortextable relies on a section named __ex_table existing
in the vmlinux, but ARM's linker script places the exception
table in the data section. Give the exception table its own
section so that sortextable can find it.
This allows us to skip the sorting step during boot.
Cc: David Daney <redacted>
Signed-off-by: Stephen Boyd <redacted>
---
Changes since v1:
* Moved exception table next to RO data for XIP builds
arch/arm/Kconfig | 1 +
arch/arm/kernel/vmlinux.lds.S | 19 +++++++++----------
scripts/sortextable.c | 1 +
3 files changed, 11 insertions(+), 10 deletions(-)