__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _ASM_POWERPC_BOOK3S_64_HASH_PKEY_H
#define _ASM_POWERPC_BOOK3S_64_HASH_PKEY_H
/* We use key 3 for KERNEL */
#define HASH_DEFAULT_KERNEL_KEY (HPTE_R_KEY_BIT0 | HPTE_R_KEY_BIT1)
static inline u64 hash__vmflag_to_pte_pkey_bits(u64 vm_flags)
{
return (((vm_flags & VM_PKEY_BIT0) ? H_PTE_PKEY_BIT0 : 0x0UL) |
((vm_flags & VM_PKEY_BIT1) ? H_PTE_PKEY_BIT1 : 0x0UL) |
((vm_flags & VM_PKEY_BIT2) ? H_PTE_PKEY_BIT2 : 0x0UL) |
((vm_flags & VM_PKEY_BIT3) ? H_PTE_PKEY_BIT3 : 0x0UL) |
((vm_flags & VM_PKEY_BIT4) ? H_PTE_PKEY_BIT4 : 0x0UL));
}
static inline u64 pte_to_hpte_pkey_bits(u64 pteflags, unsigned long flags)
{
unsigned long pte_pkey;
pte_pkey = (((pteflags & H_PTE_PKEY_BIT4) ? HPTE_R_KEY_BIT4 : 0x0UL) |
((pteflags & H_PTE_PKEY_BIT3) ? HPTE_R_KEY_BIT3 : 0x0UL) |
((pteflags & H_PTE_PKEY_BIT2) ? HPTE_R_KEY_BIT2 : 0x0UL) |
((pteflags & H_PTE_PKEY_BIT1) ? HPTE_R_KEY_BIT1 : 0x0UL) |
((pteflags & H_PTE_PKEY_BIT0) ? HPTE_R_KEY_BIT0 : 0x0UL));
if (mmu_has_feature(MMU_FTR_KUAP) ||
mmu_has_feature(MMU_FTR_BOOK3S_KUEP)) {
if ((pte_pkey == 0) && (flags & HPTE_USE_KERNEL_KEY))
return HASH_DEFAULT_KERNEL_KEY;
}
return pte_pkey;
}
static inline u16 hash__pte_to_pkey_bits(u64 pteflags)
{
return (((pteflags & H_PTE_PKEY_BIT4) ? 0x10 : 0x0UL) |
((pteflags & H_PTE_PKEY_BIT3) ? 0x8 : 0x0UL) |
((pteflags & H_PTE_PKEY_BIT2) ? 0x4 : 0x0UL) |
((pteflags & H_PTE_PKEY_BIT1) ? 0x2 : 0x0UL) |
((pteflags & H_PTE_PKEY_BIT0) ? 0x1 : 0x0UL));
}
#endif
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| hash-4k.h | File | 5.19 KB | 0644 |
|
| hash-64k.h | File | 10.03 KB | 0644 |
|
| hash-pkey.h | File | 1.51 KB | 0644 |
|
| hash.h | File | 8.47 KB | 0644 |
|
| hugetlb.h | File | 2.75 KB | 0644 |
|
| kexec.h | File | 653 B | 0644 |
|
| kup.h | File | 9.9 KB | 0644 |
|
| mmu-hash.h | File | 28.3 KB | 0644 |
|
| mmu.h | File | 7.47 KB | 0644 |
|
| pgalloc.h | File | 4.7 KB | 0644 |
|
| pgtable-64k.h | File | 496 B | 0644 |
|
| pgtable.h | File | 40.56 KB | 0644 |
|
| pkeys.h | File | 512 B | 0644 |
|
| radix-4k.h | File | 857 B | 0644 |
|
| radix-64k.h | File | 915 B | 0644 |
|
| radix.h | File | 11.78 KB | 0644 |
|
| slice.h | File | 1.22 KB | 0644 |
|
| tlbflush-hash.h | File | 2.05 KB | 0644 |
|
| tlbflush-radix.h | File | 3.41 KB | 0644 |
|
| tlbflush.h | File | 6.24 KB | 0644 |
|