]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: s390: Avoid potentially sleeping while atomic when zapping pages
authorClaudio Imbrenda <imbrenda@linux.ibm.com>
Tue, 2 Jun 2026 14:23:49 +0000 (16:23 +0200)
committerClaudio Imbrenda <imbrenda@linux.ibm.com>
Tue, 2 Jun 2026 14:46:41 +0000 (16:46 +0200)
commit89fa757931dc0bcd64ef22b28d1d5ad00c5d02f4
treea3182fe93cce2181b11d666727d9f9d58f1a10b6
parentd1adc098ce08893c92fce3db63f7bb750fbb4c30
KVM: s390: Avoid potentially sleeping while atomic when zapping pages

Factor out try_get_locked_pte(), which behaves similarly to
get_locked_pte(), but does not attempt to allocate missing tables and
performs a spin_trylock() instead of blocking.

The new function is also exported, since it will be used in other
patches.

If intermediate entries are missing, there can be no pte swap entry to
free, so it's safe to ignore them.

This avoids potentially sleeping while atomic.

Fixes: e38c884df921 ("KVM: s390: Switch to new gmap")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260602142356.169458-4-imbrenda@linux.ibm.com>
arch/s390/include/asm/gmap_helpers.h
arch/s390/mm/gmap_helpers.c