xstate.c (8459429693395ca9e8d18101300b120ad9171795) | xstate.c (62b5f7d013fc455b8db26cf01e421f4c0d264b92) |
---|---|
1/* 2 * xsave/xrstor support. 3 * 4 * Author: Suresh Siddha <suresh.b.siddha@intel.com> 5 */ 6#include <linux/compat.h> 7#include <linux/cpu.h> 8#include <linux/pkeys.h> --- 863 unchanged lines hidden (view full) --- 872 unsigned long init_val) 873{ 874 struct xregs_state *xsave = &tsk->thread.fpu.state.xsave; 875 struct pkru_state *old_pkru_state; 876 struct pkru_state new_pkru_state; 877 int pkey_shift = (pkey * PKRU_BITS_PER_PKEY); 878 u32 new_pkru_bits = 0; 879 | 1/* 2 * xsave/xrstor support. 3 * 4 * Author: Suresh Siddha <suresh.b.siddha@intel.com> 5 */ 6#include <linux/compat.h> 7#include <linux/cpu.h> 8#include <linux/pkeys.h> --- 863 unchanged lines hidden (view full) --- 872 unsigned long init_val) 873{ 874 struct xregs_state *xsave = &tsk->thread.fpu.state.xsave; 875 struct pkru_state *old_pkru_state; 876 struct pkru_state new_pkru_state; 877 int pkey_shift = (pkey * PKRU_BITS_PER_PKEY); 878 u32 new_pkru_bits = 0; 879 |
880 if (!validate_pkey(pkey)) 881 return -EINVAL; | |
882 /* 883 * This check implies XSAVE support. OSPKE only gets 884 * set if we enable XSAVE and we enable PKU in XCR0. 885 */ 886 if (!boot_cpu_has(X86_FEATURE_OSPKE)) 887 return -EINVAL; 888 889 /* Set the bits we need in PKRU */ --- 42 unchanged lines hidden --- | 880 /* 881 * This check implies XSAVE support. OSPKE only gets 882 * set if we enable XSAVE and we enable PKU in XCR0. 883 */ 884 if (!boot_cpu_has(X86_FEATURE_OSPKE)) 885 return -EINVAL; 886 887 /* Set the bits we need in PKRU */ --- 42 unchanged lines hidden --- |