More objtool fixes
Subsystems (4)
Josh Poimboeuf
maintainercover More objtool fixes
Patch 1 fixes an objtool seg fault which was seen in the error path of another bug fixed by patch 2.
Patch 3 removes an unnecessary function ignore for ORC.
Josh Poimboeuf (3):
objtool: Fix seg fault in ignore_unreachable_insn()
objtool: Fix STACK_FRAME_NON_STANDARD for cold subfunctions objtool, drm/vmwgfx: Don't ignore vmw_send_msg() for ORC
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 2 +- tools/objtool/check.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-)
Signature · 1 line
2.48.1
Josh Poimboeuf
maintainerPATCH 1/3 objtool: Fix seg fault in ignore_unreachable_insn()
Check prev_insn before dereferencing it.
--- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/objtool/check.c +1 -1
@@ -4037,7 +4037,7 @@ static bool ignore_unreachable_insn(struct objtool_file *file, struct instructio* It may also insert a UD2 after calling a __noreturn function. */ prev_insn =prev_insn_same_sec (file, insn); -if (prev_insn->dead_end && +if (prev_insn && prev_insn->dead_end && (insn->type ==INSN_BUG || (insn->type ==INSN_JUMP_UNCONDITIONAL && insn->jump_dest && insn->jump_dest->type ==INSN_BUG )))
Signature · 1 line
2.48.1
Josh Poimboeuf
maintainerPATCH 2/3 objtool: Fix STACK_FRAME_NON_STANDARD for cold subfunctions
In reply to Josh PoimboeufThe recent STACK_FRAME_NON_STANDARD refactoring forgot about .cold subfunctions. They must also be ignored.
Fixes the following warning:
drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool: vmw_recv_msg.cold+0x0: unreachable instruction
--- tools/objtool/check.c | 2 ++ 1 file changed, 2 insertions(+)
tools/objtool/check.c +2 -0
@@ -1014,6 +1014,8 @@ static int add_ignores(struct objtool_file *file) } func->ignore = true; +if (func->cfunc) + func->cfunc->ignore = true; }return 0 ;
Signature · 1 line
2.48.1
Josh Poimboeuf
maintainerPATCH 3/3 objtool, drm/vmwgfx: Don't ignore vmw_send_msg() for ORC
In reply to Josh PoimboeufThe following commit:
0b0d81e3b733 ("objtool, drm/vmwgfx: Fix "duplicate frame pointer save" warning")
... marked vmw_send_msg() STACK_FRAME_NON_STANDARD because it uses RBP in a non-standard way which violates frame pointer convention.
That issue only affects the frame pointer unwinder. Remove the annotation for ORC.
--- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c +1 -1
@@ -289,7 +289,7 @@ static int vmw_send_msg(struct rpc_channel *channel, const char *msg)return -EINVAL ; } -STACK_FRAME_NON_STANDARD (vmw_send_msg); +STACK_FRAME_NON_STANDARD_FP (vmw_send_msg);/**
Signature · 1 line
2.48.1
[tip: objtool/urgent] objtool, drm/vmwgfx: Don't ignore vmw_send_msg() for ORC
The following commit has been merged into the objtool/urgent branch of tip:
The following commit has been merged into the objtool/urgent branch of tip:
Commit-ID: ae958b12940bcd4ffa32c44684e4f2878bc5e140 Gitweb: https://git.kernel.org/tip/ae958b12940bcd4ffa32c44684e4f2878bc5e140 Author: Josh Poimboeuf <[email protected]> AuthorDate: Thu, 27 Mar 2025 22:04:23 -07:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Fri, 28 Mar 2025 14:47:02 +01:00
objtool, drm/vmwgfx: Don't ignore vmw_send_msg() for ORC
The following commit:
0b0d81e3b733 ("objtool, drm/vmwgfx: Fix "duplicate frame pointer save" warning")
... marked vmw_send_msg() STACK_FRAME_NON_STANDARD because it uses RBP in a non-standard way which violates frame pointer convention.
That issue only affects the frame pointer unwinder. Remove the annotation for ORC.
--- drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c +1 -1
@@ -289,7 +289,7 @@ static int vmw_send_msg(struct rpc_channel *channel, const char *msg)return -EINVAL ; } -STACK_FRAME_NON_STANDARD (vmw_send_msg); +STACK_FRAME_NON_STANDARD_FP (vmw_send_msg);/**
[tip: objtool/urgent] objtool: Fix STACK_FRAME_NON_STANDARD for cold subfunctions
In reply to Josh PoimboeufThe following commit has been merged into the objtool/urgent branch of tip:
The following commit has been merged into the objtool/urgent branch of tip:
Commit-ID: b5e2cc57f551a1a1e2c0ea36f77c1e26d3d13c35 Gitweb: https://git.kernel.org/tip/b5e2cc57f551a1a1e2c0ea36f77c1e26d3d13c35 Author: Josh Poimboeuf <[email protected]> AuthorDate: Thu, 27 Mar 2025 22:04:22 -07:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Fri, 28 Mar 2025 14:47:02 +01:00
objtool: Fix STACK_FRAME_NON_STANDARD for cold subfunctions
The recent STACK_FRAME_NON_STANDARD refactoring forgot about .cold subfunctions. They must also be ignored.
Fixes the following warning:
drivers/gpu/drm/vmwgfx/vmwgfx_msg.o: warning: objtool: vmw_recv_msg.cold+0x0: unreachable instruction
--- tools/objtool/check.c | 2 ++ 1 file changed, 2 insertions(+)
tools/objtool/check.c +2 -0
@@ -1014,6 +1014,8 @@ static int add_ignores(struct objtool_file *file) } func->ignore = true; +if (func->cfunc) + func->cfunc->ignore = true; }return 0 ;
[tip: objtool/urgent] objtool: Fix segfault in ignore_unreachable_insn()
In reply to Josh PoimboeufThe following commit has been merged into the objtool/urgent branch of tip:
The following commit has been merged into the objtool/urgent branch of tip:
Commit-ID: 69d41d6dafff0967565b971d950bd10443e4076c Gitweb: https://git.kernel.org/tip/69d41d6dafff0967565b971d950bd10443e4076c Author: Josh Poimboeuf <[email protected]> AuthorDate: Thu, 27 Mar 2025 22:04:21 -07:00 Committer: Ingo Molnar <[email protected]> CommitterDate: Fri, 28 Mar 2025 14:47:02 +01:00
objtool: Fix segfault in ignore_unreachable_insn()
Check 'prev_insn' before dereferencing it.
--- tools/objtool/check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/objtool/check.c +1 -1
@@ -4037,7 +4037,7 @@ static bool ignore_unreachable_insn(struct objtool_file *file, struct instructio* It may also insert a UD2 after calling a __noreturn function. */ prev_insn =prev_insn_same_sec (file, insn); -if (prev_insn->dead_end && +if (prev_insn && prev_insn->dead_end && (insn->type ==INSN_BUG || (insn->type ==INSN_JUMP_UNCONDITIONAL && insn->jump_dest && insn->jump_dest->type ==INSN_BUG )))