aboutsummaryrefslogtreecommitdiff
path: root/lib/test-string_helpers.c
diff options
context:
space:
mode:
authorAndy Lutomirski <[email protected]>2017-12-14 13:19:07 -0800
committerIngo Molnar <[email protected]>2017-12-15 12:21:38 +0100
commit7ee18d677989e99635027cee04c878950e0752b9 (patch)
tree4c99c0e08f55646b33583689ad7b762bccaf5e2e /lib/test-string_helpers.c
parent896c80bef4d3b357814a476663158aaf669d0fb3 (diff)
x86/power: Make restore_processor_context() sane
My previous attempt to fix a couple of bugs in __restore_processor_context(): 5b06bbcfc2c6 ("x86/power: Fix some ordering bugs in __restore_processor_context()") ... introduced yet another bug, breaking suspend-resume. Rather than trying to come up with a minimal fix, let's try to clean it up for real. This patch fixes quite a few things: - The old code saved a nonsensical subset of segment registers. The only registers that need to be saved are those that contain userspace state or those that can't be trivially restored without percpu access working. (On x86_32, we can restore percpu access by writing __KERNEL_PERCPU to %fs. On x86_64, it's easier to save and restore the kernel's GSBASE.) With this patch, we restore hardcoded values to the kernel state where applicable and explicitly restore the user state after fixing all the descriptor tables. - We used to use an unholy mix of inline asm and C helpers for segment register access. Let's get rid of the inline asm. This fixes the reported s2ram hangs and make the code all around more logical. Analyzed-by: Linus Torvalds <[email protected]> Reported-by: Jarkko Nikula <[email protected]> Reported-by: Pavel Machek <[email protected]> Tested-by: Jarkko Nikula <[email protected]> Tested-by: Pavel Machek <[email protected]> Signed-off-by: Andy Lutomirski <[email protected]> Acked-by: Rafael J. Wysocki <[email protected]> Acked-by: Thomas Gleixner <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Rafael J. Wysocki <[email protected]> Cc: Zhang Rui <[email protected]> Fixes: 5b06bbcfc2c6 ("x86/power: Fix some ordering bugs in __restore_processor_context()") Link: http://lkml.kernel.org/r/398ee68e5c0f766425a7b746becfc810840770ff.1513286253.git.luto@kernel.org Signed-off-by: Ingo Molnar <[email protected]>
Diffstat (limited to 'lib/test-string_helpers.c')
0 files changed, 0 insertions, 0 deletions