Commit 1d36cbcb authored by Quentin Perret's avatar Quentin Perret
Browse files

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: default avatarQuentin Perret <qperret@google.com>
parent 40f82019
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment