From: tip-bot for Huaitong Han <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: hpa@zytor.com, oleg@redhat.com, linux-kernel@vger.kernel.org,
huaitong.han@intel.com, luto@amacapital.net, tglx@linutronix.de,
peterz@infradead.org, stable@vger.kernel.org,
pbonzini@redhat.com, quentin.casasnovas@oracle.com,
torvalds@linux-foundation.org, fenghua.yu@intel.com,
mingo@kernel.org, dave.hansen@linux.intel.com, bp@alien8.de
Subject: [tip:x86/urgent] x86/fpu: Fix get_xsave_addr() behavior under virtualization
Date: Thu, 12 Nov 2015 05:28:36 -0800 [thread overview]
Message-ID: <tip-a05917b6ba9dc9a95fc42bdcbe3a875e8ad83935@git.kernel.org> (raw)
In-Reply-To: <1446800423-21622-1-git-send-email-huaitong.han@intel.com>
Commit-ID: a05917b6ba9dc9a95fc42bdcbe3a875e8ad83935
Gitweb: http://git.kernel.org/tip/a05917b6ba9dc9a95fc42bdcbe3a875e8ad83935
Author: Huaitong Han <huaitong.han@intel.com>
AuthorDate: Fri, 6 Nov 2015 17:00:23 +0800
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Thu, 12 Nov 2015 09:34:58 +0100
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 <huaitong.han@intel.com>
Reviewed-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: <stable@vger.kernel.org>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Fenghua Yu <fenghua.yu@intel.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Quentin Casasnovas <quentin.casasnovas@oracle.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
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 <mingo@kernel.org>
---
arch/x86/kernel/fpu/xstate.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 6454f27..70fc312 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 = ¤t->thread.fpu.state.xsave;
/*
* We should not ever be requesting features that we
* have not enabled. Remember that pcntxt_mask is
prev parent reply other threads:[~2015-11-12 13:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-06 9:00 [PATCH] x86/fpu: Fix get_xsave_addr which returns error pointer to KVM Huaitong Han
2015-11-10 22:40 ` Dave Hansen
2015-11-12 13:28 ` tip-bot for Huaitong Han [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-a05917b6ba9dc9a95fc42bdcbe3a875e8ad83935@git.kernel.org \
--to=tipbot@zytor.com \
--cc=bp@alien8.de \
--cc=dave.hansen@linux.intel.com \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=huaitong.han@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=oleg@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=quentin.casasnovas@oracle.com \
--cc=stable@vger.kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome