2008-07-29 10:29:19 -07:00
|
|
|
#ifndef __ASM_X86_XSAVE_H
|
|
|
|
#define __ASM_X86_XSAVE_H
|
|
|
|
|
2008-07-29 17:23:16 -07:00
|
|
|
#include <linux/types.h>
|
2008-07-29 10:29:19 -07:00
|
|
|
#include <asm/processor.h>
|
2015-04-30 08:53:18 +02:00
|
|
|
#include <linux/uaccess.h>
|
2008-07-29 10:29:19 -07:00
|
|
|
|
2014-02-21 17:39:02 +00:00
|
|
|
/* Bit 63 of XCR0 is reserved for future expansion */
|
|
|
|
#define XSTATE_EXTEND_MASK (~(XSTATE_FPSSE | (1ULL << 63)))
|
2008-07-29 10:29:19 -07:00
|
|
|
|
2015-04-28 09:40:26 +02:00
|
|
|
#define XSTATE_CPUID 0x0000000d
|
|
|
|
|
2008-07-29 10:29:19 -07: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-20 13: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-29 10:29:19 -07:00
|
|
|
|
2008-07-29 10:29:20 -07:00
|
|
|
#ifdef CONFIG_X86_64
|
|
|
|
#define REX_PREFIX "0x48, "
|
|
|
|
#else
|
|
|
|
#define REX_PREFIX
|
|
|
|
#endif
|
|
|
|
|
2008-07-29 17:23:16 -07:00
|
|
|
extern unsigned int xstate_size;
|
2015-04-24 09:20:33 +02:00
|
|
|
extern u64 xfeatures_mask;
|
2010-02-11 11:50:59 -08:00
|
|
|
extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
|
2008-07-29 10:29:19 -07:00
|
|
|
|
2010-02-11 11:50:59 -08:00
|
|
|
extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
|
2008-07-29 10:29:20 -07:00
|
|
|
|
2015-04-30 17:15:32 +02:00
|
|
|
void *get_xsave_addr(struct xregs_state *xsave, int xstate);
|
2014-05-29 11:12:44 -07:00
|
|
|
|
2008-07-29 10:29:19 -07:00
|
|
|
#endif
|