Re: [PATCH 8/8] mm: Drop pxd_ERROR()

From: Andreas Larsson

Date: Thu Oct 08 2026 - 05:24:54 EST


On 2026-08-31 07:43, Anshuman Khandual wrote:
> There are no more users left for any pxd_ERROR() either in generic MM or in
> the platform MM. Hence all these platform macros along with their generic
> fallback could be dropped across the tree.
>
> Cc: linux-alpha@xxxxxxxxxxxxxxx
> Cc: linux-snps-arc@xxxxxxxxxxxxxxxxxxx
> Cc: linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> Cc: linux-csky@xxxxxxxxxxxxxxx
> Cc: linux-hexagon@xxxxxxxxxxxxxxx
> Cc: loongarch@xxxxxxxxxxxxxxx
> Cc: linux-m68k@xxxxxxxxxxxxxxxxxxxx
> Cc: linux-mips@xxxxxxxxxxxxxxx
> Cc: linux-openrisc@xxxxxxxxxxxxxxx
> Cc: linux-parisc@xxxxxxxxxxxxxxx
> Cc: linuxppc-dev@xxxxxxxxxxxxxxxx
> Cc: linux-riscv@xxxxxxxxxxxxxxxxxxx
> Cc: linux-s390@xxxxxxxxxxxxxxx
> Cc: linux-sh@xxxxxxxxxxxxxxx
> Cc: sparclinux@xxxxxxxxxxxxxxx
> Cc: linux-um@xxxxxxxxxxxxxxxxxxx
> Cc: linux-arch@xxxxxxxxxxxxxxx
> Cc: linux-mm@xxxxxxxxx
> Cc: linux-kernel@xxxxxxxxxxxxxxx
> Acked-by: Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> # m68k
> Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
> Acked-by: Mike Rapoport (Microsoft) <rppt@xxxxxxxxxx>
> Signed-off-by: Anshuman Khandual <anshuman.khandual@xxxxxxx>
...> /*
> * Encode/decode swap entries and swap PTEs. Swap PTEs are all PTEs that
> * are !pte_none() && !pte_present().
> diff --git a/arch/sparc/include/asm/pgtable_32.h b/arch/sparc/include/asm/pgtable_32.h
> index f89b1250661d..5a5f54a090f5 100644
> --- a/arch/sparc/include/asm/pgtable_32.h
> +++ b/arch/sparc/include/asm/pgtable_32.h
> @@ -40,9 +40,6 @@ void load_mmu(void);
> unsigned long calc_highpages(void);
> unsigned long __init bootmem_init(unsigned long *pages_avail);
>
> -#define pte_ERROR(e) __builtin_trap()
> -#define pmd_ERROR(e) __builtin_trap()
> -#define pgd_ERROR(e) __builtin_trap()
>
> #define PTRS_PER_PTE 64
> #define PTRS_PER_PMD 64
> diff --git a/arch/sparc/include/asm/pgtable_64.h b/arch/sparc/include/asm/pgtable_64.h
> index 0837ebbc5dce..44d1333065a6 100644
> --- a/arch/sparc/include/asm/pgtable_64.h
> +++ b/arch/sparc/include/asm/pgtable_64.h
> @@ -96,16 +96,6 @@ bool kern_addr_valid(unsigned long addr);
> #define PTRS_PER_PUD (1UL << PUD_BITS)
> #define PTRS_PER_PGD (1UL << PGDIR_BITS)
>
> -#define pmd_ERROR(e) \
> - pr_err("%s:%d: bad pmd %p(%016lx) seen at (%pS)\n", \
> - __FILE__, __LINE__, &(e), pmd_val(e), __builtin_return_address(0))
> -#define pud_ERROR(e) \
> - pr_err("%s:%d: bad pud %p(%016lx) seen at (%pS)\n", \
> - __FILE__, __LINE__, &(e), pud_val(e), __builtin_return_address(0))
> -#define pgd_ERROR(e) \
> - pr_err("%s:%d: bad pgd %p(%016lx) seen at (%pS)\n", \
> - __FILE__, __LINE__, &(e), pgd_val(e), __builtin_return_address(0))
> -
> #endif /* !(__ASSEMBLER__) */

Perhaps a bit of a pity to lose the printing of the address of the pxd
that a number of architectures did before this series, but i have no
strong opinion.

Acked-by: Andreas Larsson <andreas@xxxxxxxxxxx> # sparc

Cheers,
Andreas