ANDROID: BACKPORT: KVM: arm64: Handle races gracefully in pkvm_relax_perms()
We may encounter a race between MMU notifiers and the perm fault path in
KVM where the faulting PFN is gone from the maple tree by the time we
check it in pkvm_relax_perms(). Although that race is benign, it
currently causes the vCPU to exit with -EFAULT, which is generally fatal
for the guest.
To avoid this problem, let's return -EAGAIN instead and give the guest
another chance.
BACKPORT: adapted from android15-6.6 code which had a variation of the
same bug.
Bug: 389901612
Change-Id: Ie98e1162a558126c8c6e83f0621460966c09b7ad
Signed-off-by:
Quentin Perret <qperret@google.com>
Loading
Please sign in to comment