2008-07-30 01:29:19 +08:00
|
|
|
#ifndef __ASM_X86_XSAVE_H
|
|
|
|
#define __ASM_X86_XSAVE_H
|
|
|
|
|
2008-07-30 08:23:16 +08:00
|
|
|
#include <linux/types.h>
|
2008-07-30 01:29:19 +08:00
|
|
|
#include <asm/processor.h>
|
2015-04-30 14:53:18 +08:00
|
|
|
#include <linux/uaccess.h>
|
2008-07-30 01:29:19 +08:00
|
|
|
|
2014-02-22 01:39:02 +08:00
|
|
|
/* Bit 63 of XCR0 is reserved for future expansion */
|
|
|
|
#define XSTATE_EXTEND_MASK (~(XSTATE_FPSSE | (1ULL << 63)))
|
2008-07-30 01:29:19 +08:00
|
|
|
|
2015-04-28 15:40:26 +08:00
|
|
|
#define XSTATE_CPUID 0x0000000d
|
|
|
|
|
2008-07-30 01:29:19 +08:00
|
|
|
#define FXSAVE_SIZE 512
|
|
|
|
|
2010-06-13 17:29:39 +08:00
|
|
|
#define XSAVE_HDR_SIZE 64
|
|
|
|
#define XSAVE_HDR_OFFSET FXSAVE_SIZE
|
|
|
|
|
|
|
|
#define XSAVE_YMM_SIZE 256
|
|
|
|
#define XSAVE_YMM_OFFSET (XSAVE_HDR_SIZE + XSAVE_HDR_OFFSET)
|
2010-05-17 17:22:23 +08:00
|
|
|
|
2013-12-05 17:15:34 +08:00
|
|
|
/* Supported features which support lazy state saving */
|
2014-02-21 05:24:51 +08:00
|
|
|
#define XSTATE_LAZY (XSTATE_FP | XSTATE_SSE | XSTATE_YMM \
|
|
|
|
| XSTATE_OPMASK | XSTATE_ZMM_Hi256 | XSTATE_Hi16_ZMM)
|
2013-12-05 17:15:34 +08:00
|
|
|
|
|
|
|
/* Supported features which require eager state saving */
|
|
|
|
#define XSTATE_EAGER (XSTATE_BNDREGS | XSTATE_BNDCSR)
|
|
|
|
|
|
|
|
/* All currently supported features */
|
|
|
|
#define XCNTXT_MASK (XSTATE_LAZY | XSTATE_EAGER)
|
2008-07-30 01:29:19 +08:00
|
|
|
|
2008-07-30 01:29:20 +08:00
|
|
|
#ifdef CONFIG_X86_64
|
|
|
|
#define REX_PREFIX "0x48, "
|
|
|
|
#else
|
|
|
|
#define REX_PREFIX
|
|
|
|
#endif
|
|
|
|
|
2008-07-30 08:23:16 +08:00
|
|
|
extern unsigned int xstate_size;
|
2015-04-24 15:20:33 +08:00
|
|
|
extern u64 xfeatures_mask;
|
2010-02-12 03:50:59 +08:00
|
|
|
extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
|
2008-07-30 01:29:19 +08:00
|
|
|
|
2010-02-12 03:50:59 +08:00
|
|
|
extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
|
2008-07-30 01:29:20 +08:00
|
|
|
|
2015-04-30 23:15:32 +08:00
|
|
|
void *get_xsave_addr(struct xregs_state *xsave, int xstate);
|
2014-05-30 02:12:44 +08:00
|
|
|
|
2008-07-30 01:29:19 +08:00
|
|
|
#endif
|