Make check implementation arch agnostic
Subsystems (3)
v2 cover Make check implementation arch agnostic
Hi,
The current implementation of the check subcommand has various x86 bits here and there. In order to prepare objtool to provide check for other architectures, add some abstraction over the x86 specific bits, relying on objtool arch specific code to provide some necessary operations.
This is part of the effort to implement check for arm64, initiated [1] by Raphael. The series is based on top of the separation of check & orc subcommands series[2].
I've push both series base on top of tip/objtool/core at [3].
- The first two patches make it simpler for new arches to provide their list of kernel headers, without worrying about modifications in the x86 headers.
- Patch 3 Moves arch specific macros to more suitable location
- Patches 4 and 5 add abstraction to handle alternatives
- Patch 6 adds abstraction to handle jump table
- Patches 7-9 abstracts the use of unwind hints, so some definitions can be shared across architectures while keeping arch specific semantics
Changes since v1 [4]:
- Rebased on recent tip/objtool/core
- Split the unwind hint rework into multiple patches as suggested by Miroslav
[1] https://lkml.org/lkml/2019/8/16/400
[2] https://lkml.org/lkml/2020/7/30/415
[3] https://github.com/julien-thierry/linux/tree/arch-independent-check
[4] https://lkml.org/lkml/2020/6/8/535
Cheers,
Julien
-->
Julien Thierry (8):
objtool: Group headers to check in a single list
objtool: Make sync-check consider the target architecture
objtool: Move macros describing structures to arch-dependent code
objtool: Abstract alternative special case handling
objtool: Make relocation in alternative handling arch dependent
frame: Only include valid definitions depending on source file type
frame: Make unwind hints definitions available to other architectures
objtool: Abstract unwind hint reading
Raphael Gault (1):
objtool: Refactor switch-tables code to support other architectures
arch/x86/include/asm/orc_types.h | 13 -- arch/x86/include/asm/unwind_hints.h | 44 +---- include/linux/frame.h | 78 ++++++++ tools/arch/x86/include/asm/orc_types.h | 13 -- tools/include/linux/frame.h | 113 ++++++++++++ tools/objtool/Makefile | 2 +- tools/objtool/arch.h | 5 +- tools/objtool/arch/x86/Build | 1 + tools/objtool/arch/x86/arch_special.c | 145 +++++++++++++++ tools/objtool/arch/x86/decode.c | 54 ++++++ tools/objtool/arch/x86/include/arch_special.h | 20 +++ tools/objtool/cfi.h | 3 +- tools/objtool/check.c | 166 ++---------------- tools/objtool/check.h | 7 +- tools/objtool/objtool.h | 2 + tools/objtool/orc_gen.c | 4 +- tools/objtool/special.c | 48 +---- tools/objtool/special.h | 10 ++ tools/objtool/sync-check.sh | 27 ++- tools/objtool/weak.c | 2 - 20 files changed, 486 insertions(+), 271 deletions(-) create mode 100644 tools/include/linux/frame.h create mode 100644 tools/objtool/arch/x86/arch_special.c create mode 100644 tools/objtool/arch/x86/include/arch_special.h
--
2.21.3
PATCH v2 1/9 objtool: Group headers to check in a single list
In order to support multiple architectures and potentially different sets of header to compare against their kernel equivalent, it is simpler to have all headers to check in a single list.
--- tools/objtool/sync-check.sh | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
tools/objtool/sync-check.sh +12 -9
@@ -1,13 +1,17 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 -FILES=' +FILES=" arch/x86/include/asm/inat_types.h arch/x86/include/asm/orc_types.h arch/x86/include/asm/emulate_prefix.h arch/x86/lib/x86-opcode-map.txt arch/x86/tools/gen-insn-attr-x86.awk -' +arch/x86/include/asm/inat.h -I '^#include [\"<]\(asm/\)*inat_types.h[\">]' +arch/x86/include/asm/insn.h -I '^#include [\"<]\(asm/\)*inat.h[\">]' +arch/x86/lib/inat.c -I '^#include [\"<]\(../include/\)*asm/insn.h[\">]' +arch/x86/lib/insn.c -I '^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]' -I '^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]' +" check_2 () { file1=$1
@@ -40,11 +44,10 @@ fi cd ../.. -for i in $FILES; do - check $i -done +while read -r file_entry; do + if [ -z "$file_entry" ]; then + continue + fi -check arch/x86/include/asm/inat.h '-I "^#include [\"<]\(asm/\)*inat_types.h[\">]"' -check arch/x86/include/asm/insn.h '-I "^#include [\"<]\(asm/\)*inat.h[\">]"' -check arch/x86/lib/inat.c '-I "^#include [\"<]\(../include/\)*asm/insn.h[\">]"' -check arch/x86/lib/insn.c '-I "^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]" -I "^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]"' + check $file_entry +done <<< $FILES
Signature · 1 line
2.21.3
PATCH v2 2/9 objtool: Make sync-check consider the target architecture
In reply to Julien ThierryDo not take into account outdated headers unrelated to the build of the current architecture.
--- tools/objtool/Makefile | 2 +- tools/objtool/sync-check.sh | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-)
tools/objtool/Makefile +1 -1
@@ -60,7 +60,7 @@ export srctree OUTPUT CFLAGS SRCARCH AWK include $(srctree)/tools/build/Makefile.include $(OBJTOOL_IN): fixdep FORCE - @$(CONFIG_SHELL) ./sync-check.sh + @$(CONFIG_SHELL) ./sync-check.sh $(SRCARCH) @$(MAKE) $(build)=objtool $(OBJTOOL): $(LIBSUBCMD) $(OBJTOOL_IN)
tools/objtool/sync-check.sh +4 -0
@@ -1,6 +1,9 @@ #!/bin/sh # SPDX-License-Identifier: GPL-2.0 +TARGET_ARCH=$1 + +if [ "$TARGET_ARCH" == "x86" ]; then FILES=" arch/x86/include/asm/inat_types.h arch/x86/include/asm/orc_types.h
@@ -12,6 +15,7 @@ arch/x86/include/asm/insn.h -I '^#include [\"<]\(asm/\)*inat.h[\">]' arch/x86/lib/inat.c -I '^#include [\"<]\(../include/\)*asm/insn.h[\">]' arch/x86/lib/insn.c -I '^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]' -I '^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]' " +fi check_2 () { file1=$1
Signature · 1 line
2.21.3
PATCH v2 3/9 objtool: Move macros describing structures to arch-dependent code
In reply to Julien ThierrySome macros are defined to describe the size and layout of structures exception_table_entry, jump_entry and alt_instr. These values can vary from one architecture to another.
Have the values be defined by arch specific code.
--- tools/objtool/arch/x86/include/arch_special.h | 20 +++++++++++++++++++ tools/objtool/special.c | 16 +-------------- 2 files changed, 21 insertions(+), 15 deletions(-) create mode 100644 tools/objtool/arch/x86/include/arch_special.h
tools/objtool/arch/x86/include/arch_special.h new file +20 -0
@@ -0,0 +1,20 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ +#ifndef _X86_ARCH_SPECIAL_H +#define _X86_ARCH_SPECIAL_H + +#define EX_ENTRY_SIZE 12 +#define EX_ORIG_OFFSET 0 +#define EX_NEW_OFFSET 4 + +#define JUMP_ENTRY_SIZE 16 +#define JUMP_ORIG_OFFSET 0 +#define JUMP_NEW_OFFSET 4 + +#define ALT_ENTRY_SIZE 13 +#define ALT_ORIG_OFFSET 0 +#define ALT_NEW_OFFSET 4 +#define ALT_FEATURE_OFFSET 8 +#define ALT_ORIG_LEN_OFFSET 10 +#define ALT_NEW_LEN_OFFSET 11 + +#endif /* _X86_ARCH_SPECIAL_H */
tools/objtool/special.c +1 -15
@@ -14,21 +14,7 @@#include "builtin.h" #include "special.h" #include "warn.h" - -#define EX_ENTRY_SIZE 12 -#define EX_ORIG_OFFSET 0 -#define EX_NEW_OFFSET 4 - -#define JUMP_ENTRY_SIZE 16 -#define JUMP_ORIG_OFFSET 0 -#define JUMP_NEW_OFFSET 4 - -#define ALT_ENTRY_SIZE 13 -#define ALT_ORIG_OFFSET 0 -#define ALT_NEW_OFFSET 4 -#define ALT_FEATURE_OFFSET 8 -#define ALT_ORIG_LEN_OFFSET 10 -#define ALT_NEW_LEN_OFFSET 11 +#include "arch_special.h" #define X86_FEATURE_POPCNT (4*32+23)#define X86_FEATURE_SMAP (9*32+20)
Signature · 1 line
2.21.3
PATCH v2 4/9 objtool: Abstract alternative special case handling
In reply to Julien ThierrySome alternatives associated with a specific feature need to be treated in a special way. Since the features and how to treat them vary from one architecture to another, move the special case handling to arch specific code.
--- tools/objtool/arch/x86/Build | 1 + tools/objtool/arch/x86/arch_special.c | 37 +++++++++++++++++++++++++++ tools/objtool/objtool.h | 2 ++ tools/objtool/special.c | 32 ++++------------------- tools/objtool/special.h | 2 ++ tools/objtool/weak.c | 2 -- 6 files changed, 47 insertions(+), 29 deletions(-) create mode 100644 tools/objtool/arch/x86/arch_special.c
tools/objtool/arch/x86/Build +1 -0
@@ -1,3 +1,4 @@ +objtool-y += arch_special.o objtool-y += decode.o inat_tables_script = ../arch/x86/tools/gen-insn-attr-x86.awk
tools/objtool/arch/x86/arch_special.c new file +37 -0
@@ -0,0 +1,37 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +#include "../../special.h" +#include "../../builtin.h" + +#define X86_FEATURE_POPCNT (4 * 32 + 23) +#define X86_FEATURE_SMAP (9 * 32 + 20) + +void arch_handle_alternative (unsigned short feature,struct special_alt *alt) +{ +switch (feature) { +case X86_FEATURE_SMAP : +/* +* If UACCESS validation is enabled; force that alternative; +* otherwise force it the other way. +* +* What we want to avoid is having both the original and the +* alternative code flow at the same time, in that case we can +* find paths that see the STAC but take the NOP instead of +* CLAC and the other way around. +*/ +if (uaccess) + alt->skip_orig = true; +else + alt->skip_alt = true; +break ; +case X86_FEATURE_POPCNT : +/* +* It has been requested that we don't validate the !POPCNT +* feature path which is a "very very small percentage of +* machines". +*/ + alt->skip_orig = true; +break ; +default : +break ; + } +}
tools/objtool/objtool.h +2 -0
@@ -12,6 +12,8 @@#include "elf.h" +#define __weak __attribute__((weak)) +struct objtool_file {struct elf *elf;struct list_head insn_list;
tools/objtool/special.c +5 -27
@@ -16,9 +16,6 @@#include "warn.h" #include "arch_special.h" -#define X86_FEATURE_POPCNT (4*32+23) -#define X86_FEATURE_SMAP (9*32+20) -struct special_entry {const char *sec;bool group, jump_or_nop;
@@ -54,6 +51,10 @@ struct special_entry entries[] = { {}, }; +void __weak arch_handle_alternative (unsigned short feature,struct special_alt *alt) +{ +} +static int get_alt_entry (struct elf *elf,struct special_entry *entry,struct section *sec,int idx,struct special_alt *alt)
@@ -78,30 +79,7 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry, feature = *(unsigned short *)(sec->data->d_buf + offset + entry->feature); - -/* -* It has been requested that we don't validate the !POPCNT -* feature path which is a "very very small percentage of -* machines". -*/ -if (feature ==X86_FEATURE_POPCNT ) - alt->skip_orig = true; - -/* -* If UACCESS validation is enabled; force that alternative; -* otherwise force it the other way. -* -* What we want to avoid is having both the original and the -* alternative code flow at the same time, in that case we can -* find paths that see the STAC but take the NOP instead of -* CLAC and the other way around. -*/ -if (feature ==X86_FEATURE_SMAP ) { -if (uaccess) - alt->skip_orig = true; -else - alt->skip_alt = true; - } +arch_handle_alternative (feature, alt); } orig_reloc =find_reloc_by_dest (elf, sec, offset + entry->orig);
tools/objtool/special.h +2 -0
@@ -28,4 +28,6 @@ struct special_alt {int special_get_alts (struct elf *elf,struct list_head *alts); +void arch_handle_alternative (unsigned short feature,struct special_alt *alt); +#endif /* _SPECIAL_H */
tools/objtool/weak.c +0 -2
@@ -9,8 +9,6 @@#include <errno.h> #include "objtool.h" -#define __weak __attribute__((weak)) -#define UNSUPPORTED (name) \ ({ \ fprintf(stderr, "error: objtool: " name " not implemented\n"); \
Signature · 1 line
2.21.3
PATCH v2 5/9 objtool: Make relocation in alternative handling arch dependent
In reply to Julien ThierryAs pointed out by the comment in handle_group_alt(), support of relocation for instructions in an alternative group depends on whether arch specific kernel code handles it.
So, let objtool arch specific code decide whether a relocation for the alternative section should be accepted.
--- tools/objtool/arch/x86/arch_special.c | 13 +++++++++++++ tools/objtool/check.c | 19 ++++++------------- tools/objtool/check.h | 6 ++++++ tools/objtool/special.h | 4 ++++ 4 files changed, 29 insertions(+), 13 deletions(-)
tools/objtool/arch/x86/arch_special.c +13 -0
@@ -35,3 +35,16 @@ void arch_handle_alternative(unsigned short feature, struct special_alt *alt)break ; } } + +bool arch_support_alt_relocation (struct special_alt *special_alt, +struct instruction *insn, +struct reloc *reloc) +{ +/* +* The x86 alternatives code adjusts the offsets only when it +* encounters a branch instruction at the very beginning of the +* replacement group. +*/ +return insn->offset == special_alt->new_off && + (insn->type ==INSN_CALL ||is_static_jump (insn)); +}
tools/objtool/check.c +6 -13
@@ -109,12 +109,6 @@ static struct instruction *prev_insn_same_sym(struct objtool_file *file,for (insn =next_insn_same_sec (file, insn); insn; \ insn =next_insn_same_sec (file, insn)) -static bool is_static_jump(struct instruction *insn) -{ -return insn->type ==INSN_JUMP_CONDITIONAL || - insn->type ==INSN_JUMP_UNCONDITIONAL ; -} - static bool is_sibling_call(struct instruction *insn) {/* An indirect jump is either a sibling call or a jump to a table. */
@@ -866,6 +860,8 @@ static int handle_group_alt(struct objtool_file *file, alt_group = alt_group_next_index++; insn = *new_insn;sec_for_each_insn_from (file, insn) { +struct reloc *alt_reloc; +if (insn->offset >= special_alt->new_off + special_alt->new_len)break ;
@@ -882,14 +878,11 @@ static int handle_group_alt(struct objtool_file *file,* .altinstr_replacement section, unless the arch's * alternatives code can adjust the relative offsets * accordingly. -* -* The x86 alternatives code adjusts the offsets only when it -* encounters a branch instruction at the very beginning of the -* replacement group. */ -if ((insn->offset != special_alt->new_off || - (insn->type !=INSN_CALL && !is_static_jump (insn))) && -find_reloc_by_dest_range (file->elf, insn->sec, insn->offset, insn->len)) { + alt_reloc =find_reloc_by_dest_range (file->elf, insn->sec, + insn->offset, insn->len); +if (alt_reloc && + !arch_support_alt_relocation (special_alt, insn, alt_reloc)) {WARN_FUNC ("unsupported relocation in alternatives section" , insn->sec, insn->offset);
tools/objtool/check.h +6 -0
@@ -44,6 +44,12 @@ struct instruction {struct cfi_state cfi; }; +static inline bool is_static_jump (struct instruction *insn) +{ +return insn->type ==INSN_JUMP_CONDITIONAL || + insn->type ==INSN_JUMP_UNCONDITIONAL ; +} +struct instruction *find_insn (struct objtool_file *file,struct section *sec,unsigned long offset);
tools/objtool/special.h +4 -0
@@ -7,6 +7,7 @@#define _SPECIAL_H#include <stdbool.h> +#include "check.h" #include "elf.h" struct special_alt {
@@ -30,4 +31,7 @@ int special_get_alts(struct elf *elf, struct list_head *alts);void arch_handle_alternative (unsigned short feature,struct special_alt *alt); +bool arch_support_alt_relocation (struct special_alt *special_alt, +struct instruction *insn, +struct reloc *reloc);#endif /* _SPECIAL_H */
Signature · 1 line
2.21.3
Re: [PATCH v2 5/9] objtool: Make relocation in alternative handling arch dependent
Quoted 11 lines · Julien Thierry
As pointed out by the comment in
handle_group_alt(), support of relocation for instructions in an alternative group depends on whether arch specific kernel code handles it.So, let objtool arch specific code decide whether a relocation for the alternative section should be accepted.
Reviewed-by Miroslav Benes <[email protected]>Signed-off-by Julien Thierry <[email protected]>--- tools/objtool/arch/x86/arch_special.c | 13 +++++++++++++
The "arch" in "arch_special.c" is redundant, how about special.c?
Signature · 1 line
Josh
Re: [PATCH v2 5/9] objtool: Make relocation in alternative handling arch dependent
Quoted 8 lines · Josh Poimboeuf
Quoted 7 lines · Julien Thierry
As pointed out by the comment in
handle_group_alt(), support of relocation for instructions in an alternative group depends on whether arch specific kernel code handles it.So, let objtool arch specific code decide whether a relocation for the alternative section should be accepted.
Quoted 7 lines
Quoted 4 lines
Reviewed-by Miroslav Benes <[email protected]>Signed-off-by Julien Thierry <[email protected]>--- tools/objtool/arch/x86/arch_special.c | 13 +++++++++++++The "arch" in "
arch_special.c" is redundant, how aboutspecial.c?
Yes, that makes sense.
Signature · 1 line
Julien Thierry
PATCH v2 6/9 objtool: Refactor switch-tables code to support other architectures
In reply to Julien ThierryFrom: Raphael Gault <[email protected]>
The way to identify switch-tables and retrieves all the data necessary to handle the different execution branches is not the same on all architecture. In order to be able to add other architecture support, define an arch-dependent function to process jump-tables.
[J.T.: Move arm64 bits out of this patch,
Have only one function to find the start of the jump table, for now assume that the jump table format will be the same as x86]
--- tools/objtool/arch/x86/arch_special.c | 95 +++++++++++++++++++++++++++ tools/objtool/check.c | 88 +------------------------ tools/objtool/check.h | 1 - tools/objtool/special.h | 4 ++ 4 files changed, 102 insertions(+), 86 deletions(-)
tools/objtool/arch/x86/arch_special.c +95 -0
@@ -1,4 +1,6 @@// SPDX-License-Identifier: GPL-2.0-or-later +#include <string.h> +#include "../../special.h" #include "../../builtin.h"
@@ -48,3 +50,96 @@ bool arch_support_alt_relocation(struct special_alt *special_alt,return insn->offset == special_alt->new_off && (insn->type ==INSN_CALL ||is_static_jump (insn)); } + +/* +* There are 3 basic jump table patterns: +* +* 1. jmpq *[rodata addr](,%reg,8) +* +* This is the most common case by far. It jumps to an address in a simple +* jump table which is stored in .rodata. +* +* 2. jmpq *[rodata addr](%rip) +* +* This is caused by a rare GCC quirk, currently only seen in three driver +* functions in the kernel, only with certain obscure non-distro configs. +* +* As part of an optimization, GCC makes a copy of an existing switch jump +* table, modifies it, and then hard-codes the jump (albeit with an indirect +* jump) to use a single entry in the table. The rest of the jump table and +* some of its jump targets remain as dead code. +* +* In such a case we can just crudely ignore all unreachable instruction +* warnings for the entire object file. Ideally we would just ignore them +* for the function, but that would require redesigning the code quite a +* bit. And honestly that's just not worth doing: unreachable instruction +* warnings are of questionable value anyway, and this is such a rare issue. +* +* 3. mov [rodata addr],%reg1 +* ... some instructions ... +* jmpq *(%reg1,%reg2,8) +* +* This is a fairly uncommon pattern which is new for GCC 6. As of this +* writing, there are 11 occurrences of it in the allmodconfig kernel. +* +* As of GCC 7 there are quite a few more of these and the 'in between' code +* is significant. Esp. with KASAN enabled some of the code between the mov +* and jmpq uses .rodata itself, which can confuse things. +* +* TODO: Once we have DWARF CFI and smarter instruction decoding logic, +* ensure the same register is used in the mov and jump instructions. +* +* NOTE: RETPOLINE made it harder still to decode dynamic jumps. +*/ +struct reloc *arch_find_switch_table (struct objtool_file *file, +struct instruction *insn) +{ +struct reloc *text_reloc, *rodata_reloc; +struct section *table_sec; +unsigned long table_offset; + +/* look for a relocation which references .rodata */ + text_reloc =find_reloc_by_dest_range (file->elf, insn->sec, + insn->offset, insn->len); +if (!text_reloc || text_reloc->sym->type !=STT_SECTION || + !text_reloc->sym->sec->rodata) +return NULL ; + + table_offset = text_reloc->addend; + table_sec = text_reloc->sym->sec; + +if (text_reloc->type ==R_X86_64_PC32 ) + table_offset +=4 ; + +/* +* Make sure the .rodata address isn't associated with a +* symbol. GCC jump tables are anonymous data. +* +* Also support C jump tables which are in the same format as +* switch jump tables. For objtool to recognize them, they +* need to be placed in the C_JUMP_TABLE_SECTION section. They +* have symbols associated with them. +*/ +if (find_symbol_containing (table_sec, table_offset) && +strcmp (table_sec->name,C_JUMP_TABLE_SECTION )) +return NULL ; + +/* +* Each table entry has a rela associated with it. The rela +* should reference text in the same function as the original +* instruction. +*/ + rodata_reloc =find_reloc_by_dest (file->elf, table_sec, table_offset); +if (!rodata_reloc) +return NULL ; + +/* +* Use of RIP-relative switch jumps is quite rare, and +* indicates a rare GCC quirk/bug which can leave dead +* code behind. +*/ +if (text_reloc->type ==R_X86_64_PC32 ) + file->ignore_unreachables = true; + +return rodata_reloc; +}
tools/objtool/check.c +3 -85
118 lines not on this page · raw message
tools/objtool/check.h +0 -1
@@ -62,5 +62,4 @@ struct instruction *find_insn(struct objtool_file *file, insn->sec == sec; \ insn = list_next_entry(insn, list)) -#endif /* _CHECK_H */
tools/objtool/special.h +4 -0
@@ -10,6 +10,8 @@#include "check.h" #include "elf.h" +#define C_JUMP_TABLE_SECTION ".rodata..c_jump_table" +struct special_alt {struct list_head list;
@@ -34,4 +36,6 @@ void arch_handle_alternative(unsigned short feature, struct special_alt *alt);bool arch_support_alt_relocation (struct special_alt *special_alt,struct instruction *insn,struct reloc *reloc); +struct reloc *arch_find_switch_table (struct objtool_file *file, +struct instruction *insn);#endif /* _SPECIAL_H */
Signature · 1 line
2.21.3
PATCH v2 7/9 frame: Only include valid definitions depending on source file type
In reply to Julien ThierryHeader include/linux/frame.h contains both C and assembly definition that are visible regardless of the file including them.
Place definition under conditional __ASSEMBLY__.
--- include/linux/frame.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/linux/frame.h +6 -0
@@ -3,6 +3,8 @@#define _LINUX_FRAME_H#ifdef CONFIG_STACK_VALIDATION + +#ifndef __ASSEMBLY__/* * This macro marks the given function's stack frame as "non-standard", which * tells objtool to ignore the function when doing stack metadata validation.
@@ -15,6 +17,8 @@ static void __used __section(.discard.func_stack_frame_non_standard) \ *__func_stack_frame_non_standard_##func = func +#else /* __ASSEMBLY__ */ +/* * This macro indicates that the following intra-function call is valid. * Any non-annotated intra-function call will cause objtool to issue a warning.
@@ -25,6 +29,8 @@ .long 999b; \ .popsection; +#endif /* __ASSEMBLY__ */ +#else /* !CONFIG_STACK_VALIDATION */ #define STACK_FRAME_NON_STANDARD (func)
Signature · 1 line
2.21.3
PATCH v2 8/9 frame: Make unwind hints definitions available to other architectures
In reply to Julien ThierryUnwind hints are useful to provide objtool with information about stack states in non-standard functions/code.
While the type of information being provided might be very arch specific, the mechanism to provide the information can be useful for other architectures.
Move the relevant unwint hint definitions for all architectures to see.
--- arch/x86/include/asm/orc_types.h | 13 --- arch/x86/include/asm/unwind_hints.h | 44 ++-------- include/linux/frame.h | 72 ++++++++++++++++ tools/arch/x86/include/asm/orc_types.h | 13 --- tools/include/linux/frame.h | 113 +++++++++++++++++++++++++ tools/objtool/check.c | 1 + tools/objtool/sync-check.sh | 4 +- 7 files changed, 194 insertions(+), 66 deletions(-) create mode 100644 tools/include/linux/frame.h
arch/x86/include/asm/orc_types.h +0 -13
@@ -78,19 +78,6 @@ struct orc_entry { unsigned end:1; } __packed; -/* -* This struct is used by asm and inline asm code to manually annotate the -* location of registers on the stack for the ORC unwinder. -* -* Type can be either ORC_TYPE_* or UNWIND_HINT_TYPE_*. -*/ -struct unwind_hint { -u32 ip; -s16 sp_offset; -u8 sp_reg; -u8 type; -u8 end; -};#endif /* __ASSEMBLY__ */ #endif /* _ORC_TYPES_H */
arch/x86/include/asm/unwind_hints.h +5 -39
67 lines not on this page · raw message
include/linux/frame.h +72 -0
93 lines not on this page · raw message
tools/arch/x86/include/asm/orc_types.h +0 -13
@@ -78,19 +78,6 @@ struct orc_entry { unsigned end:1; } __packed; -/* -* This struct is used by asm and inline asm code to manually annotate the -* location of registers on the stack for the ORC unwinder. -* -* Type can be either ORC_TYPE_* or UNWIND_HINT_TYPE_*. -*/ -struct unwind_hint { -u32 ip; -s16 sp_offset; -u8 sp_reg; -u8 type; -u8 end; -};#endif /* __ASSEMBLY__ */ #endif /* _ORC_TYPES_H */
tools/include/linux/frame.h new file +113 -0
113 lines not on this page · raw message
tools/objtool/check.c +1 -0
@@ -14,6 +14,7 @@#include "warn.h" #include "arch_elf.h" +#include <linux/frame.h> #include <linux/hashtable.h> #include <linux/kernel.h>
tools/objtool/sync-check.sh +3 -1
@@ -3,8 +3,10 @@ TARGET_ARCH=$1 +FILES="include/linux/frame.h" + if [ "$TARGET_ARCH" == "x86" ]; then -FILES=" +FILES="$FILES arch/x86/include/asm/inat_types.h arch/x86/include/asm/orc_types.h arch/x86/include/asm/emulate_prefix.h
Signature · 1 line
2.21.3
Re: [PATCH v2 8/9] frame: Make unwind hints definitions available to other architectures
Quoted 8 lines · Julien Thierry
Unwind hints are useful to provide objtool with information about stack states in non-standard functions/code.
While the type of information being provided might be very arch specific, the mechanism to provide the information can be useful for other architectures.Move the relevant unwint hint definitions for all architectures to see.
The scope of include/linux/frame.h has been creeping, it's no longer just about frame pointers. Maybe we should rename it to objtool.h.
Signature · 1 line
Josh
Re: [PATCH v2 8/9] frame: Make unwind hints definitions available to other architectures
Quoted 7 lines · Josh Poimboeuf
Quoted 6 lines · Julien Thierry
Unwind hints are useful to provide objtool with information about stack states in non-standard functions/code.
While the type of information being provided might be very arch specific, the mechanism to provide the information can be useful for other architectures.
Quoted 6 lines
Quoted 2 lines
Move the relevant unwint hint definitions for all architectures to see.
The scope of
include/linux/frame.hhas been creeping, it's no longer just about frame pointers. Maybe we should rename it toobjtool.h.
I missed this comment until now, sorry.
The name "objtool.h" might conflict with tools/objtool/objtool.h. What about "objtool_utils.h" or "objtool_defs.h" ?
Signature · 1 line
Julien Thierry
Re: [PATCH v2 8/9] frame: Make unwind hints definitions available to other architectures
Quoted 13 lines · Julien Thierry
Quoted 10 lines · Josh Poimboeuf
Quoted 8 lines · Julien Thierry
Unwind hints are useful to provide objtool with information about stack states in non-standard functions/code.
While the type of information being provided might be very arch specific, the mechanism to provide the information can be useful for other architectures.Move the relevant unwint hint definitions for all architectures to see.
Quoted 8 lines
Quoted 3 lines
The scope of
include/linux/frame.hhas been creeping, it's no longer just about frame pointers. Maybe we should rename it toobjtool.h.I missed this comment until now, sorry.
The name "
objtool.h" might conflict withtools/objtool/objtool.h. What about "objtool_utils.h" or "objtool_defs.h" ?
There shouldn't be a conflict: objtool doesn't include kernel headers directly; and even if it did need a copy (in tools/include/linux), it would be referenced as <linux/objtool.h> instead of "objtool.h".
Signature · 1 line
Josh
PATCH v2 9/9 objtool: Abstract unwind hint reading
In reply to Julien ThierryThe type of unwind hints and the semantics associated with them depend on the architecture. Let arch specific code convert unwind hints into objtool stack state descriptions.
--- tools/objtool/arch.h | 5 +-- tools/objtool/arch/x86/decode.c | 54 ++++++++++++++++++++++++++++++ tools/objtool/cfi.h | 3 +- tools/objtool/check.c | 58 +++++---------------------------- tools/objtool/orc_gen.c | 4 ++- 5 files changed, 71 insertions(+), 53 deletions(-)
tools/objtool/arch.h +3 -2
@@ -7,12 +7,11 @@#define _ARCH_H#include <stdbool.h> +#include <linux/frame.h> #include <linux/list.h> #include "objtool.h" #include "cfi.h" -#include <asm/orc_types.h> -enum insn_type {INSN_JUMP_CONDITIONAL ,INSN_JUMP_UNCONDITIONAL ,
@@ -86,4 +85,6 @@ unsigned long arch_dest_reloc_offset(int addend);const char *arch_nop_insn (int len); +int arch_decode_insn_hint (struct instruction *insn,struct unwind_hint *hint); +#endif /* _ARCH_H */
tools/objtool/arch/x86/decode.c +54 -0
69 lines not on this page · raw message
tools/objtool/cfi.h +2 -1
@@ -29,10 +29,11 @@ struct cfi_state {struct cfi_reg cfa;int stack_size;int drap_reg, drap_offset; -unsigned char type; +unsigned char hint_type;bool bp_scratch;bool drap;bool end; + bool sp_only; };#endif /* _OBJTOOL_CFI_H */
tools/objtool/check.c +9 -49
92 lines not on this page · raw message
tools/objtool/orc_gen.c +3 -1
@@ -9,6 +9,8 @@#include "check.h" #include "warn.h" +#include <asm/orc_types.h> +struct orc_data {struct list_head list;struct instruction *insn;
@@ -92,7 +94,7 @@ int create_orc(struct objtool_file *file) orc->sp_offset = cfa->offset; orc->bp_offset = bp->offset; - orc->type = insn->cfi.type; + orc->type = insn->cfi.hint_type; }return 0 ;
Signature · 1 line
2.21.3
Re: [PATCH v2 9/9] objtool: Abstract unwind hint reading
Quoted 101 lines · Julien Thierry
The type of unwind hints and the semantics associated with them depend on the architecture. Let arch specific code convert unwind hints into objtool stack state descriptions.
Signed-off-by Julien Thierry <[email protected]>--- tools/objtool/arch.h | 5 +-- tools/objtool/arch/x86/decode.c | 54 ++++++++++++++++++++++++++++++ tools/objtool/cfi.h | 3 +- tools/objtool/check.c | 58 +++++---------------------------- tools/objtool/orc_gen.c | 4 ++- 5 files changed, 71 insertions(+), 53 deletions(-)tools/objtool/arch.h +3
-2@@ -7,12 +7,11 @@#define _ARCH_H#include <stdbool.h> +#include <linux/frame.h> #include <linux/list.h> #include "objtool.h" #include "cfi.h" -#include <asm/orc_types.h> -enum insn_type {INSN_JUMP_CONDITIONAL ,INSN_JUMP_UNCONDITIONAL ,@@ -86,4 +85,6 @@ unsigned long arch_dest_reloc_offset(int addend);const char *arch_nop_insn (int len); +int arch_decode_insn_hint (struct instruction *insn,struct unwind_hint *hint); +#endif /* _ARCH_H */ tools/objtool/arch/x86/decode.c +41
-0@@ -6,6 +6,8 @@#include <stdio.h> #include <stdlib.h> +#include <linux/frame.h> +#define unlikely (cond) (cond)#include <asm/insn.h> #include "../../../arch/x86/lib/inat.c" @@ -15,6 +17,7 @@#include "../../elf.h" #include "../../arch.h" #include "../../warn.h" +#include <asm/orc_types.h> static unsigned char op_to_cfi_reg[][2 ] = { {CFI_AX ,CFI_R8 },@@ -583,3 +586,54 @@ const char *arch_nop_insn(int len)return nops[len-1 ]; } + +int arch_decode_insn_hint (struct instruction *insn,struct unwind_hint *hint) +{ +struct cfi_reg *cfa = &insn->cfi.cfa; + +if (hint->type ==UNWIND_HINT_TYPE_RET_OFFSET ) { + insn->ret_offset = hint->sp_offset; +return 0 ; + } + + insn->hint = true; + +switch (hint->sp_reg) { +case ORC_REG_UNDEFINED : + cfa->base =CFI_UNDEFINED ; +break ; +case ORC_REG_SP : + cfa->base =CFI_SP ; +break ; +case ORC_REG_BP : + cfa->base =CFI_BP ; +break ; +case ORC_REG_SP_INDIRECT : + cfa->base =CFI_SP_INDIRECT ; +break ; +case ORC_REG_R10 : + cfa->base =CFI_R10 ; +break ; +case ORC_REG_R13 : + cfa->base =CFI_R13 ; +break ; +case ORC_REG_DI : + cfa->base =CFI_DI ; +break ; +case ORC_REG_DX : + cfa->base =CFI_DX ; +break ; +default :
tools/objtool/arch/x86/decode.c const char *arch_nop_insn(int len) · line 636
Quoted 10 lines
tools/objtool/arch/x86/decode.c +10
-0+WARN_FUNC ("unsupported unwind_hint sp base reg %d" , + insn->sec, insn->offset, hint->sp_reg); +return -1 ; + } + + cfa->offset = hint->sp_offset; + insn->cfi.hint_type = hint->type; + insn->cfi.end = hint->end; + + insn->cfi.sp_only = hint->type ==ORC_TYPE_REGS || hint->type ==ORC_TYPE_REGS_IRET ;
What does "sp" mean here in sp_only?
tools/objtool/arch/x86/decode.c const char *arch_nop_insn(int len) · line 638
Quoted 2 lines
tools/objtool/arch/x86/decode.c +2
-0+if (arch_decode_insn_hint (insn, hint)) { +WARN_FUNC ("Bad unwind hint" , insn->sec, insn->offset);
No need for a warning here, since the arch-specific function already prints one.
Signature · 1 line
Josh
Re: [PATCH v2 9/9] objtool: Abstract unwind hint reading
Quoted 106 lines · Josh Poimboeuf
Quoted 105 lines · Julien Thierry
The type of unwind hints and the semantics associated with them depend on the architecture. Let arch specific code convert unwind hints into objtool stack state descriptions.
Signed-off-by Julien Thierry <[email protected]>--- tools/objtool/arch.h | 5 +-- tools/objtool/arch/x86/decode.c | 54 ++++++++++++++++++++++++++++++ tools/objtool/cfi.h | 3 +- tools/objtool/check.c | 58 +++++---------------------------- tools/objtool/orc_gen.c | 4 ++- 5 files changed, 71 insertions(+), 53 deletions(-)tools/objtool/arch.h +3
-2@@ -7,12 +7,11 @@#define _ARCH_H#include <stdbool.h> +#include <linux/frame.h> #include <linux/list.h> #include "objtool.h" #include "cfi.h" -#include <asm/orc_types.h> -enum insn_type {INSN_JUMP_CONDITIONAL ,INSN_JUMP_UNCONDITIONAL ,@@ -86,4 +85,6 @@ unsigned long arch_dest_reloc_offset(int addend);const char *arch_nop_insn (int len); +int arch_decode_insn_hint (struct instruction *insn,struct unwind_hint *hint); +#endif /* _ARCH_H */ tools/objtool/arch/x86/decode.c +45
-0@@ -6,6 +6,8 @@#include <stdio.h> #include <stdlib.h> +#include <linux/frame.h> +#define unlikely (cond) (cond)#include <asm/insn.h> #include "../../../arch/x86/lib/inat.c" @@ -15,6 +17,7 @@#include "../../elf.h" #include "../../arch.h" #include "../../warn.h" +#include <asm/orc_types.h> static unsigned char op_to_cfi_reg[][2 ] = { {CFI_AX ,CFI_R8 },@@ -583,3 +586,54 @@ const char *arch_nop_insn(int len)return nops[len-1 ]; } + +int arch_decode_insn_hint (struct instruction *insn,struct unwind_hint *hint) +{ +struct cfi_reg *cfa = &insn->cfi.cfa; + +if (hint->type ==UNWIND_HINT_TYPE_RET_OFFSET ) { + insn->ret_offset = hint->sp_offset; +return 0 ; + } + + insn->hint = true; + +switch (hint->sp_reg) { +case ORC_REG_UNDEFINED : + cfa->base =CFI_UNDEFINED ; +break ; +case ORC_REG_SP : + cfa->base =CFI_SP ; +break ; +case ORC_REG_BP : + cfa->base =CFI_BP ; +break ; +case ORC_REG_SP_INDIRECT : + cfa->base =CFI_SP_INDIRECT ; +break ; +case ORC_REG_R10 : + cfa->base =CFI_R10 ; +break ; +case ORC_REG_R13 : + cfa->base =CFI_R13 ; +break ; +case ORC_REG_DI : + cfa->base =CFI_DI ; +break ; +case ORC_REG_DX : + cfa->base =CFI_DX ; +break ; +default : +WARN_FUNC ("unsupported unwind_hint sp base reg %d" , + insn->sec, insn->offset, hint->sp_reg); +return -1 ; + }
Quoted 9 lines
tools/objtool/arch/x86/decode.c const char *arch_nop_insn(int len) · line 636
Quoted 6 lines
tools/objtool/arch/x86/decode.c +6
-0+ + cfa->offset = hint->sp_offset; + insn->cfi.hint_type = hint->type; + insn->cfi.end = hint->end; + + insn->cfi.sp_only = hint->type ==ORC_TYPE_REGS || hint->type ==ORC_TYPE_REGS_IRET ;What does "sp" mean here in
sp_only?
Stack pointer, like in CFI_SP. When objtool encounters one of these hints, it starts to only track the stack frame with the stack pointer (no BP, no drap register, no move to temporary registers). Just trying to make some sense of this corner case.
Quoted 6 lines
tools/objtool/arch/x86/decode.c const char *arch_nop_insn(int len) · line 638
Quoted 2 lines
tools/objtool/arch/x86/decode.c +2
-0+if (arch_decode_insn_hint (insn, hint)) { +WARN_FUNC ("Bad unwind hint" , insn->sec, insn->offset);No need for a warning here, since the arch-specific function already prints one.
Right.
Thanks,
Signature · 1 line
Julien Thierry
Re: [PATCH v2 9/9] objtool: Abstract unwind hint reading
Quoted 9 lines · Julien Thierry
Quoted 8 lines
tools/objtool/arch/x86/decode.c const char *arch_nop_insn(int len) · line 636
Quoted 5 lines
tools/objtool/arch/x86/decode.c +5
-0+ cfa->offset = hint->sp_offset; + insn->cfi.hint_type = hint->type; + insn->cfi.end = hint->end; + + insn->cfi.sp_only = hint->type ==ORC_TYPE_REGS || hint->type ==ORC_TYPE_REGS_IRET ;What does "sp" mean here in
sp_only?
Quoted 4 lines
Stack pointer, like in
CFI_SP. When objtool encounters one of these hints, it starts to only track the stack frame with the stack pointer (no BP, no drap register, no move to temporary registers). Just trying to make some sense of this corner case.
I think that's not quite right, because ORC_TYPE_CALL could also be "sp_only" in some cases, by that definition.
The call to update_cfi_state_regs() is really regs-specific, not sp-specific.
Signature · 1 line
Josh
Re: [PATCH v2 9/9] objtool: Abstract unwind hint reading
Quoted 10 lines · Josh Poimboeuf
Quoted 9 lines · Julien Thierry
Quoted 8 lines
tools/objtool/arch/x86/decode.c const char *arch_nop_insn(int len) · line 636
Quoted 5 lines
tools/objtool/arch/x86/decode.c +5
-0+ cfa->offset = hint->sp_offset; + insn->cfi.hint_type = hint->type; + insn->cfi.end = hint->end; + + insn->cfi.sp_only = hint->type ==ORC_TYPE_REGS || hint->type ==ORC_TYPE_REGS_IRET ;What does "sp" mean here in
sp_only?
Quoted 8 lines
Quoted 4 lines
Stack pointer, like in
CFI_SP. When objtool encounters one of these hints, it starts to only track the stack frame with the stack pointer (no BP, no drap register, no move to temporary registers). Just trying to make some sense of this corner case.I think that's not quite right, because
ORC_TYPE_CALLcould also be "sp_only" in some cases, by that definition.
But in that case the code will still track when/if the CFI becomes pointed to by BP.
Quoted 3 lines
The call to
update_cfi_state_regs()is really regs-specific, not sp-specific.
I must admit I don't really understand what "regs" is and why exactly such an exception in stack state tracking is made where only operations to SP are taken into account.
Signature · 1 line
Julien Thierry
Re: [PATCH v2 9/9] objtool: Abstract unwind hint reading
Quoted 25 lines · Julien Thierry
Quoted 10 lines · Josh Poimboeuf
Quoted 9 lines · Julien Thierry
Quoted 8 lines
tools/objtool/arch/x86/decode.c const char *arch_nop_insn(int len) · line 636
Quoted 5 lines
tools/objtool/arch/x86/decode.c +5
-0+ cfa->offset = hint->sp_offset; + insn->cfi.hint_type = hint->type; + insn->cfi.end = hint->end; + + insn->cfi.sp_only = hint->type ==ORC_TYPE_REGS || hint->type ==ORC_TYPE_REGS_IRET ;What does "sp" mean here in
sp_only?Quoted 8 lines
Quoted 4 lines
Stack pointer, like in
CFI_SP. When objtool encounters one of these hints, it starts to only track the stack frame with the stack pointer (no BP, no drap register, no move to temporary registers). Just trying to make some sense of this corner case.I think that's not quite right, because
ORC_TYPE_CALLcould also be "sp_only" in some cases, by that definition.But in that case the code will still track when/if the CFI becomes pointed to by BP.
Quoted 7 lines
Quoted 3 lines
The call to
update_cfi_state_regs()is really regs-specific, not sp-specific.I must admit I don't really understand what "regs" is and why exactly such an exception in stack state tracking is made where only operations to SP are taken into account.
"regs" is a special type of stack frame, usually for asm entry code, where the frame is actually an instance of 'struct pt_regs'. So if there's a variable associated it with it, maybe it should have "regs" in the name.
Though I think non-x86 arches will also have regs frames, so would it make sense to just make the unwind hint types a global multiarch thing? They could be renamed to UNWIND_HINT_TYPE_REGS{_PARTIAL}. Then there wouldn't really be a need for the "sp_only" thing.
Signature · 1 line
Josh
Re: [PATCH v2 9/9] objtool: Abstract unwind hint reading
Quoted 39 lines · Josh Poimboeuf
Quoted 25 lines · Julien Thierry
Quoted 10 lines · Josh Poimboeuf
Quoted 9 lines · Julien Thierry
Quoted 8 lines
tools/objtool/arch/x86/decode.c const char *arch_nop_insn(int len) · line 636
Quoted 5 lines
tools/objtool/arch/x86/decode.c +5
-0+ cfa->offset = hint->sp_offset; + insn->cfi.hint_type = hint->type; + insn->cfi.end = hint->end; + + insn->cfi.sp_only = hint->type ==ORC_TYPE_REGS || hint->type ==ORC_TYPE_REGS_IRET ;What does "sp" mean here in
sp_only?Quoted 8 lines
Quoted 4 lines
Stack pointer, like in
CFI_SP. When objtool encounters one of these hints, it starts to only track the stack frame with the stack pointer (no BP, no drap register, no move to temporary registers). Just trying to make some sense of this corner case.I think that's not quite right, because
ORC_TYPE_CALLcould also be "sp_only" in some cases, by that definition.But in that case the code will still track when/if the CFI becomes pointed to by BP.
Quoted 7 lines
Quoted 3 lines
The call to
update_cfi_state_regs()is really regs-specific, not sp-specific.I must admit I don't really understand what "regs" is and why exactly such an exception in stack state tracking is made where only operations to SP are taken into account.
"regs" is a special type of stack frame, usually for asm entry code, where the frame is actually an instance of 'struct
pt_regs'. So if there's a variable associated it with it, maybe it should have "regs" in the name.
Quoted 5 lines
Though I think non-x86 arches will also have regs frames, so would it make sense to just make the unwind hint types a global multiarch thing? They could be renamed to UNWIND_HINT_TYPE_REGS{_PARTIAL}. Then there wouldn't really be a need for the "
sp_only" thing.
If having regs frame means having a pt_regs on the stack when procedure calls/return, then yes this will probably be the case on most archs (it is for arm64 at least.
However in that case, arm64 still builds a stack frame and sets the frame pointer, so only handling SP operations doesn't make much sense for arm64.
Also, things like ORC_TYPE_REGS_IRET don't have a use for arm64 (but maybe for other non-x86 arches it does?)
In the end that's why I left the unwind hint types as arch defined. It seems like every arch will have their specific semantics they might want to let objtool know about.
Signature · 1 line
Julien Thierry
Re: [PATCH v2 9/9] objtool: Abstract unwind hint reading
Quoted 19 lines · Julien Thierry
Quoted 13 lines
Quoted 7 lines
Quoted 3 lines
The call to
update_cfi_state_regs()is really regs-specific, not sp-specific.I must admit I don't really understand what "regs" is and why exactly such an exception in stack state tracking is made where only operations to SP are taken into account.
"regs" is a special type of stack frame, usually for asm entry code, where the frame is actually an instance of 'struct
pt_regs'. So if there's a variable associated it with it, maybe it should have "regs" in the name.Quoted 5 lines
Though I think non-x86 arches will also have regs frames, so would it make sense to just make the unwind hint types a global multiarch thing? They could be renamed to UNWIND_HINT_TYPE_REGS{_PARTIAL}. Then there wouldn't really be a need for the "
sp_only" thing.
Quoted 3 lines
If having regs frame means having a
pt_regson the stack when procedure calls/return, then yes this will probably be the case on most archs (it is for arm64 at least.
The regs frames aren't for function/procedure calls, but rather exceptions/interrupts.
Quoted 2 lines
However in that case, arm64 still builds a stack frame and sets the frame pointer, so only handling SP operations doesn't make much sense for arm64.
If for example arm64 were to switch to ORC, it could have regs-only frames in entry code just like x86.
Quoted 2 lines
Also, things like
ORC_TYPE_REGS_IRETdon't have a use for arm64 (but maybe for other non-x86 arches it does?)
If we called it TYPE_REGS_PARTIAL, at least the name would be generic enough, even if it's not used by all arches.
Quoted 3 lines
In the end that's why I left the unwind hint types as arch defined. It seems like every arch will have their specific semantics they might want to let objtool know about.
Ok, I guess I'd need to look at the code to have an opinion. If there turn out to be commonalities between the different arch unwind hints then we could always unify them later.
Signature · 1 line
Josh
[email protected]
maintainerQuoted 10 lines · Julien Thierry
Julien Thierry (8):
objtool: Group headers to check in a single list
objtool: Make sync-check consider the target architecture
objtool: Move macros describing structures to arch-dependent code
objtool: Abstract alternative special case handling
objtool: Make relocation in alternative handling arch dependent
frame: Only include valid definitions depending on source file type
frame: Make unwind hints definitions available to other architectures
objtool: Abstract unwind hint reading
Quoted 2 lines
Raphael Gault (1):
objtool: Refactor switch-tables code to support other architectures
These look OK to me, Josh?
Quoted 12 lines
I've push both series base on top of tip/objtool/core at [3].
- The first two patches make it simpler for new arches to provide their list of kernel headers, without worrying about modifications in the x86 headers.
- Patch 3 Moves arch specific macros to more suitable location
- Patches 4 and 5 add abstraction to handle alternatives
- Patch 6 adds abstraction to handle jump table
- Patches 7-9 abstracts the use of unwind hints, so some definitions can be shared across architectures while keeping arch specific semantics
Quoted 4 lines
Changes since v1 [4]:
- Rebased on recent tip/objtool/core
- Split the unwind hint rework into multiple patches as suggested by Miroslav
For remaining patches 7-9
M