On Fri, 22 Sep 2023 22:32:29 +0000, Oliver Upton wrote:
It is possible for multiple vCPUs to fault on the same IPA and attempt to resolve the fault. One of the page table walks will actually update the PTE and the rest will return -EAGAIN per our race detection scheme. KVM elides the TLB invalidation on the racing threads as the return value is nonzero.
Before commit a12ab1378a88 ("KVM: arm64: Use local TLBI on permission relaxation") KVM always used broadcast TLB invalidations when handling permission faults, which had the convenient property of making the stage-2 updates visible to all CPUs in the system. However now we do a local invalidation, and TLBI elision leads to vCPUs getting stuck in a permission fault loop. Remember that the architecture permits the TLB to cache translations that precipitate a permission fault.
[...]
Applied to kvmarm/next, with the fixes and stable tag dropped.
[1/1] KVM: arm64: Always invalidate TLB for stage-2 permission faults https://git.kernel.org/kvmarm/kvmarm/c/5a6e594fc607
-- Best, Oliver