summaryrefslogtreecommitdiffstats
path: root/sys/i386/isa
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-02-23 18:38:41 +0000
committerjhb <jhb@FreeBSD.org>2015-02-23 18:38:41 +0000
commit4ee9c49971462598e86cded5dec28bd933b91fc9 (patch)
tree8d545a55b1f8a364c5e8fe792781dcb94afc7a15 /sys/i386/isa
parentbddd935ed9588effa40aa2a0581dc92d44e4c10c (diff)
downloadFreeBSD-src-4ee9c49971462598e86cded5dec28bd933b91fc9.zip
FreeBSD-src-4ee9c49971462598e86cded5dec28bd933b91fc9.tar.gz
MFC 274817,274878,276801,276840,278976:
Improve support for XSAVE with debuggers. - Dump an NT_X86_XSTATE note if XSAVE is in use. This note is designed to match what Linux does in that 1) it dumps the entire XSAVE area including the fxsave state, and 2) it stashes a copy of the current xsave mask in the unused padding between the fxsave state and the xstate header at the same location used by Linux. - Teach readelf() to recognize NT_X86_XSTATE notes. - Change PT_GET/SETXSTATE to take the entire XSAVE state instead of only the extra portion. This avoids having to always make two ptrace() calls to get or set the full XSAVE state. - Add a PT_GET_XSTATE_INFO which returns the length of the current XSTATE save area (so the size of the buffer needed for PT_GETXSTATE) and the current XSAVE mask (%xcr0).
Diffstat (limited to 'sys/i386/isa')
-rw-r--r--sys/i386/isa/npx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/i386/isa/npx.c b/sys/i386/isa/npx.c
index 0034f2d..8cc8118 100644
--- a/sys/i386/isa/npx.c
+++ b/sys/i386/isa/npx.c
@@ -201,6 +201,13 @@ CTASSERT(sizeof(struct savefpu_ymm) == 832);
*/
CTASSERT(sizeof(struct pcb) % XSAVE_AREA_ALIGN == 0);
+/*
+ * Ensure the copy of XCR0 saved in a core is contained in the padding
+ * area.
+ */
+CTASSERT(X86_XSTATE_XCR0_OFFSET >= offsetof(struct savexmm, sv_pad) &&
+ X86_XSTATE_XCR0_OFFSET + sizeof(uint64_t) <= sizeof(struct savexmm));
+
static void fpu_clean_state(void);
#endif
OpenPOWER on IntegriCloud