mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-08-09 06:14:34 +02:00
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: e38c884df9 ("KVM: s390: Switch to new gmap")
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-ID: <20260602142356.169458-4-imbrenda@linux.ibm.com>
18 lines
624 B
C
18 lines
624 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* Helper functions for KVM guest address space mapping code
|
|
*
|
|
* Copyright IBM Corp. 2025
|
|
*/
|
|
|
|
#ifndef _ASM_S390_GMAP_HELPERS_H
|
|
#define _ASM_S390_GMAP_HELPERS_H
|
|
|
|
void gmap_helper_zap_one_page(struct mm_struct *mm, unsigned long vmaddr);
|
|
void gmap_helper_discard(struct mm_struct *mm, unsigned long vmaddr, unsigned long end);
|
|
int gmap_helper_disable_cow_sharing(void);
|
|
void gmap_helper_try_set_pte_unused(struct mm_struct *mm, unsigned long vmaddr);
|
|
pte_t *try_get_locked_pte(struct mm_struct *mm, unsigned long addr, spinlock_t **ptl);
|
|
|
|
#endif /* _ASM_S390_GMAP_HELPERS_H */
|