From badd79c400ed404df871e1d035bed971d20ead4c Mon Sep 17 00:00:00 2001 From: Shile Zhang Date: Sat, 22 May 2021 12:54:54 +0800 Subject: [PATCH] x86/unwind/orc: Remove boot-time ORC unwind tables sorting mainline inclusion from mainline-v5.6-rc1 commit f14bf6a350dfd6613dbf91be5b423bc7eab690da category: feature bugzilla: NA CVE: NA ------------------------------------------------- Now that the orc_unwind and orc_unwind_ip tables are sorted at build time, remove the boot time sorting pass. No change in functionality. [ mingo: Rewrote the changelog and code comments. ] Signed-off-by: Shile Zhang Acked-by: Peter Zijlstra (Intel) Cc: Josh Poimboeuf Cc: Masahiro Yamada Cc: Peter Zijlstra Cc: linux-kbuild@vger.kernel.org Link: https://lkml.kernel.org/r/20191204004633.88660-8-shile.zhang@linux.alibaba.com Signed-off-by: Ingo Molnar Signed-off-by: Yang Yingliang Reviewed-by: Jian Cheng Signed-off-by: Yang Yingliang --- arch/x86/kernel/unwind_orc.c | 8 +++++--- scripts/link-vmlinux.sh | 5 ++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c index 89be1be1790c..08051c56663a 100644 --- a/arch/x86/kernel/unwind_orc.c +++ b/arch/x86/kernel/unwind_orc.c @@ -262,9 +262,11 @@ void __init unwind_init(void) return; } - /* Sort the .orc_unwind and .orc_unwind_ip tables: */ - sort(__start_orc_unwind_ip, num_entries, sizeof(int), orc_sort_cmp, - orc_sort_swap); + /* + * Note, the orc_unwind and orc_unwind_ip tables were already + * sorted at build time via the 'sorttable' tool. + * It's ready for binary search straight away, no need to sort it. + */ /* Initialize the fast lookup table: */ lookup_num_blocks = orc_lookup_end - orc_lookup; diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 2adbeca4136c..770f96de3da8 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -286,7 +286,10 @@ vmlinux_link "${kallsymso}" vmlinux if [ -n "${CONFIG_BUILDTIME_TABLE_SORT}" ]; then info SORTTAB vmlinux - sorttable vmlinux + if ! sorttable vmlinux; then + echo >&2 Failed to sort kernel tables + exit 1 + fi fi info SYSMAP System.map -- GitLab