linux/arch/arm64/mm
Ard Biesheuvel 7ba8f2b2d6 arm64: mm: use a 48-bit ID map when possible on 52-bit VA builds
52-bit VA kernels can run on hardware that is only 48-bit capable, but
configure the ID map as 52-bit by default. This was not a problem until
recently, because the special T0SZ value for a 52-bit VA space was never
programmed into the TCR register anwyay, and because a 52-bit ID map
happens to use the same number of translation levels as a 48-bit one.

This behavior was changed by commit 1401bef703 ("arm64: mm: Always update
TCR_EL1 from __cpu_set_tcr_t0sz()"), which causes the unsupported T0SZ
value for a 52-bit VA to be programmed into TCR_EL1. While some hardware
simply ignores this, Mark reports that Amberwing systems choke on this,
resulting in a broken boot. But even before that commit, the unsupported
idmap_t0sz value was exposed to KVM and used to program TCR_EL2 incorrectly
as well.

Given that we already have to deal with address spaces being either 48-bit
or 52-bit in size, the cleanest approach seems to be to simply default to
a 48-bit VA ID map, and only switch to a 52-bit one if the placement of the
kernel in DRAM requires it. This is guaranteed not to happen unless the
system is actually 52-bit VA capable.

Fixes: 90ec95cda9 ("arm64: mm: Introduce VA_BITS_MIN")
Reported-by: Mark Salter <msalter@redhat.com>
Link: http://lore.kernel.org/r/20210310003216.410037-1-msalter@redhat.com
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20210310171515.416643-2-ardb@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
2021-03-11 13:04:28 +00:00
..
cache.S arm64: mm: Use modern annotations for assembly functions 2020-01-08 12:23:38 +00:00
context.c arm64: mm: Pin down ASIDs for sharing mm with devices 2020-09-28 22:15:38 +01:00
copypage.c arm64: mte: reset the page tag in page->flags 2020-12-22 12:55:07 -08:00
dma-mapping.c dma-mapping: merge <linux/dma-noncoherent.h> into <linux/dma-map-ops.h> 2020-10-06 07:07:06 +02:00
extable.c arm64: Improve diagnostics when trapping BRK with FAULT_BRK_IMM 2020-09-18 16:35:54 +01:00
fault.c kfence: add test suite 2021-02-26 09:41:02 -08:00
flush.c mm: introduce page_size() 2019-09-24 15:54:08 -07:00
hugetlbpage.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
init.c arm64/mm: Reorganize pfn_valid() 2021-03-08 18:04:00 +00:00
ioremap.c mm: remove unneeded includes of <asm/pgalloc.h> 2020-08-07 11:33:26 -07:00
kasan_init.c kasan, arm64: rename kasan_init_tags and mark as __init 2020-12-22 12:55:07 -08:00
Makefile RISC-V Patches for the 5.12 Merge Window 2021-02-26 10:28:35 -08:00
mmap.c arm64: Include linux/io.h in mm/mmap.c 2021-01-27 12:52:16 +00:00
mmu.c arm64: mm: use a 48-bit ID map when possible on 52-bit VA builds 2021-03-11 13:04:28 +00:00
mteswap.c arm64: mte: reset the page tag in page->flags 2020-12-22 12:55:07 -08:00
pageattr.c arch, mm: make kernel_page_present() always available 2020-12-15 12:13:43 -08:00
pgd.c mm: consolidate pgtable_cache_init() and pgd_cache_init() 2019-09-24 15:54:09 -07:00
physaddr.c arm64: Do not pass tagged addresses to __is_lm_address() 2021-02-02 17:44:47 +00:00
proc.S arm64: Turn the MMU-on sequence into a macro 2021-02-08 12:51:26 +00:00
ptdump_debugfs.c arm64/mm: Hold memory hotplug lock while walking for kernel page table dump 2020-03-04 15:35:22 +00:00
ptdump.c arm64/ptdump:display the Linear Mapping start marker 2021-02-02 21:12:35 +00:00
trans_pgd.c arm64: trans_pgd: hibernate: idmap the single page that holds the copy page routines 2021-01-27 15:41:12 +00:00