]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/x86/include/asm/fpu/xstate.h
x86/fpu/xstate: Fix up bad get_xsave_addr() assumptions
[mirror_ubuntu-bionic-kernel.git] / arch / x86 / include / asm / fpu / xstate.h
CommitLineData
dc1e35c6
SS
1#ifndef __ASM_X86_XSAVE_H
2#define __ASM_X86_XSAVE_H
3
6152e4b1 4#include <linux/types.h>
dc1e35c6 5#include <asm/processor.h>
59a36d16 6#include <linux/uaccess.h>
dc1e35c6 7
56c103ec
LJ
8/* Bit 63 of XCR0 is reserved for future expansion */
9#define XSTATE_EXTEND_MASK (~(XSTATE_FPSSE | (1ULL << 63)))
dc1e35c6 10
677b98bd
IM
11#define XSTATE_CPUID 0x0000000d
12
dc1e35c6
SS
13#define FXSAVE_SIZE 512
14
2d5b5a66
SY
15#define XSAVE_HDR_SIZE 64
16#define XSAVE_HDR_OFFSET FXSAVE_SIZE
17
18#define XSAVE_YMM_SIZE 256
19#define XSAVE_YMM_OFFSET (XSAVE_HDR_SIZE + XSAVE_HDR_OFFSET)
5ee481da 20
e7d820a5 21/* Supported features which support lazy state saving */
c2bc11f1
FY
22#define XSTATE_LAZY (XSTATE_FP | XSTATE_SSE | XSTATE_YMM \
23 | XSTATE_OPMASK | XSTATE_ZMM_Hi256 | XSTATE_Hi16_ZMM)
e7d820a5
QR
24
25/* Supported features which require eager state saving */
26#define XSTATE_EAGER (XSTATE_BNDREGS | XSTATE_BNDCSR)
27
28/* All currently supported features */
29#define XCNTXT_MASK (XSTATE_LAZY | XSTATE_EAGER)
dc1e35c6 30
b359e8a4
SS
31#ifdef CONFIG_X86_64
32#define REX_PREFIX "0x48, "
33#else
34#define REX_PREFIX
35#endif
36
6152e4b1 37extern unsigned int xstate_size;
614df7fb 38extern u64 xfeatures_mask;
5b3efd50 39extern u64 xstate_fx_sw_bytes[USER_XSTATE_FX_SW_WORDS];
dc1e35c6 40
5b3efd50 41extern void update_regset_xstate_info(unsigned int size, u64 xstate_mask);
b359e8a4 42
c47ada30 43void *get_xsave_addr(struct xregs_state *xsave, int xstate);
7496d645 44
dc1e35c6 45#endif