^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) /* SPDX-License-Identifier: GPL-2.0-only */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) * arch/arm64/include/asm/hugetlb.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) * Copyright (C) 2013 Linaro Ltd.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) * Based on arch/x86/include/asm/hugetlb.h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #ifndef __ASM_HUGETLB_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #define __ASM_HUGETLB_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #include <asm/page.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) #ifdef CONFIG_ARCH_ENABLE_HUGEPAGE_MIGRATION
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #define arch_hugetlb_migration_supported arch_hugetlb_migration_supported
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) extern bool arch_hugetlb_migration_supported(struct hstate *h);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) #endif
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20) static inline void arch_clear_hugepage_flags(struct page *page)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22) clear_bit(PG_dcache_clean, &page->flags);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24) #define arch_clear_hugepage_flags arch_clear_hugepage_flags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) extern pte_t arch_make_huge_pte(pte_t entry, struct vm_area_struct *vma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) struct page *page, int writable);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28) #define arch_make_huge_pte arch_make_huge_pte
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29) #define __HAVE_ARCH_HUGE_SET_HUGE_PTE_AT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) extern void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) pte_t *ptep, pte_t pte);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) #define __HAVE_ARCH_HUGE_PTEP_SET_ACCESS_FLAGS
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) extern int huge_ptep_set_access_flags(struct vm_area_struct *vma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) unsigned long addr, pte_t *ptep,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) pte_t pte, int dirty);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) #define __HAVE_ARCH_HUGE_PTEP_GET_AND_CLEAR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) extern pte_t huge_ptep_get_and_clear(struct mm_struct *mm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) unsigned long addr, pte_t *ptep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39) #define __HAVE_ARCH_HUGE_PTEP_SET_WRPROTECT
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) extern void huge_ptep_set_wrprotect(struct mm_struct *mm,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41) unsigned long addr, pte_t *ptep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) #define __HAVE_ARCH_HUGE_PTEP_CLEAR_FLUSH
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43) extern void huge_ptep_clear_flush(struct vm_area_struct *vma,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) unsigned long addr, pte_t *ptep);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) #define __HAVE_ARCH_HUGE_PTE_CLEAR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) extern void huge_pte_clear(struct mm_struct *mm, unsigned long addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) pte_t *ptep, unsigned long sz);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) extern void set_huge_swap_pte_at(struct mm_struct *mm, unsigned long addr,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) pte_t *ptep, pte_t pte, unsigned long sz);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) #define set_huge_swap_pte_at set_huge_swap_pte_at
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) void __init arm64_hugetlb_cma_reserve(void);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) #include <asm-generic/hugetlb.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) #endif /* __ASM_HUGETLB_H */