From 48fcb2dadf824a80c8e9369c89b3a2241e12f49c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 22 May 2024 14:01:39 +0000 Subject: [PATCH] Revert "ANDROID: Setting up GS before calling __restore_processor_state." This reverts commit 6767ebd98b50b646c339b9af28878f79bc6404b0. It breaks the build in the 5.10.215 and we shouldn't need it anymore because of the changes done in this area in that release. Bug: 166163480 Cc: Haitao Shan Fixes: e2e4e7b4ae79 ("Linux 5.10.215") Change-Id: I303e5e02349aa5619382f529933363e2cceed66a Signed-off-by: Greg Kroah-Hartman --- arch/x86/power/cpu.c | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c index 3cfaa19781af..84c7b2312ea9 100644 --- a/arch/x86/power/cpu.c +++ b/arch/x86/power/cpu.c @@ -279,19 +279,6 @@ static void notrace __restore_processor_state(struct saved_context *ctxt) /* Needed by apm.c */ void notrace restore_processor_state(void) { -#ifdef __clang__ - // The following code snippet is copied from __restore_processor_state. - // Its purpose is to prepare GS segment before the function is called. - // Since the function is compiled with SCS on, it will use GS at its - // entry. - // TODO: Hack to be removed later when compiler bug is fixed. -#ifdef CONFIG_X86_64 - wrmsrl(MSR_GS_BASE, saved_context.kernelmode_gs_base); -#else - loadsegment(fs, __KERNEL_PERCPU); - loadsegment(gs, __KERNEL_STACK_CANARY); -#endif -#endif __restore_processor_state(&saved_context); } #ifdef CONFIG_X86_32