summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorFuad Tabba <fuad.tabba@linux.dev>2026-07-17 14:03:12 +0100
committerOliver Upton <oupton@kernel.org>2026-07-31 00:11:56 -0700
commit6bf0215c565ee122ffff7241b297a7b88f71005f (patch)
treefa43b47502c8ade7be1c53ebf8f069262ab95b61 /include/linux
parentfff4eb33ffa082f1a106a5d696d035eac8d7842c (diff)
KVM: arm64: Top up the memcache for pKVM permission faults
A permission fault normally only relaxes a leaf, so user_mem_abort() skips the memcache top-up. Under pKVM such a fault can instead collapse pages into a block. That needs a fresh pkvm_mapping object, and without it cache->mapping is NULL, so pkvm_pgtable_stage2_map() dereferences NULL and faults the host under mmu_lock. Staging only the object is not enough: the hypervisor requires kvm_mmu_cache_min_pages in the memcache even for the allocation-free install, so under memcache pressure the collapse returns -ENOMEM and trips the WARN_ON(ret) in pkvm_pgtable_stage2_map() where a non-pKVM guest succeeds. Top up the full memcache for pKVM permission faults so both the mapping object and the min-pages are staged before mmu_lock. Fixes: db14091d8f75 ("KVM: arm64: Stage-2 huge mappings for np-guests") Reported-by: Bradley Morgan <include@grrlz.net> Link: https://lore.kernel.org/all/20260623161545.EA08E1F000E9@smtp.kernel.org/ Signed-off-by: Fuad Tabba <fuad.tabba@linux.dev> Tested-by: Bradley Morgan <include@grrlz.net> # On pixel 7, Android 17 CP2A.260705.006 Test: Bradley Morgan <include@grrlz.net> # On QEMU arm64 host Link: https://patch.msgid.link/20260717130317.1953574-3-fuad.tabba@linux.dev Signed-off-by: Oliver Upton <oupton@kernel.org>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions