aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuaitong Han <[email protected]>2015-11-06 17:00:23 +0800
committerIngo Molnar <[email protected]>2015-11-12 09:34:58 +0100
commita05917b6ba9dc9a95fc42bdcbe3a875e8ad83935 (patch)
treefffe4e09f04af94b9ae9b23d5604b41448d60192
parentab6b52947545a5355154f64f449f97af9d05845f (diff)
x86/fpu: Fix get_xsave_addr() behavior under virtualization
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 originally. Signed-off-by: Huaitong Han <[email protected]> Reviewed-by: Dave Hansen <[email protected]> Cc: <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Fenghua Yu <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Quentin Casasnovas <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: [email protected] Link: http://lkml.kernel.org/r/[email protected] [ Tidied up the changelog. ] Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r--arch/x86/kernel/fpu/xstate.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 6454f2731b56..70fc312221fc 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -694,7 +694,6 @@ void *get_xsave_addr(struct xregs_state *xsave, int xstate_feature)
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