X-Git-Url: http://git.cascardo.info/?a=blobdiff_plain;f=arch%2Fx86%2Finclude%2Fasm%2Fpgtable.h;h=e997dcc6ee2bec19d7918deec02542db68335a4b;hb=a927cb83f3300bcb1ae18672e58029acddd18b33;hp=0687c4748b8f87690471c94bade518d2b768242d;hpb=79e2f8dd522873614eb31001745af487451a10de;p=cascardo%2Flinux.git diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 0687c4748b8f..e997dcc6ee2b 100644 --- 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;