[lkml]   [2015]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4.3 048/125] x86/fpu: Fix get_xsave_addr() behavior under virtualization
4.3-stable review patch.  If anyone has any objections, please let me know.


From: Huaitong Han <>

commit a05917b6ba9dc9a95fc42bdcbe3a875e8ad83935 upstream.

KVM uses the get_xsave_addr() function in a different fashion from
the native kernel, in that the 'xsave' parameter belongs to guest vcpu,
not the currently running task.

But 'xsave' is replaced with current task's (host) xsave structure, so
get_xsave_addr() will incorrectly return the bad xsave address to KVM.

Fix it so that the passed in 'xsave' address is used - as intended

Signed-off-by: Huaitong Han <>
Reviewed-by: Dave Hansen <>
Cc: Andy Lutomirski <>
Cc: Paolo Bonzini <>
Cc: Borislav Petkov <>
Cc: Fenghua Yu <>
Cc: H. Peter Anvin <>
Cc: Linus Torvalds <>
Cc: Oleg Nesterov <>
Cc: Peter Zijlstra <>
Cc: Quentin Casasnovas <>
Cc: Thomas Gleixner <>
[ Tidied up the changelog. ]
Signed-off-by: Ingo Molnar <>
Signed-off-by: Greg Kroah-Hartman <>

arch/x86/kernel/fpu/xstate.c | 1 -
1 file changed, 1 deletion(-)

--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -402,7 +402,6 @@ void *get_xsave_addr(struct xregs_state
if (!boot_cpu_has(X86_FEATURE_XSAVE))
return NULL;

- xsave = &current->thread.fpu.state.xsave;
* We should not ever be requesting features that we
* have not enabled. Remember that pcntxt_mask is

 \ /
  Last update: 2015-12-07 16:21    [W:0.305 / U:0.412 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site