Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

at v6.17 106 lines 3.4 kB view raw
1/* SPDX-License-Identifier: GPL-2.0-only */ 2/* 3 * arch/arm64/include/asm/hugetlb.h 4 * 5 * Copyright (C) 2013 Linaro Ltd. 6 * 7 * Based on arch/x86/include/asm/hugetlb.h 8 */ 9 10#ifndef __ASM_HUGETLB_H 11#define __ASM_HUGETLB_H 12 13#include <asm/cacheflush.h> 14#include <asm/mte.h> 15#include <asm/page.h> 16 17#ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION 18#define arch_hugetlb_migration_supported arch_hugetlb_migration_supported 19extern bool arch_hugetlb_migration_supported(struct hstate *h); 20#endif 21 22static inline void arch_clear_hugetlb_flags(struct folio *folio) 23{ 24 clear_bit(PG_dcache_clean, &folio->flags); 25 26#ifdef CONFIG_ARM64_MTE 27 if (system_supports_mte()) { 28 clear_bit(PG_mte_tagged, &folio->flags); 29 clear_bit(PG_mte_lock, &folio->flags); 30 } 31#endif 32} 33#define arch_clear_hugetlb_flags arch_clear_hugetlb_flags 34 35pte_t arch_make_huge_pte(pte_t entry, unsigned int shift, vm_flags_t flags); 36#define arch_make_huge_pte arch_make_huge_pte 37#define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT 38extern void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, 39 pte_t *ptep, pte_t pte, unsigned long sz); 40#define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS 41extern int huge_ptep_set_access_flags(struct vm_area_struct *vma, 42 unsigned long addr, pte_t *ptep, 43 pte_t pte, int dirty); 44#define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR 45extern pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, 46 pte_t *ptep, unsigned long sz); 47#define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT 48extern void huge_ptep_set_wrprotect(struct mm_struct *mm, 49 unsigned long addr, pte_t *ptep); 50#define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH 51extern pte_t huge_ptep_clear_flush(struct vm_area_struct *vma, 52 unsigned long addr, pte_t *ptep); 53#define __HAVE_ARCH_HUGE_PTE_CLEAR 54extern void huge_pte_clear(struct mm_struct *mm, unsigned long addr, 55 pte_t *ptep, unsigned long sz); 56#define __HAVE_ARCH_HUGE_PTEP_GET 57extern pte_t huge_ptep_get(struct mm_struct *mm, unsigned long addr, pte_t *ptep); 58 59void __init arm64_hugetlb_cma_reserve(void); 60 61#define huge_ptep_modify_prot_start huge_ptep_modify_prot_start 62extern pte_t huge_ptep_modify_prot_start(struct vm_area_struct *vma, 63 unsigned long addr, pte_t *ptep); 64 65#define huge_ptep_modify_prot_commit huge_ptep_modify_prot_commit 66extern void huge_ptep_modify_prot_commit(struct vm_area_struct *vma, 67 unsigned long addr, pte_t *ptep, 68 pte_t old_pte, pte_t new_pte); 69 70#include <asm-generic/hugetlb.h> 71 72static inline void __flush_hugetlb_tlb_range(struct vm_area_struct *vma, 73 unsigned long start, 74 unsigned long end, 75 unsigned long stride, 76 bool last_level) 77{ 78 switch (stride) { 79#ifndef __PAGETABLE_PMD_FOLDED 80 case PUD_SIZE: 81 __flush_tlb_range(vma, start, end, PUD_SIZE, last_level, 1); 82 break; 83#endif 84 case CONT_PMD_SIZE: 85 case PMD_SIZE: 86 __flush_tlb_range(vma, start, end, PMD_SIZE, last_level, 2); 87 break; 88 case CONT_PTE_SIZE: 89 __flush_tlb_range(vma, start, end, PAGE_SIZE, last_level, 3); 90 break; 91 default: 92 __flush_tlb_range(vma, start, end, PAGE_SIZE, last_level, TLBI_TTL_UNKNOWN); 93 } 94} 95 96#define __HAVE_ARCH_FLUSH_HUGETLB_TLB_RANGE 97static inline void flush_hugetlb_tlb_range(struct vm_area_struct *vma, 98 unsigned long start, 99 unsigned long end) 100{ 101 unsigned long stride = huge_page_size(hstate_vma(vma)); 102 103 __flush_hugetlb_tlb_range(vma, start, end, stride, false); 104} 105 106#endif /* __ASM_HUGETLB_H */