projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
x86/mm/pkeys: Add functions to fetch PKRU
[cascardo/linux.git]
/
arch
/
x86
/
include
/
asm
/
pgtable.h
diff --git
a/arch/x86/include/asm/pgtable.h
b/arch/x86/include/asm/pgtable.h
index
0687c47
..
e997dcc
100644
(file)
--- a/
arch/x86/include/asm/pgtable.h
+++ b/
arch/x86/include/asm/pgtable.h
@@
-99,6
+99,14
@@
static inline int pte_dirty(pte_t pte)
return pte_flags(pte) & _PAGE_DIRTY;
}
+
+static inline u32 read_pkru(void)
+{
+ if (boot_cpu_has(X86_FEATURE_OSPKE))
+ return __read_pkru();
+ return 0;
+}
+
static inline int pte_young(pte_t pte)
{
return pte_flags(pte) & _PAGE_ACCESSED;