linux/debian/patches-rt/0175-x86-fpu-Disable-preemp...

42 lines
1.5 KiB
Diff
Raw Normal View History

2020-10-12 12:52:06 +00:00
From b445dff39ed67e6976db044b302b42bdfaf1d423 Mon Sep 17 00:00:00 2001
Message-Id: <b445dff39ed67e6976db044b302b42bdfaf1d423.1601675152.git.zanussi@kernel.org>
In-Reply-To: <5b5a156f9808b1acf1205606e03da117214549ea.1601675151.git.zanussi@kernel.org>
References: <5b5a156f9808b1acf1205606e03da117214549ea.1601675151.git.zanussi@kernel.org>
2018-12-14 09:55:05 +00:00
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Tue, 11 Dec 2018 15:10:33 +0100
2020-09-04 20:10:21 +00:00
Subject: [PATCH 175/333] x86/fpu: Disable preemption around local_bh_disable()
2020-10-12 12:52:06 +00:00
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.148-rt64.tar.xz
2018-12-14 09:55:05 +00:00
__fpu__restore_sig() restores the content of the FPU state in the CPUs
and in order to avoid concurency it disbles BH. On !RT it also disables
preemption but on RT we can get preempted in BH.
Add preempt_disable() while the FPU state is restored.
Cc: stable-rt@vger.kernel.org
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
---
2019-04-08 23:49:20 +00:00
arch/x86/kernel/fpu/signal.c | 2 ++
2018-12-14 09:55:05 +00:00
1 file changed, 2 insertions(+)
2019-04-08 23:49:20 +00:00
diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c
index d99a8ee9e185..5e0274a94133 100644
2018-12-14 09:55:05 +00:00
--- a/arch/x86/kernel/fpu/signal.c
+++ b/arch/x86/kernel/fpu/signal.c
2019-04-08 23:49:20 +00:00
@@ -344,10 +344,12 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size)
2018-12-14 09:55:05 +00:00
sanitize_restored_xstate(tsk, &env, xfeatures, fx_only);
}
+ preempt_disable();
local_bh_disable();
fpu->initialized = 1;
fpu__restore(fpu);
local_bh_enable();
+ preempt_enable();
return err;
} else {
2020-01-03 23:36:11 +00:00
--
2020-06-22 13:14:16 +00:00
2.17.1
2020-01-03 23:36:11 +00:00