diff mbox series

[4/5] arm64/mm: Implement pXX_leaf_size() support

Message ID 20201113113426.586434333@infradead.org (mailing list archive)
State Not Applicable
Headers show
Series perf/mm: Fix PERF_SAMPLE_*_PAGE_SIZE | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch warning Failed to apply on branch powerpc/merge (80ecbe16c827714ce3741ed1f1d34488b903e717)
snowpatch_ozlabs/apply_patch warning Failed to apply on branch powerpc/next (3cea11cd5e3b00d91caf0b4730194039b45c5891)
snowpatch_ozlabs/apply_patch warning Failed to apply on branch linus/master (585e5b17b92dead8a3aca4e3c9876fbca5f7e0ba)
snowpatch_ozlabs/apply_patch warning Failed to apply on branch powerpc/fixes (01776f070ffcbf336be3bf1672bd3c589548d6c4)
snowpatch_ozlabs/apply_patch success Successfully applied on branch linux-next (92edc4aef86780a8ad01b092c6d6630bb3cb423d)
snowpatch_ozlabs/checkpatch warning total: 0 errors, 0 warnings, 1 checks, 9 lines checked
snowpatch_ozlabs/needsstable success Patch has no Fixes tags

Commit Message

Peter Zijlstra Nov. 13, 2020, 11:19 a.m. UTC
ARM64 has non-pagetable aligned large page support with PTE_CONT, when
this bit is set the page is part of a super-page. Match the hugetlb
code and support these super pages for PTE and PMD levels.

This enables PERF_SAMPLE_{DATA,CODE}_PAGE_SIZE to report accurate TLB
page sizes.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 arch/arm64/include/asm/pgtable.h |    3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

--- a/arch/arm64/include/asm/pgtable.h
+++ b/arch/arm64/include/asm/pgtable.h
@@ -503,6 +503,9 @@  extern pgprot_t phys_mem_access_prot(str
 				 PMD_TYPE_SECT)
 #define pmd_leaf(pmd)		pmd_sect(pmd)
 
+#define pmd_leaf_size(pmd)	(pmd_cont(pmd) ? CONT_PMD_SIZE : PMD_SIZE)
+#define pte_leaf_size(pte)	(pte_cont(pte) ? CONT_PTE_SIZE : PAGE_SIZE)
+
 #if defined(CONFIG_ARM64_64K_PAGES) || CONFIG_PGTABLE_LEVELS < 3
 static inline bool pud_sect(pud_t pud) { return false; }
 static inline bool pud_table(pud_t pud) { return true; }