[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20171205085538.24322-4-jslaby@suse.cz>
Date: Tue, 5 Dec 2017 09:55:37 +0100
From: Jiri Slaby <jslaby@...e.cz>
To: mingo@...hat.com
Cc: live-patching@...r.kernel.org, linux-kernel@...r.kernel.org,
Jiri Slaby <jslaby@...e.cz>,
Thomas Gleixner <tglx@...utronix.de>,
"H. Peter Anvin" <hpa@...or.com>, x86@...nel.org,
Josh Poimboeuf <jpoimboe@...hat.com>
Subject: [PATCH v2 4/5] x86/stacktrace: do not fail for ORC with regs on stack
save_stack_trace_reliable now returns "non reliable" when there are
kernel pt_regs on stack. This means an interrupt or exception happened
somewhere down the route. It is a problem for frame pointer unwinder,
because the frame might not have been set up yet when the irq happened,
so the unwinder might fail to unwind from the interrupted function.
With ORC, this is not a problem, as ORC has out-of-band data. We can
find ORC data even for the IP in the interrupted function and always
unwind one level up reliably.
So lift the check to apply only when CONFIG_FRAME_POINTER is enabled.
[v2]
- rewrite the code in favor of Josh's suggestions
Signed-off-by: Jiri Slaby <jslaby@...e.cz>
Cc: Thomas Gleixner <tglx@...utronix.de>
Cc: Ingo Molnar <mingo@...hat.com>
Cc: "H. Peter Anvin" <hpa@...or.com>
Cc: x86@...nel.org
Cc: Josh Poimboeuf <jpoimboe@...hat.com>
---
arch/x86/kernel/stacktrace.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c
index 9da8af2922b6..45915bd01692 100644
--- a/arch/x86/kernel/stacktrace.c
+++ b/arch/x86/kernel/stacktrace.c
@@ -113,7 +113,8 @@ __save_stack_trace_reliable(struct stack_trace *trace,
* or a page fault), which can make frame pointers
* unreliable.
*/
- return -EINVAL;
+ if (IS_ENABLED(CONFIG_FRAME_POINTER))
+ return -EINVAL;
}
addr = unwind_get_return_address(&state);
--
2.15.1
Powered by blists - more mailing lists