]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
arm64/mm: Rename ptdesc_t
authorAnshuman Khandual <anshuman.khandual@arm.com>
Wed, 20 May 2026 06:34:17 +0000 (07:34 +0100)
committerWill Deacon <will@kernel.org>
Fri, 5 Jun 2026 10:44:36 +0000 (11:44 +0100)
ptdesc_t sounds very similar to the core MM struct ptdesc which is actually
the memory descriptor for page table allocations. Hence rename this typedef
element as ptval_t instead for better clarity and separation.

Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Will Deacon <will@kernel.org>
Cc: David Hildenbrand <david@kernel.org>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: linux-efi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-arm-kernel@lists.infradead.org
Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Suggested-by: David Hildenbrand (Arm) <david@kernel.org>
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/include/asm/io.h
arch/arm64/include/asm/pgtable-types.h
arch/arm64/include/asm/ptdump.h
arch/arm64/include/asm/tlbflush.h
arch/arm64/kernel/efi.c
arch/arm64/kernel/pi/map_kernel.c
arch/arm64/kernel/pi/map_range.c
arch/arm64/kernel/pi/pi.h
arch/arm64/mm/mmap.c
arch/arm64/mm/pageattr.c
arch/arm64/mm/ptdump.c

index 8cbd1e96fd50bfe2671b314254b58cb34a44dfa1..21c8e400107cae88c0eafc3646c3ee8d255ba4bd 100644 (file)
@@ -270,7 +270,7 @@ static inline void __iomem *ioremap_prot(phys_addr_t phys, size_t size,
                                         pgprot_t user_prot)
 {
        pgprot_t prot;
-       ptdesc_t user_prot_val = pgprot_val(user_prot);
+       ptval_t user_prot_val = pgprot_val(user_prot);
 
        if (WARN_ON_ONCE(!(user_prot_val & PTE_USER)))
                return NULL;
index 265e8301d7ba8f7db8370db6988682414537bbd7..2f2f5527930f5c724825580cb0ed4c5d0f5e000a 100644 (file)
  * Generic page table descriptor format from which
  * all level specific descriptors can be derived.
  */
-typedef u64 ptdesc_t;
+typedef u64 ptval_t;
 
-typedef ptdesc_t pteval_t;
-typedef ptdesc_t pmdval_t;
-typedef ptdesc_t pudval_t;
-typedef ptdesc_t p4dval_t;
-typedef ptdesc_t pgdval_t;
+typedef ptval_t pteval_t;
+typedef ptval_t pmdval_t;
+typedef ptval_t pudval_t;
+typedef ptval_t p4dval_t;
+typedef ptval_t pgdval_t;
 
 /*
  * These are used to make use of C type-checking..
@@ -54,7 +54,7 @@ typedef struct { pgdval_t pgd; } pgd_t;
 #define pgd_val(x)     ((x).pgd)
 #define __pgd(x)       ((pgd_t) { (x) } )
 
-typedef struct { ptdesc_t pgprot; } pgprot_t;
+typedef struct { ptval_t pgprot; } pgprot_t;
 #define pgprot_val(x)  ((x).pgprot)
 #define __pgprot(x)    ((pgprot_t) { (x) } )
 
index baff24004459ea1f70b9afe9920729eec99504b4..5b374a6ab34a4e433f5c09ee091f0d5af1bbb266 100644 (file)
@@ -26,8 +26,8 @@ struct ptdump_info {
 };
 
 struct ptdump_prot_bits {
-       ptdesc_t        mask;
-       ptdesc_t        val;
+       ptval_t mask;
+       ptval_t val;
        const char      *set;
        const char      *clear;
 };
@@ -36,7 +36,7 @@ struct ptdump_pg_level {
        const struct ptdump_prot_bits *bits;
        char name[4];
        int num;
-       ptdesc_t mask;
+       ptval_t mask;
 };
 
 /*
@@ -53,7 +53,7 @@ struct ptdump_pg_state {
        const struct mm_struct *mm;
        unsigned long start_address;
        int level;
-       ptdesc_t current_prot;
+       ptval_t current_prot;
        bool check_wx;
        unsigned long wx_pages;
        unsigned long uxn_pages;
index c0bf5b39804119e64ca2a8c194859f72ac9e83e0..d52ac8c17190da490b97ce2f8ea2ea42744cb648 100644 (file)
@@ -725,9 +725,9 @@ static inline void arch_tlbbatch_add_pending(struct arch_tlbflush_unmap_batch *b
        sme_dvmsync_add_pending(batch, mm);
 }
 
-static inline bool __pte_flags_need_flush(ptdesc_t oldval, ptdesc_t newval)
+static inline bool __pte_flags_need_flush(ptval_t oldval, ptval_t newval)
 {
-       ptdesc_t diff = oldval ^ newval;
+       ptval_t diff = oldval ^ newval;
 
        /* invalid to valid transition requires no flush */
        if (!(oldval & PTE_VALID))
index a81cb4aa47388439d0179a98f8c887b5ffdc90fb..30cd7f8043986ad8467c5cc205c9e285d8403bd7 100644 (file)
@@ -31,7 +31,7 @@ static bool region_is_misaligned(const efi_memory_desc_t *md)
  * executable, everything else can be mapped with the XN bits
  * set. Also take the new (optional) RO/XP bits into account.
  */
-static __init ptdesc_t create_mapping_protection(efi_memory_desc_t *md)
+static __init ptval_t create_mapping_protection(efi_memory_desc_t *md)
 {
        u64 attr = md->attribute;
        u32 type = md->type;
@@ -85,7 +85,7 @@ static __init ptdesc_t create_mapping_protection(efi_memory_desc_t *md)
 
 int __init efi_create_mapping(struct mm_struct *mm, efi_memory_desc_t *md)
 {
-       ptdesc_t prot_val = create_mapping_protection(md);
+       ptval_t prot_val = create_mapping_protection(md);
        bool page_mappings_only = (md->type == EFI_RUNTIME_SERVICES_CODE ||
                                   md->type == EFI_RUNTIME_SERVICES_DATA);
 
index a852264958c36bc4ca6e960b5d8c1c2bbfcbfe7a..fb44cbdd2f2927370727aa3d9e31dd3d9f6664cd 100644 (file)
@@ -165,7 +165,7 @@ static void noinline __section(".idmap.text") set_ttbr0_for_lpa2(phys_addr_t ttb
 static void __init remap_idmap_for_lpa2(void)
 {
        /* clear the bits that change meaning once LPA2 is turned on */
-       ptdesc_t mask = PTE_SHARED;
+       ptval_t mask = PTE_SHARED;
 
        /*
         * We have to clear bits [9:8] in all block or page descriptors in the
index de52cd85c691934ded312663613c6dee4c3fc5db..761b14893f74861e253b2624b666d8e24765dfc1 100644 (file)
@@ -31,7 +31,7 @@ void __init map_range(phys_addr_t *pte, u64 start, u64 end, phys_addr_t pa,
                      u64 va_offset)
 {
        u64 cmask = (level == 3) ? CONT_PTE_SIZE - 1 : U64_MAX;
-       ptdesc_t protval = pgprot_val(prot) & ~PTE_TYPE_MASK;
+       ptval_t protval = pgprot_val(prot) & ~PTE_TYPE_MASK;
        int lshift = (3 - level) * PTDESC_TABLE_SHIFT;
        u64 lmask = (PAGE_SIZE << lshift) - 1;
 
@@ -88,7 +88,7 @@ void __init map_range(phys_addr_t *pte, u64 start, u64 end, phys_addr_t pa,
        }
 }
 
-asmlinkage phys_addr_t __init create_init_idmap(pgd_t *pg_dir, ptdesc_t clrmask)
+asmlinkage phys_addr_t __init create_init_idmap(pgd_t *pg_dir, ptval_t clrmask)
 {
        phys_addr_t ptep = (phys_addr_t)pg_dir + PAGE_SIZE; /* MMU is off */
        pgprot_t text_prot = PAGE_KERNEL_ROX;
index aec3172d400332a705c619f6e12c8112c4f632c0..5dfd8484d2005c8103fb14d0124039fdd0a2ddfd 100644 (file)
@@ -35,4 +35,4 @@ void map_range(phys_addr_t *pte, u64 start, u64 end, phys_addr_t pa,
 
 asmlinkage void early_map_kernel(u64 boot_status, phys_addr_t fdt);
 
-asmlinkage phys_addr_t create_init_idmap(pgd_t *pgd, ptdesc_t clrmask);
+asmlinkage phys_addr_t create_init_idmap(pgd_t *pgd, ptval_t clrmask);
index 92b2f5097a96c160f2425f1e11cb61ee326beace..32e0771d6477b081a4f8eea2e683289bcb51bd2b 100644 (file)
@@ -34,7 +34,7 @@ static pgprot_t protection_map[16] __ro_after_init = {
        [VM_SHARED | VM_EXEC | VM_WRITE | VM_READ]      = PAGE_SHARED_EXEC
 };
 
-static ptdesc_t gcs_page_prot __ro_after_init = _PAGE_GCS_RO;
+static ptval_t gcs_page_prot __ro_after_init = _PAGE_GCS_RO;
 
 /*
  * You really shouldn't be using read() or write() on /dev/mem.  This might go
@@ -87,7 +87,7 @@ arch_initcall(adjust_protection_map);
 
 pgprot_t vm_get_page_prot(vm_flags_t vm_flags)
 {
-       ptdesc_t prot;
+       ptval_t prot;
 
        /* Short circuit GCS to avoid bloating the table. */
        if (system_supports_gcs() && (vm_flags & VM_SHADOW_STACK)) {
index ce035e1b4eaf66656c233f65ddc2b25e9acf4c51..bbe98ac9ad8c674cb8457ff56903424158bc1942 100644 (file)
@@ -21,7 +21,7 @@ struct page_change_data {
        pgprot_t clear_mask;
 };
 
-static ptdesc_t set_pageattr_masks(ptdesc_t val, struct mm_walk *walk)
+static ptval_t set_pageattr_masks(ptval_t val, struct mm_walk *walk)
 {
        struct page_change_data *masks = walk->private;
 
index ab9899ca1e5f211542c114e2513ee9d15c75e743..1c20144700d7d711f3442f1f33815b9b0c34000f 100644 (file)
@@ -194,7 +194,7 @@ void note_page(struct ptdump_state *pt_st, unsigned long addr, int level,
        struct ptdump_pg_state *st = container_of(pt_st, struct ptdump_pg_state, ptdump);
        struct ptdump_pg_level *pg_level = st->pg_level;
        static const char units[] = "KMGTPE";
-       ptdesc_t prot = 0;
+       ptval_t prot = 0;
 
        /* check if the current level has been folded dynamically */
        if (st->mm && ((level == 1 && mm_p4d_folded(st->mm)) ||