PM: Fix crash on graph trace through x86 suspend
Subsystems (3)
PATCH 1/1 PM: Fix crash on graph trace through x86 suspend
Pause/unpause graph tracing around do_suspend_lowlevel as it has inconsistent call/return info after it jumps to the wakeup vector. The graph trace buffer will otherwise become misaligned and may eventually crash and hang on suspend.
To reproduce the issue and test the fix:
Run a function_graph trace over suspend/resume and set the graph function to suspend_devices_and_enter. This consistently hangs the system without this fix.
--- arch/x86/kernel/acpi/sleep.c | 7 +++++++ 1 file changed, 7 insertions(+)
arch/x86/kernel/acpi/sleep.c +7 -0
@@ -16,6 +16,7 @@#include <asm/cacheflush.h> #include <asm/realmode.h> +#include <linux/ftrace.h> #include "../../realmode/rm/wakeup.h" #include "sleep.h"
@@ -107,7 +108,13 @@ int x86_acpi_suspend_lowlevel(void) saved_magic =0x123456789abcdef0L ;#endif /* CONFIG_64BIT */ +/* +* Pause/unpause graph tracing around do_suspend_lowlevel as it has +* inconsistent call/return info after it jumps to the wakeup vector +*/ +pause_graph_tracing ();do_suspend_lowlevel (); +unpause_graph_tracing ();return 0 ; }
Signature · 1 line
2.1.4
Rafael J. Wysocki
maintainerQuoted 11 lines · Todd Brandt
Pause/unpause graph tracing around
do_suspend_lowlevelas it has inconsistent call/return info after it jumps to the wakeup vector. The graph trace buffer will otherwise become misaligned and may eventually crash and hang on suspend.To reproduce the issue and test the fix:
Run afunction_graphtrace over suspend/resume and set the graph function tosuspend_devices_and_enter. This consistently hangs the system without this fix.Signed-off-by Todd Brandt <[email protected]>
OK
I guess we'll need that in -stable, right?
Quoted 37 lines
--- arch/x86/kernel/acpi/sleep.c | 7 +++++++ 1 file changed, 7 insertions(+)arch/x86/kernel/acpi/sleep.c +7
-1@@ -16,6 +16,7 @@#include <asm/cacheflush.h> #include <asm/realmode.h> +#include <linux/ftrace.h> #include "../../realmode/rm/wakeup.h" #include "sleep.h" @@ -107,7 +108,13 @@ int x86_acpi_suspend_lowlevel(void) saved_magic =0x123456789abcdef0L ;#endif /* CONFIG_64BIT */ +/* +* Pause/unpause graph tracing around do_suspend_lowlevel as it has +* inconsistent call/return info after it jumps to the wakeup vector +*/ +pause_graph_tracing ();do_suspend_lowlevel (); +unpause_graph_tracing ();return 0 ; } --2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 12 lines · Rafael J. Wysocki
Quoted 10 lines · Todd Brandt
Pause/unpause graph tracing around
do_suspend_lowlevelas it has inconsistent call/return info after it jumps to the wakeup vector. The graph trace buffer will otherwise become misaligned and may eventually crash and hang on suspend.To reproduce the issue and test the fix:
Run afunction_graphtrace over suspend/resume and set the graph function tosuspend_devices_and_enter. This consistently hangs the system without this fix.
Quoted 5 lines
Quoted 1 line
Signed-off-by Todd Brandt <[email protected]>OK
I guess we'll need that in -stable, right?
Sure, it's pretty important. The new analyze_suspend features are going to rely pretty heavily on full graph trace of suspend (all we can do is standby and freeze now because of the bug). Thanks!
Quoted 38 lines
Quoted 38 lines
--- arch/x86/kernel/acpi/sleep.c | 7 +++++++ 1 file changed, 7 insertions(+)arch/x86/kernel/acpi/sleep.c +7
-1@@ -16,6 +16,7 @@#include <asm/cacheflush.h> #include <asm/realmode.h> +#include <linux/ftrace.h> #include "../../realmode/rm/wakeup.h" #include "sleep.h" @@ -107,7 +108,13 @@ int x86_acpi_suspend_lowlevel(void) saved_magic =0x123456789abcdef0L ;#endif /* CONFIG_64BIT */ +/* +* Pause/unpause graph tracing around do_suspend_lowlevel as it has +* inconsistent call/return info after it jumps to the wakeup vector +*/ +pause_graph_tracing ();do_suspend_lowlevel (); +unpause_graph_tracing ();return 0 ; } --2.1.4
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Rafael J. Wysocki
maintainerQuoted 15 lines · Todd Brandt
Quoted 14 lines · Rafael J. Wysocki
Quoted 11 lines · Todd Brandt
Pause/unpause graph tracing around
do_suspend_lowlevelas it has inconsistent call/return info after it jumps to the wakeup vector. The graph trace buffer will otherwise become misaligned and may eventually crash and hang on suspend.To reproduce the issue and test the fix:
Run afunction_graphtrace over suspend/resume and set the graph function tosuspend_devices_and_enter. This consistently hangs the system without this fix.Signed-off-by Todd Brandt <[email protected]>
Quoted 7 lines
Quoted 3 lines
OK
I guess we'll need that in -stable, right?
Sure, it's pretty important. The new
analyze_suspendfeatures are going to rely pretty heavily on full graph trace of suspend (all we can do is standby and freeze now because of the bug). Thanks!
OK, applied, but let Steven and the x86 folks see it.
Quoted 31 lines
Quoted 31 lines
Quoted 31 lines
--- arch/x86/kernel/acpi/sleep.c | 7 +++++++ 1 file changed, 7 insertions(+)arch/x86/kernel/acpi/sleep.c +7
-0@@ -16,6 +16,7 @@#include <asm/cacheflush.h> #include <asm/realmode.h> +#include <linux/ftrace.h> #include "../../realmode/rm/wakeup.h" #include "sleep.h" @@ -107,7 +108,13 @@ int x86_acpi_suspend_lowlevel(void) saved_magic =0x123456789abcdef0L ;#endif /* CONFIG_64BIT */ +/* +* Pause/unpause graph tracing around do_suspend_lowlevel as it has +* inconsistent call/return info after it jumps to the wakeup vector +*/ +pause_graph_tracing ();do_suspend_lowlevel (); +unpause_graph_tracing ();return 0 ; }
Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
--
2.1.4--
Thanks,
Rafael
Rafael J. Wysocki
maintainerWell, fix up the Steven's address.
Quoted 66 lines · Rafael J. Wysocki
Quoted 15 lines · Todd Brandt
Quoted 14 lines · Rafael J. Wysocki
Quoted 11 lines · Todd Brandt
Pause/unpause graph tracing around
do_suspend_lowlevelas it has inconsistent call/return info after it jumps to the wakeup vector. The graph trace buffer will otherwise become misaligned and may eventually crash and hang on suspend.To reproduce the issue and test the fix:
Run afunction_graphtrace over suspend/resume and set the graph function tosuspend_devices_and_enter. This consistently hangs the system without this fix.Signed-off-by Todd Brandt <[email protected]>Quoted 7 lines
Quoted 3 lines
OK
I guess we'll need that in -stable, right?
Sure, it's pretty important. The new
analyze_suspendfeatures are going to rely pretty heavily on full graph trace of suspend (all we can do is standby and freeze now because of the bug). Thanks!OK, applied, but let Steven and the x86 folks see it.
Quoted 31 lines
Quoted 31 lines
Quoted 31 lines
--- arch/x86/kernel/acpi/sleep.c | 7 +++++++ 1 file changed, 7 insertions(+)arch/x86/kernel/acpi/sleep.c +7
-0@@ -16,6 +16,7 @@#include <asm/cacheflush.h> #include <asm/realmode.h> +#include <linux/ftrace.h> #include "../../realmode/rm/wakeup.h" #include "sleep.h" @@ -107,7 +108,13 @@ int x86_acpi_suspend_lowlevel(void) saved_magic =0x123456789abcdef0L ;#endif /* CONFIG_64BIT */ +/* +* Pause/unpause graph tracing around do_suspend_lowlevel as it has +* inconsistent call/return info after it jumps to the wakeup vector +*/ +pause_graph_tracing ();do_suspend_lowlevel (); +unpause_graph_tracing ();return 0 ; }Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
--
2.1.4--
Thanks,
Rafael
Quoted 1 line · On Thu, 3 Mar 2016 02:36:26 +0100 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 1 line
OK, applied, but let Steven and the x86 folks see it.
The below patch looks fine to me. Anything else I should look at?
-- Steve
Quoted 40 lines
Quoted 40 lines
Quoted 32 lines
Quoted 32 lines
Quoted 32 lines
--- arch/x86/kernel/acpi/sleep.c | 7 +++++++ 1 file changed, 7 insertions(+)arch/x86/kernel/acpi/sleep.c +7
-0@@ -16,6 +16,7 @@#include <asm/cacheflush.h> #include <asm/realmode.h> +#include <linux/ftrace.h> #include "../../realmode/rm/wakeup.h" #include "sleep.h" @@ -107,7 +108,13 @@ int x86_acpi_suspend_lowlevel(void) saved_magic =0x123456789abcdef0L ;#endif /* CONFIG_64BIT */ +/* +* Pause/unpause graph tracing around do_suspend_lowlevel as it has +* inconsistent call/return info after it jumps to the wakeup vector +*/ +pause_graph_tracing ();do_suspend_lowlevel (); +unpause_graph_tracing ();return 0 ; }Quoted 4 lines
Quoted 4 lines
Quoted 4 lines
--
2.1.4Thanks,
Rafael
Rafael J. Wysocki
maintainerQuoted 6 lines · Steven Rostedt
Quoted 1 line · On Thu, 3 Mar 2016 02:36:26 +0100 "Rafael J. Wysocki" <[email protected]> wrote:
Quoted 1 line
OK, applied, but let Steven and the x86 folks see it.
The below patch looks fine to me. Anything else I should look at?
No, that was it, thanks!