Inter-revision diff: patch 6

Comparing v3 (message) to v6 (message)

--- v3
+++ v6
@@ -21,10 +21,17 @@
 
 Tested-by: Pengfei Xu <pengfei.xu@intel.com>
 Tested-by: John Allen <john.allen@amd.com>
+Reviewed-by: Kees Cook <keescook@chromium.org>
 Suggested-by: Thomas Gleixner <tglx@linutronix.de>
 Signed-off-by: Rick Edgecombe <rick.p.edgecombe@intel.com>
 
 ---
+v6:
+ - Drop "but appear to work" (Boris)
+
+v5:
+ - Fix spelling error (Boris)
+ - Don't export fpregs_lock_and_load() (Boris)
 
 v3:
  - Rename to fpregs_lock_and_load() to match the unlocking
@@ -36,13 +43,10 @@
    accordingly.
  - fpregs_lock_and_load() suggested by tglx
  - Some commit log verbiage from dhansen
-
-v1:
- - New patch.
-
+---
  arch/x86/include/asm/fpu/api.h |  9 +++++++++
- arch/x86/kernel/fpu/core.c     | 19 +++++++++++++++++++
- 2 files changed, 28 insertions(+)
+ arch/x86/kernel/fpu/core.c     | 18 ++++++++++++++++++
+ 2 files changed, 27 insertions(+)
 
 diff --git a/arch/x86/include/asm/fpu/api.h b/arch/x86/include/asm/fpu/api.h
 index 503a577814b2..aadc6893dcaa 100644
@@ -65,19 +69,19 @@
  extern void fpregs_assert_state_consistent(void);
  #else
 diff --git a/arch/x86/kernel/fpu/core.c b/arch/x86/kernel/fpu/core.c
-index 3b28c5b25e12..8b3162badab7 100644
+index caf33486dc5e..f851558b673f 100644
 --- a/arch/x86/kernel/fpu/core.c
 +++ b/arch/x86/kernel/fpu/core.c
-@@ -756,6 +756,25 @@ void switch_fpu_return(void)
+@@ -753,6 +753,24 @@ void switch_fpu_return(void)
  }
  EXPORT_SYMBOL_GPL(switch_fpu_return);
  
 +void fpregs_lock_and_load(void)
 +{
 +	/*
-+	 * fpregs_lock() only disables preemption (mostly). So modifing state
-+	 * in an interrupt could screw up some in progress fpregs operation,
-+	 * but appear to work. Warn about it.
++	 * fpregs_lock() only disables preemption (mostly). So modifying state
++	 * in an interrupt could screw up some in progress fpregs operation.
++	 * Warn about it.
 +	 */
 +	WARN_ON_ONCE(!irq_fpu_usable());
 +	WARN_ON_ONCE(current->flags & PF_KTHREAD);
@@ -89,7 +93,6 @@
 +	if (test_thread_flag(TIF_NEED_FPU_LOAD))
 +		fpregs_restore_userregs();
 +}
-+EXPORT_SYMBOL_GPL(fpregs_lock_and_load);
 +
  #ifdef CONFIG_X86_DEBUG_FPU
  /*
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help