From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:50872 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932219AbbLGMRO (ORCPT ); Mon, 7 Dec 2015 07:17:14 -0500 Subject: Patch "x86/fpu: Fix get_xsave_addr() behavior under virtualization" has been added to the 4.2-stable tree To: huaitong.han@intel.com, bp@alien8.de, dave.hansen@linux.intel.com, fenghua.yu@intel.com, gregkh@linuxfoundation.org, hpa@zytor.com, luto@amacapital.net, mingo@kernel.org, oleg@redhat.com, pbonzini@redhat.com, peterz@infradead.org, quentin.casasnovas@oracle.com, tglx@linutronix.de, torvalds@linux-foundation.org Cc: , From: Date: Mon, 07 Dec 2015 00:15:25 -0800 Message-ID: <144947612536146@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled x86/fpu: Fix get_xsave_addr() behavior under virtualization to the 4.2-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: x86-fpu-fix-get_xsave_addr-behavior-under-virtualization.patch and it can be found in the queue-4.2 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From a05917b6ba9dc9a95fc42bdcbe3a875e8ad83935 Mon Sep 17 00:00:00 2001 From: Huaitong Han Date: Fri, 6 Nov 2015 17:00:23 +0800 Subject: x86/fpu: Fix get_xsave_addr() behavior under virtualization 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 originally. 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 Cc: dave.hansen@intel.com Link: http://lkml.kernel.org/r/1446800423-21622-1-git-send-email-huaitong.han@intel.com [ 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 = ¤t->thread.fpu.state.xsave; /* * We should not ever be requesting features that we * have not enabled. Remember that pcntxt_mask is Patches currently in stable-queue which might be from huaitong.han@intel.com are queue-4.2/x86-fpu-fix-get_xsave_addr-behavior-under-virtualization.patch