Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1226372 > unrolled thread
| Started by | Dave Hansen <dave@sr71.net> |
|---|---|
| First post | 2015-09-16 20:10 +0200 |
| Last post | 2015-09-16 20:10 +0200 |
| Articles | 4 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 00/26] [RFCv2] x86: Memory Protection Keys Dave Hansen <dave@sr71.net> - 2015-09-16 20:10 +0200
[PATCH 10/26] x86, pkeys: notify userspace about protection key faults Dave Hansen <dave@sr71.net> - 2015-09-16 20:10 +0200
[PATCH 15/26] x86, pkeys: optimize fault handling in access_error() Dave Hansen <dave@sr71.net> - 2015-09-16 20:10 +0200
[PATCH 05/26] x86, pkey: add PKRU xsave fields and data structure(s) Dave Hansen <dave@sr71.net> - 2015-09-16 20:10 +0200
| From | Dave Hansen <dave@sr71.net> |
|---|---|
| Date | 2015-09-16 20:10 +0200 |
| Subject | [PATCH 00/26] [RFCv2] x86: Memory Protection Keys |
| Message-ID | <q9p0e-309-3@gated-at.bofh.it> |
MM reviewers, if you are going to look at one thing, please look at patch 14 which adds a bunch of additional vma/pte permission checks. Everybody else, please take a look at the two syscall alternatives, especially the non-x86 folk. This is a second big, fat RFC. This code is not runnable to anyone outside of Intel unless they have some special hardware or a fancy simulator. If you are interested in running this for real, please get in touch with me. Hardware is available to a very small but nonzero number of people. Since the last posting, I have implemented almost all of the "software enforcement" for protection keys. Basically, in places where we look at VMA or PTE permissions, we try to enforce protection keys to make it act similarly to mprotect(). This is the part of the approach that really needs the most review and is almost entirely contained in the "check VMAs and PTEs for protection keys". I also implemented a new system call. There are basically two possibilities for plumbing protection keys out to userspace. I've included *both* approaches here: 1. Create a new system call: mprotect_key(). It's mprotect(), plus a protection key. The patches implementing this have [NEWSYSCALL] in the subject. 2. Hijack some space in the PROT_* bits and pass a protection key in there. That way, existing system calls like mmap(), mprotect(), etc... just work. The patches implementing this have [HIJACKPROT] in the subject and must be applied without the [NEWSYSCALL] ones. There is still work left to do here. Current TODO: * Build on something other than x86 * Do some more exhaustive x86 randconfig tests * Make sure DAX mappings work * Pound on some of the modified paths to ensure limited performance impact from modifications to hot paths. This set is also available here (with the new syscall): git://git.kernel.org/pub/scm/linux/kernel/git/daveh/x86-pkeys.git pkeys-v005 A version with the modification of the PROT_ syscalls is tagged as 'pkeys-v005-protsyscalls'. === diffstat (new syscall version) === Documentation/kernel-parameters.txt | 3 Documentation/x86/protection-keys.txt | 65 ++++++++++++++++++++ arch/powerpc/include/asm/mman.h | 5 - arch/x86/Kconfig | 15 ++++ arch/x86/entry/syscalls/syscall_32.tbl | 1 arch/x86/entry/syscalls/syscall_64.tbl | 1 arch/x86/include/asm/cpufeature.h | 54 ++++++++++------ arch/x86/include/asm/disabled-features.h | 12 +++ arch/x86/include/asm/fpu/types.h | 17 +++++ arch/x86/include/asm/fpu/xstate.h | 4 - arch/x86/include/asm/mmu_context.h | 66 ++++++++++++++++++++ arch/x86/include/asm/pgtable.h | 37 +++++++++++ arch/x86/include/asm/pgtable_types.h | 34 +++++++++- arch/x86/include/asm/required-features.h | 4 + arch/x86/include/asm/special_insns.h | 33 ++++++++++ arch/x86/include/uapi/asm/mman.h | 23 +++++++ arch/x86/include/uapi/asm/processor-flags.h | 2 arch/x86/kernel/cpu/common.c | 27 ++++++++ arch/x86/kernel/fpu/xstate.c | 10 ++- arch/x86/kernel/process_64.c | 2 arch/x86/kernel/setup.c | 9 ++ arch/x86/mm/fault.c | 89 ++++++++++++++++++++++++++-- arch/x86/mm/gup.c | 37 ++++++----- drivers/char/agp/frontend.c | 2 drivers/staging/android/ashmem.c | 3 fs/proc/task_mmu.c | 5 + include/asm-generic/mm_hooks.h | 12 +++ include/linux/mm.h | 15 ++++ include/linux/mman.h | 6 - include/uapi/asm-generic/siginfo.h | 11 +++ mm/Kconfig | 11 +++ mm/gup.c | 28 +++++++- mm/memory.c | 8 +- mm/mmap.c | 2 mm/mprotect.c | 20 +++++- 35 files changed, 607 insertions(+), 66 deletions(-) == FEATURE OVERVIEW == Memory Protection Keys for Userspace (PKU aka PKEYs) is a CPU feature which will be found in future Intel CPUs. The work here was done with the aid of simulators. Memory Protection Keys provides a mechanism for enforcing page-based protections, but without requiring modification of the page tables when an application changes protection domains. It works by dedicating 4 previously ignored bits in each page table entry to assigning a "protection key", giving 16 possible keys to each page mapping. There is also a new user-accessible register (PKRU) with two separate bits (Access Disable and Write Disable) for each key. Being a CPU register, PKRU is inherently thread-local, potentially giving each thread a different set of protections from every other thread. There are two new instructions (RDPKRU/WRPKRU) for reading and writing to the new register. The feature is only available in 64-bit mode, even though there is theoretically space in the PAE PTEs. These permissions are enforced on data access only and have no effect on instruction fetches. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Dave Hansen <dave@sr71.net> |
|---|---|
| Date | 2015-09-16 20:10 +0200 |
| Subject | [PATCH 10/26] x86, pkeys: notify userspace about protection key faults |
| Message-ID | <q9pjB-3D9-65@gated-at.bofh.it> |
| In reply to | #1226372 |
A protection key fault is very similar to any other access
error. There must be a VMA, etc... We even want to take
the same action (SIGSEGV) that we do with a normal access
fault.
However, we do need to let userspace know that something
is different. We do this the same way what we did with
SEGV_BNDERR with Memory Protection eXtensions (MPX):
define a new SEGV code: SEGV_PKUERR.
We also add a siginfo field: si_pkey that reveals to
userspace which protection key was set on the PTE that
we faulted on. There is no other easy way for
userspace to figure this out. They could parse smaps
but that would be a bit cruel.
---
b/arch/x86/include/asm/mmu_context.h | 15 ++++++++++
b/arch/x86/include/asm/pgtable.h | 10 ++++++
b/arch/x86/include/asm/pgtable_types.h | 5 +++
b/arch/x86/mm/fault.c | 49 ++++++++++++++++++++++++++++++++-
b/include/linux/mm.h | 2 +
b/include/uapi/asm-generic/siginfo.h | 11 ++++++-
b/mm/memory.c | 4 +-
7 files changed, 92 insertions(+), 4 deletions(-)
diff -puN arch/x86/include/asm/mmu_context.h~pkeys-09-siginfo arch/x86/include/asm/mmu_context.h
--- a/arch/x86/include/asm/mmu_context.h~pkeys-09-siginfo 2015-09-16 10:48:15.575161451 -0700
+++ b/arch/x86/include/asm/mmu_context.h 2015-09-16 10:48:15.589162086 -0700
@@ -243,4 +243,19 @@ static inline void arch_unmap(struct mm_
mpx_notify_unmap(mm, vma, start, end);
}
+static inline u16 vma_pkey(struct vm_area_struct *vma)
+{
+ u16 pkey = 0;
+#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
+ unsigned long f = vma->vm_flags;
+ pkey |= (!!(f & VM_HIGH_ARCH_0)) << 0;
+ pkey |= (!!(f & VM_HIGH_ARCH_1)) << 1;
+ pkey |= (!!(f & VM_HIGH_ARCH_2)) << 2;
+ pkey |= (!!(f & VM_HIGH_ARCH_3)) << 3;
+#endif
+
+ return pkey;
+}
+
+
#endif /* _ASM_X86_MMU_CONTEXT_H */
diff -puN arch/x86/include/asm/pgtable.h~pkeys-09-siginfo arch/x86/include/asm/pgtable.h
--- a/arch/x86/include/asm/pgtable.h~pkeys-09-siginfo 2015-09-16 10:48:15.577161542 -0700
+++ b/arch/x86/include/asm/pgtable.h 2015-09-16 10:48:15.590162131 -0700
@@ -881,6 +881,16 @@ static inline pte_t pte_swp_clear_soft_d
}
#endif
+static inline u32 pte_pkey(pte_t pte)
+{
+#ifdef CONFIG_X86_INTEL_MEMORY_PROTECTION_KEYS
+ /* ifdef to avoid doing 59-bit shift on 32-bit values */
+ return (pte_flags(pte) & _PAGE_PKEY_MASK) >> _PAGE_BIT_PKEY_BIT0;
+#else
+ return 0;
+#endif
+}
+
#include <asm-generic/pgtable.h>
#endif /* __ASSEMBLY__ */
diff -puN arch/x86/include/asm/pgtable_types.h~pkeys-09-siginfo arch/x86/include/asm/pgtable_types.h
--- a/arch/x86/include/asm/pgtable_types.h~pkeys-09-siginfo 2015-09-16 10:48:15.579161632 -0700
+++ b/arch/x86/include/asm/pgtable_types.h 2015-09-16 10:48:15.590162131 -0700
@@ -64,6 +64,11 @@
#endif
#define __HAVE_ARCH_PTE_SPECIAL
+#define _PAGE_PKEY_MASK (_PAGE_PKEY_BIT0 | \
+ _PAGE_PKEY_BIT1 | \
+ _PAGE_PKEY_BIT2 | \
+ _PAGE_PKEY_BIT3)
+
#ifdef CONFIG_KMEMCHECK
#define _PAGE_HIDDEN (_AT(pteval_t, 1) << _PAGE_BIT_HIDDEN)
#else
diff -puN arch/x86/mm/fault.c~pkeys-09-siginfo arch/x86/mm/fault.c
--- a/arch/x86/mm/fault.c~pkeys-09-siginfo 2015-09-16 10:48:15.580161678 -0700
+++ b/arch/x86/mm/fault.c 2015-09-16 10:48:15.591162177 -0700
@@ -15,12 +15,14 @@
#include <linux/context_tracking.h> /* exception_enter(), ... */
#include <linux/uaccess.h> /* faulthandler_disabled() */
+#include <asm/cpufeature.h> /* boot_cpu_has, ... */
#include <asm/traps.h> /* dotraplinkage, ... */
#include <asm/pgalloc.h> /* pgd_*(), ... */
#include <asm/kmemcheck.h> /* kmemcheck_*(), ... */
#include <asm/fixmap.h> /* VSYSCALL_ADDR */
#include <asm/vsyscall.h> /* emulate_vsyscall */
#include <asm/vm86.h> /* struct vm86 */
+#include <asm/mmu_context.h> /* vma_pkey() */
#define CREATE_TRACE_POINTS
#include <asm/trace/exceptions.h>
@@ -169,6 +171,45 @@ is_prefetch(struct pt_regs *regs, unsign
return prefetch;
}
+static u16 fetch_pkey(unsigned long address, struct task_struct *tsk)
+{
+ u16 ret;
+ spinlock_t *ptl;
+ pte_t *ptep;
+ pte_t pte;
+ int follow_ret;
+
+ if (!boot_cpu_has(X86_FEATURE_OSPKE))
+ return 0;
+
+ follow_ret = follow_pte(tsk->mm, address, &ptep, &ptl);
+ if (!follow_ret) {
+ /*
+ * On a successful follow, make sure to
+ * drop the lock.
+ */
+ pte = *ptep;
+ pte_unmap_unlock(ptep, ptl);
+ ret = pte_pkey(pte);
+ } else {
+ /*
+ * There is no PTE. Go looking for the pkey in
+ * the VMA. If we did not find a pkey violation
+ * from either the PTE or the VMA, then it must
+ * have been a fault from the hardware. Perhaps
+ * the PTE got zapped before we got in here.
+ */
+ struct vm_area_struct *vma = find_vma(tsk->mm, address);
+ if (vma) {
+ ret = vma_pkey(vma);
+ } else {
+ WARN_ONCE(1, "no PTE or VMA @ %lx\n", address);
+ ret = 0;
+ }
+ }
+ return ret;
+}
+
static void
force_sig_info_fault(int si_signo, int si_code, unsigned long address,
struct task_struct *tsk, int fault)
@@ -186,6 +227,9 @@ force_sig_info_fault(int si_signo, int s
lsb = PAGE_SHIFT;
info.si_addr_lsb = lsb;
+ if (boot_cpu_has(X86_FEATURE_OSPKE) && si_code == SEGV_PKUERR)
+ info.si_pkey = fetch_pkey(address, tsk);
+
force_sig_info(si_signo, &info, tsk);
}
@@ -842,7 +886,10 @@ static noinline void
bad_area_access_error(struct pt_regs *regs, unsigned long error_code,
unsigned long address)
{
- __bad_area(regs, error_code, address, SEGV_ACCERR);
+ if (boot_cpu_has(X86_FEATURE_OSPKE) && (error_code & PF_PK))
+ __bad_area(regs, error_code, address, SEGV_PKUERR);
+ else
+ __bad_area(regs, error_code, address, SEGV_ACCERR);
}
static void
diff -puN include/linux/mm.h~pkeys-09-siginfo include/linux/mm.h
--- a/include/linux/mm.h~pkeys-09-siginfo 2015-09-16 10:48:15.582161768 -0700
+++ b/include/linux/mm.h 2015-09-16 10:48:15.591162177 -0700
@@ -1160,6 +1160,8 @@ void unmap_mapping_range(struct address_
loff_t const holebegin, loff_t const holelen, int even_cows);
int follow_pfn(struct vm_area_struct *vma, unsigned long address,
unsigned long *pfn);
+int follow_pte(struct mm_struct *mm, unsigned long address,
+ pte_t **ptepp, spinlock_t **ptlp);
int follow_phys(struct vm_area_struct *vma, unsigned long address,
unsigned int flags, unsigned long *prot, resource_size_t *phys);
int generic_access_phys(struct vm_area_struct *vma, unsigned long addr,
diff -puN include/uapi/asm-generic/siginfo.h~pkeys-09-siginfo include/uapi/asm-generic/siginfo.h
--- a/include/uapi/asm-generic/siginfo.h~pkeys-09-siginfo 2015-09-16 10:48:15.584161859 -0700
+++ b/include/uapi/asm-generic/siginfo.h 2015-09-16 10:48:15.592162222 -0700
@@ -95,6 +95,13 @@ typedef struct siginfo {
void __user *_lower;
void __user *_upper;
} _addr_bnd;
+ int _pkey; /* FIXME: protection key value??
+ * Do we really need this in here?
+ * userspace can get the PKRU value in
+ * the signal handler, but they do not
+ * easily have access to the PKEY value
+ * from the PTE.
+ */
} _sigfault;
/* SIGPOLL */
@@ -137,6 +144,7 @@ typedef struct siginfo {
#define si_addr_lsb _sifields._sigfault._addr_lsb
#define si_lower _sifields._sigfault._addr_bnd._lower
#define si_upper _sifields._sigfault._addr_bnd._upper
+#define si_pkey _sifields._sigfault._pkey
#define si_band _sifields._sigpoll._band
#define si_fd _sifields._sigpoll._fd
#ifdef __ARCH_SIGSYS
@@ -206,7 +214,8 @@ typedef struct siginfo {
#define SEGV_MAPERR (__SI_FAULT|1) /* address not mapped to object */
#define SEGV_ACCERR (__SI_FAULT|2) /* invalid permissions for mapped object */
#define SEGV_BNDERR (__SI_FAULT|3) /* failed address bound checks */
-#define NSIGSEGV 3
+#define SEGV_PKUERR (__SI_FAULT|4) /* failed address bound checks */
+#define NSIGSEGV 4
/*
* SIGBUS si_codes
diff -puN mm/memory.c~pkeys-09-siginfo mm/memory.c
--- a/mm/memory.c~pkeys-09-siginfo 2015-09-16 10:48:15.585161904 -0700
+++ b/mm/memory.c 2015-09-16 10:48:15.593162267 -0700
@@ -3548,8 +3548,8 @@ out:
return -EINVAL;
}
-static inline int follow_pte(struct mm_struct *mm, unsigned long address,
- pte_t **ptepp, spinlock_t **ptlp)
+int follow_pte(struct mm_struct *mm, unsigned long address,
+ pte_t **ptepp, spinlock_t **ptlp)
{
int res;
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Dave Hansen <dave@sr71.net> |
|---|---|
| Date | 2015-09-16 20:10 +0200 |
| Subject | [PATCH 15/26] x86, pkeys: optimize fault handling in access_error() |
| Message-ID | <q9pjB-3D9-69@gated-at.bofh.it> |
| In reply to | #1226372 |
We might not strictly have to make modifictions to
access_error() to check the VMA here.
If we do not, we will do this:
1. app sets VMA pkey to K
2. app touches a !present page
3. do_page_fault(), allocates and maps page, sets pte.pkey=K
4. return to userspace
5. touch instruction reexecutes, but triggers PF_PK
6. do PKEY signal
What happens with this patch applied:
1. app sets VMA pkey to K
2. app touches a !present page
3. do_page_fault() notices that K is inaccessible
4. do PKEY signal
We basically skip the fault that does an allocation.
So what this lets us do is protect areas from even being
*populated* unless it is accessible according to protection
keys. That seems handy to me and makes protection keys work
more like an mprotect()'d mapping.
---
b/arch/x86/mm/fault.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff -puN arch/x86/mm/fault.c~pkeys-15-access_error arch/x86/mm/fault.c
--- a/arch/x86/mm/fault.c~pkeys-15-access_error 2015-09-16 10:48:18.012271934 -0700
+++ b/arch/x86/mm/fault.c 2015-09-16 10:48:18.016272115 -0700
@@ -889,6 +889,9 @@ static inline bool bad_area_access_from_
return false;
if (error_code & PF_PK)
return true;
+ /* this checks permission keys on the VMA: */
+ if (!arch_vma_access_permitted(vma, (error_code & PF_WRITE)))
+ return true;
return false;
}
@@ -1075,6 +1078,13 @@ access_error(unsigned long error_code, s
*/
if (error_code & PF_PK)
return 1;
+ /*
+ * Make sure to check the VMA so that we do not perform
+ * faults just to hit a PF_PK as soon as we fill in a
+ * page.
+ */
+ if (!arch_vma_access_permitted(vma, (error_code & PF_WRITE)))
+ return 1;
if (error_code & PF_WRITE) {
/* write, present and write, not present: */
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | Dave Hansen <dave@sr71.net> |
|---|---|
| Date | 2015-09-16 20:10 +0200 |
| Subject | [PATCH 05/26] x86, pkey: add PKRU xsave fields and data structure(s) |
| Message-ID | <q9pjB-3D9-71@gated-at.bofh.it> |
| In reply to | #1226372 |
The protection keys register (PKRU) is saved and restored using
xsave. Define the data structure that we will use to access it
inside the xsave buffer.
Note that we also have to widen the printk of the xsave feature
masks since this is feature 0x200 and we only did two characters
before.
---
b/arch/x86/include/asm/fpu/types.h | 16 ++++++++++++++++
b/arch/x86/include/asm/fpu/xstate.h | 4 +++-
b/arch/x86/kernel/fpu/xstate.c | 7 ++++++-
3 files changed, 25 insertions(+), 2 deletions(-)
diff -puN arch/x86/include/asm/fpu/types.h~pkeys-03-xsave arch/x86/include/asm/fpu/types.h
--- a/arch/x86/include/asm/fpu/types.h~pkeys-03-xsave 2015-09-16 10:48:13.337059990 -0700
+++ b/arch/x86/include/asm/fpu/types.h 2015-09-16 10:48:13.344060307 -0700
@@ -109,6 +109,7 @@ enum xfeature {
XFEATURE_ZMM_Hi256,
XFEATURE_Hi16_ZMM,
XFEATURE_PT_UNIMPLEMENTED_SO_FAR,
+ XFEATURE_PKRU,
XFEATURE_MAX,
};
@@ -121,6 +122,7 @@ enum xfeature {
#define XFEATURE_MASK_OPMASK (1 << XFEATURE_OPMASK)
#define XFEATURE_MASK_ZMM_Hi256 (1 << XFEATURE_ZMM_Hi256)
#define XFEATURE_MASK_Hi16_ZMM (1 << XFEATURE_Hi16_ZMM)
+#define XFEATURE_MASK_PKRU (1 << XFEATURE_PKRU)
#define XFEATURE_MASK_FPSSE (XFEATURE_MASK_FP | XFEATURE_MASK_SSE)
#define XFEATURE_MASK_AVX512 (XFEATURE_MASK_OPMASK \
@@ -213,6 +215,20 @@ struct avx_512_hi16_state {
struct reg_512_bit hi16_zmm[16];
} __packed;
+/*
+ * State component 9: 32-bit PKRU register.
+ */
+struct pkru {
+ u32 pkru;
+} __packed;
+
+struct pkru_state {
+ union {
+ struct pkru pkru;
+ u8 pad_to_8_bytes[8];
+ };
+} __packed;
+
struct xstate_header {
u64 xfeatures;
u64 xcomp_bv;
diff -puN arch/x86/include/asm/fpu/xstate.h~pkeys-03-xsave arch/x86/include/asm/fpu/xstate.h
--- a/arch/x86/include/asm/fpu/xstate.h~pkeys-03-xsave 2015-09-16 10:48:13.339060081 -0700
+++ b/arch/x86/include/asm/fpu/xstate.h 2015-09-16 10:48:13.344060307 -0700
@@ -27,7 +27,9 @@
XFEATURE_MASK_Hi16_ZMM)
/* Supported features which require eager state saving */
-#define XFEATURE_MASK_EAGER (XFEATURE_MASK_BNDREGS | XFEATURE_MASK_BNDCSR)
+#define XFEATURE_MASK_EAGER (XFEATURE_MASK_BNDREGS | \
+ XFEATURE_MASK_BNDCSR | \
+ XFEATURE_MASK_PKRU)
/* All currently supported features */
#define XCNTXT_MASK (XFEATURE_MASK_LAZY | XFEATURE_MASK_EAGER)
diff -puN arch/x86/kernel/fpu/xstate.c~pkeys-03-xsave arch/x86/kernel/fpu/xstate.c
--- a/arch/x86/kernel/fpu/xstate.c~pkeys-03-xsave 2015-09-16 10:48:13.340060126 -0700
+++ b/arch/x86/kernel/fpu/xstate.c 2015-09-16 10:48:13.344060307 -0700
@@ -23,6 +23,8 @@ static const char *xfeature_names[] =
"AVX-512 opmask" ,
"AVX-512 Hi256" ,
"AVX-512 ZMM_Hi256" ,
+ "unknown xstate feature (8)" ,
+ "Protection Keys User registers",
"unknown xstate feature" ,
};
@@ -52,6 +54,7 @@ void fpu__xstate_clear_all_cpu_caps(void
setup_clear_cpu_cap(X86_FEATURE_AVX512ER);
setup_clear_cpu_cap(X86_FEATURE_AVX512CD);
setup_clear_cpu_cap(X86_FEATURE_MPX);
+ setup_clear_cpu_cap(X86_FEATURE_PKU);
}
/*
@@ -230,7 +233,7 @@ static void __init print_xstate_feature(
const char *feature_name;
if (cpu_has_xfeatures(xstate_mask, &feature_name))
- pr_info("x86/fpu: Supporting XSAVE feature 0x%02Lx: '%s'\n", xstate_mask, feature_name);
+ pr_info("x86/fpu: Supporting XSAVE feature 0x%03Lx: '%s'\n", xstate_mask, feature_name);
}
/*
@@ -246,6 +249,7 @@ static void __init print_xstate_features
print_xstate_feature(XFEATURE_MASK_OPMASK);
print_xstate_feature(XFEATURE_MASK_ZMM_Hi256);
print_xstate_feature(XFEATURE_MASK_Hi16_ZMM);
+ print_xstate_feature(XFEATURE_MASK_PKRU);
}
/*
@@ -462,6 +466,7 @@ static void check_xstate_against_struct(
XCHECK_SZ(sz, nr, XFEATURE_OPMASK, struct avx_512_opmask_state);
XCHECK_SZ(sz, nr, XFEATURE_ZMM_Hi256, struct avx_512_zmm_uppers_state);
XCHECK_SZ(sz, nr, XFEATURE_Hi16_ZMM, struct avx_512_hi16_state);
+ XCHECK_SZ(sz, nr, XFEATURE_PKRU, struct pkru_state);
/*
* Make *SURE* to add any feature numbers in below if
_
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web