]> Git Repo - linux.git/commitdiff
x86/fpu: Fix get_xsave_addr() behavior under virtualization
authorHuaitong Han <[email protected]>
Fri, 6 Nov 2015 09:00:23 +0000 (17:00 +0800)
committerIngo Molnar <[email protected]>
Thu, 12 Nov 2015 08:34:58 +0000 (09:34 +0100)
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]>
arch/x86/kernel/fpu/xstate.c

index 6454f2731b5666e49aeda8f87d96078d564de2f2..70fc312221fc6b6c3223673c0328dfdc73c59ea6 100644 (file)
@@ -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
This page took 0.056736 seconds and 4 git commands to generate.