]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: Ignore -EAGAIN when mapping in pages for the pKVM host
authorWill Deacon <will@kernel.org>
Mon, 30 Mar 2026 14:48:11 +0000 (15:48 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 30 Mar 2026 15:58:07 +0000 (16:58 +0100)
commit73c55be08932a348f8b0a44f561c33eaa2cf1ad2
tree25397c0eab7748c6c7abb6831ebfa45ce8fb3563
parentf0877a1455cc6a93be14e4da741ce26ac0d6ca6d
KVM: arm64: Ignore -EAGAIN when mapping in pages for the pKVM host

If the host takes a stage-2 translation fault on two CPUs at the same
time, one of them will get back -EAGAIN from the page-table mapping code
when it runs into the mapping installed by the other.

Rather than handle this explicitly in handle_host_mem_abort(), pass the
new KVM_PGTABLE_WALK_IGNORE_EAGAIN flag to kvm_pgtable_stage2_map() from
__host_stage2_idmap() and return -EEXIST if host_stage2_adjust_range()
finds a valid pte. This will avoid having to test for -EAGAIN on the
reclaim path in subsequent patches.

Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Tested-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Link: https://patch.msgid.link/20260330144841.26181-11-will@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/hyp/nvhe/mem_protect.c