public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Yu-cheng Yu <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, bp@alien8.de, mingo@kernel.org,
	brgerst@gmail.com, jpoimboe@redhat.com,
	dave.hansen@linux.intel.com, fenghua.yu@intel.com,
	ravi.v.shankar@intel.com, dvlasenk@redhat.com, hpa@zytor.com,
	dave.hansen@intel.com, sai.praneeth.prakhya@intel.com,
	yu-cheng.yu@intel.com, torvalds@linux-foundation.org,
	oleg@redhat.com, peterz@infradead.org, luto@kernel.org,
	tglx@linutronix.de, quentin.casasnovas@oracle.com
Subject: [tip:x86/fpu] x86/fpu/xstate: Fix xstate_offsets, xstate_sizes for non-extended xstates
Date: Sun, 10 Jul 2016 11:15:38 -0700	[thread overview]
Message-ID: <tip-ac73b27aea4eacdd7555f664d5fc6e1d4d1c8bf6@git.kernel.org> (raw)
In-Reply-To: <cf3ea36cf30e2a99e37da6483e65446d018ff0a7.1466179491.git.yu-cheng.yu@intel.com>

Commit-ID:  ac73b27aea4eacdd7555f664d5fc6e1d4d1c8bf6
Gitweb:     http://git.kernel.org/tip/ac73b27aea4eacdd7555f664d5fc6e1d4d1c8bf6
Author:     Yu-cheng Yu <yu-cheng.yu@intel.com>
AuthorDate: Fri, 17 Jun 2016 13:07:19 -0700
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sun, 10 Jul 2016 17:12:11 +0200

x86/fpu/xstate: Fix xstate_offsets, xstate_sizes for non-extended xstates

The arrays xstate_offsets[] and xstate_sizes[] record XSAVE standard-
format offsets and sizes. Values for non-extended state components
fpu and xmm's were not initialized or used. Ptrace format conversion
needs them. Fix it.

Signed-off-by: Yu-cheng Yu <yu-cheng.yu@intel.com>
Reviewed-by: Dave Hansen <dave.hansen@intel.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: Ravi V. Shankar <ravi.v.shankar@intel.com>
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/cf3ea36cf30e2a99e37da6483e65446d018ff0a7.1466179491.git.yu-cheng.yu@intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/fpu/xstate.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index 09bac97..f8d1aff 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -246,6 +246,15 @@ static void __init setup_xstate_features(void)
 	/* start at the beginnning of the "extended state" */
 	unsigned int last_good_offset = offsetof(struct xregs_state,
 						 extended_state_area);
+	/*
+	 * The FP xstates and SSE xstates are legacy states. They are always
+	 * in the fixed offsets in the xsave area in either compacted form
+	 * or standard form.
+	 */
+	xstate_offsets[0] = 0;
+	xstate_sizes[0] = offsetof(struct fxregs_state, xmm_space);
+	xstate_offsets[1] = xstate_sizes[0];
+	xstate_sizes[1] = FIELD_SIZEOF(struct fxregs_state, xmm_space);
 
 	for (i = FIRST_EXTENDED_XFEATURE; i < XFEATURE_MAX; i++) {
 		if (!xfeature_enabled(i))

      reply	other threads:[~2016-07-10 18:18 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-17 20:07 [PATCH 0/5] x86/fpu/xstate: Fix XSAVES issues - Part 2 Yu-cheng Yu
2016-06-17 20:07 ` [PATCH 1/5] x86/fpu/xstate: Align xstate components according to CPUID Yu-cheng Yu
2016-07-10 18:14   ` [tip:x86/fpu] " tip-bot for Yu-cheng Yu
2016-06-17 20:07 ` [PATCH 2/5] x86/fpu/xstate: Fix supervisor xstate component offset Yu-cheng Yu
2016-07-10 18:14   ` [tip:x86/fpu] " tip-bot for Yu-cheng Yu
2016-06-17 20:07 ` [PATCH 3/5] x86/fpu/xstate: Fix PTRACE frames for XSAVES Yu-cheng Yu
2016-07-10 18:14   ` [tip:x86/fpu] " tip-bot for Yu-cheng Yu
2016-06-17 20:07 ` [PATCH 4/5] x86/fpu/xstate: Fix XSTATE component offset print out Yu-cheng Yu
2016-07-10 18:15   ` [tip:x86/fpu] " tip-bot for Yu-cheng Yu
2016-06-17 20:07 ` [PATCH 5/5] x86/fpu/xstate: Fix xstate_offsets, xstate_sizes for non-extended xstates Yu-cheng Yu
2016-07-10 18:15   ` tip-bot for Yu-cheng Yu [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-ac73b27aea4eacdd7555f664d5fc6e1d4d1c8bf6@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=bp@alien8.de \
    --cc=brgerst@gmail.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dvlasenk@redhat.com \
    --cc=fenghua.yu@intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=quentin.casasnovas@oracle.com \
    --cc=ravi.v.shankar@intel.com \
    --cc=sai.praneeth.prakhya@intel.com \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.org \
    --cc=yu-cheng.yu@intel.com \
    /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