linux-stable/arch/arm64/mm
Ard Biesheuvel 84b04d3e6b arm64: kernel: Create initial ID map from C code
The asm code that creates the initial ID map is rather intricate and
hard to follow. This is problematic because it makes adding support for
things like LPA2 or WXN more difficult than necessary. Also, it is
parameterized like the rest of the MM code to run with a configurable
number of levels, which is rather pointless, given that all AArch64 CPUs
implement support for 48-bit virtual addressing, and that many systems
exist with DRAM located outside of the 39-bit addressable range, which
is the only smaller VA size that is widely used, and we need additional
tricks to make things work in that combination.

So let's bite the bullet, and rip out all the asm macros, and fiddly
code, and replace it with a C implementation based on the newly added
routines for creating the early kernel VA mappings. And while at it,
create the initial ID map based on 48-bit virtual addressing as well,
regardless of the number of configured levels for the kernel proper.

Note that this code may execute with the MMU and caches disabled, and is
therefore not permitted to make unaligned accesses. This shouldn't
generally happen in any case for the algorithm as implemented, but to be
sure, let's pass -mstrict-align to the compiler just in case.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20240214122845.2033971-66-ardb+git@google.com
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
2024-02-16 12:42:34 +00:00
..
Makefile arm64: mm: move fixmap code to its own file 2023-04-11 18:55:28 +01:00
cache.S efi: arm64: enter with MMU and caches enabled 2023-01-24 11:51:08 +00:00
context.c arm64/mm: remove now-superfluous ISBs from TTBR writes 2023-06-15 17:47:54 +01:00
copypage.c arm64: Also reset KASAN tag if page is not PG_mte_tagged 2023-05-16 14:58:54 +01:00
dma-mapping.c iommu: Remove struct iommu_ops *iommu from arch_setup_dma_ops() 2023-12-12 10:18:45 +01:00
extable.c arm64: extable: cleanup redundant extable type EX_TYPE_FIXUP 2022-06-28 12:11:47 +01:00
fault.c arch/mm/fault: fix major fault accounting when retrying under per-VMA lock 2023-12-29 11:06:49 -08:00
fixmap.c arm64: mm: Move fixmap region above vmemmap region 2024-02-09 10:56:11 +00:00
flush.c arm64: implement the new page table range API 2023-08-24 16:20:20 -07:00
hugetlbpage.c mm, treewide: rename MAX_ORDER to MAX_PAGE_ORDER 2024-01-08 15:27:15 -08:00
init.c As usual, lots of singleton and doubleton patches all over the tree and 2023-11-02 20:53:31 -10:00
ioremap.c arm64 : mm: add wrapper function ioremap_prot() 2023-08-18 10:12:36 -07:00
kasan_init.c kasan/arm64: improve comments for KASAN_SHADOW_START/END 2023-12-29 11:58:43 -08:00
mmap.c arm64: Avoid cpus_have_const_cap() for ARM64_HAS_EPAN 2023-10-16 14:17:04 +01:00
mmu.c arm64: kernel: Create initial ID map from C code 2024-02-16 12:42:34 +00:00
mteswap.c mm/swap: stop using page->private on tail pages for THP_SWAP 2023-08-24 16:20:28 -07:00
pageattr.c arm64: mm: Fix "rodata=on" when CONFIG_RODATA_FULL_DEFAULT_ENABLED=y 2023-11-22 18:46:05 +00:00
pgd.c
physaddr.c
proc.S arm64: kernel: Create initial ID map from C code 2024-02-16 12:42:34 +00:00
ptdump.c arm64: ptdump: Discover start of vmemmap region at runtime 2024-02-09 10:56:11 +00:00
ptdump_debugfs.c
trans_pgd-asm.S
trans_pgd.c Add x86 shadow stack support 2023-08-31 12:20:12 -07:00