Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1564827
| From | tip-bot for Kevin Hao <tipbot@zytor.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area |
| Date | 2017-01-23 10:50 +0100 |
| Message-ID | <t2Jqa-4Km-31@gated-at.bofh.it> (permalink) |
| References | <t2mae-73t-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Commit-ID: 4c833368f0bf748d4147bf301b1f95bc8eccb3c0 Gitweb: http://git.kernel.org/tip/4c833368f0bf748d4147bf301b1f95bc8eccb3c0 Author: Kevin Hao <haokexin@gmail.com> AuthorDate: Sun, 22 Jan 2017 16:50:23 +0800 Committer: Thomas Gleixner <tglx@linutronix.de> CommitDate: Mon, 23 Jan 2017 10:40:18 +0100 x86/fpu: Set the xcomp_bv when we fake up a XSAVES area I got the following calltrace on a Apollo Lake SoC with 32-bit kernel: WARNING: CPU: 2 PID: 261 at arch/x86/include/asm/fpu/internal.h:363 fpu__restore+0x1f5/0x260 [...] Hardware name: Intel Corp. Broxton P/NOTEBOOK, BIOS APLIRVPA.X64.0138.B35.1608091058 08/09/2016 Call Trace: dump_stack() __warn() ? fpu__restore() warn_slowpath_null() fpu__restore() __fpu__restore_sig() fpu__restore_sig() restore_sigcontext.isra.9() sys_sigreturn() do_int80_syscall_32() entry_INT80_32() The reason is that a #GP occurs when executing XRSTORS. The root cause is that we forget to set the xcomp_bv when we fake up the XSAVES area in the copyin_to_xsaves() function. Signed-off-by: Kevin Hao <haokexin@gmail.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Borislav Petkov <bp@alien8.de> Cc: Brian Gerst <brgerst@gmail.com> Cc: Dave Hansen <dave.hansen@linux.intel.com> Cc: Denys Vlasenko <dvlasenk@redhat.com> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Josh Poimboeuf <jpoimboe@redhat.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: Rik van Riel <riel@redhat.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Yu-cheng Yu <yu-cheng.yu@intel.com> Link: http://lkml.kernel.org/r/1485075023-30161-1-git-send-email-haokexin@gmail.com Signed-off-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- arch/x86/kernel/fpu/xstate.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index 1d77704..e287b90 100644 --- a/arch/x86/kernel/fpu/xstate.c +++ b/arch/x86/kernel/fpu/xstate.c @@ -1070,6 +1070,7 @@ int copyin_to_xsaves(const void *kbuf, const void __user *ubuf, * Add back in the features that came in from userspace: */ xsave->header.xfeatures |= xfeatures; + xsave->header.xcomp_bv = XCOMP_BV_COMPACTED_FORMAT | xsave->header.xfeatures; return 0; }
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH] x86/fpu: set the xcomp_bv when we fake up a XSAVES area Kevin Hao <haokexin@gmail.com> - 2017-01-22 10:00 +0100
[tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area tip-bot for Kevin Hao <tipbot@zytor.com> - 2017-01-23 09:30 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-23 16:40 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Yu-cheng Yu <yu-cheng.yu@intel.com> - 2017-01-23 18:00 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-23 18:30 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Yu-cheng Yu <yu-cheng.yu@intel.com> - 2017-01-23 22:10 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-23 22:20 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Yu-cheng Yu <yu-cheng.yu@intel.com> - 2017-01-23 22:30 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-23 22:30 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Kevin Hao <haokexin@gmail.com> - 2017-01-24 01:20 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-24 02:00 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Kevin Hao <haokexin@gmail.com> - 2017-01-24 03:00 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-24 03:10 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Kevin Hao <haokexin@gmail.com> - 2017-01-24 03:20 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Dave Hansen <dave.hansen@linux.intel.com> - 2017-01-24 03:40 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Kevin Hao <haokexin@gmail.com> - 2017-01-24 06:20 +0100
Re: [tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area Ingo Molnar <mingo@kernel.org> - 2017-01-24 09:10 +0100
[tip:x86/urgent] x86/fpu: Set the xcomp_bv when we fake up a XSAVES area tip-bot for Kevin Hao <tipbot@zytor.com> - 2017-01-23 10:50 +0100
csiph-web