]> www.infradead.org Git - users/jedix/linux-maple.git/commit
mm/ioremap: pass pgprot_t to ioremap_prot() instead of unsigned long
authorRyan Roberts <ryan.roberts@arm.com>
Tue, 18 Feb 2025 10:19:54 +0000 (15:49 +0530)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 4 Mar 2025 05:50:07 +0000 (21:50 -0800)
commit893134af0f515c8eb3f65ce1d173e07fd9823837
tree112414dbbf2e250ddb83c2c5caa76ca021497f92
parentfbeae5de80b6fa43c524129c51327939c1d078eb
mm/ioremap: pass pgprot_t to ioremap_prot() instead of unsigned long

ioremap_prot() currently accepts pgprot_val parameter as an unsigned long,
thus implicitly assuming that pgprot_val and pgprot_t could never be
bigger than unsigned long.  But this assumption soon will not be true on
arm64 when using D128 pgtables.  In 128 bit page table configuration,
unsigned long is 64 bit, but pgprot_t is 128 bit.

Passing platform abstracted pgprot_t argument is better as compared to
size based data types.  Let's change the parameter to directly pass
pgprot_t like another similar helper generic_ioremap_prot().

Without this change in place, D128 configuration does not work on arm64 as
the top 64 bits gets silently stripped when passing the protection value
to this function.

Link: https://lkml.kernel.org/r/20250218101954.415331-1-anshuman.khandual@arm.com
Signed-off-by: Ryan Roberts <ryan.roberts@arm.com>
Co-developed-by: Anshuman Khandual <anshuman.khandual@arm.com>
Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com> [arm64]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
30 files changed:
arch/arc/mm/ioremap.c
arch/arm64/include/asm/io.h
arch/arm64/kernel/acpi.c
arch/arm64/mm/ioremap.c
arch/csky/include/asm/io.h
arch/loongarch/include/asm/io.h
arch/mips/include/asm/io.h
arch/mips/mm/ioremap.c
arch/mips/mm/ioremap64.c
arch/parisc/include/asm/io.h
arch/parisc/mm/ioremap.c
arch/powerpc/include/asm/io.h
arch/powerpc/mm/ioremap.c
arch/powerpc/platforms/ps3/spu.c
arch/riscv/include/asm/io.h
arch/riscv/kernel/acpi.c
arch/s390/include/asm/io.h
arch/s390/pci/pci.c
arch/sh/boards/mach-landisk/setup.c
arch/sh/boards/mach-lboxre2/setup.c
arch/sh/boards/mach-sh03/setup.c
arch/sh/include/asm/io.h
arch/sh/mm/ioremap.c
arch/x86/include/asm/io.h
arch/x86/mm/ioremap.c
arch/xtensa/include/asm/io.h
arch/xtensa/mm/ioremap.c
include/asm-generic/io.h
mm/ioremap.c
mm/memory.c