From: Claudio Imbrenda Date: Wed, 4 Feb 2026 15:02:35 +0000 (+0100) Subject: KVM: s390: Introduce import_lock X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf3ce3d69d56bd3ef2bc5f6b500ebc5181637161;p=thirdparty%2Flinux.git KVM: s390: Introduce import_lock Introduce import_lock to avoid future races when converting pages to secure. Acked-by: Heiko Carstens Signed-off-by: Claudio Imbrenda --- diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index ae1223264d3cd..3dbddb7c60a99 100644 --- a/arch/s390/include/asm/kvm_host.h +++ b/arch/s390/include/asm/kvm_host.h @@ -630,6 +630,8 @@ struct kvm_s390_pv { void *set_aside; struct list_head need_cleanup; struct mmu_notifier mmu_notifier; + /* Protects against concurrent import-like operations */ + struct mutex import_lock; }; struct kvm_arch { diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c index 56a50524b3eee..cd39b2f099ca7 100644 --- a/arch/s390/kvm/kvm-s390.c +++ b/arch/s390/kvm/kvm-s390.c @@ -3330,6 +3330,8 @@ int kvm_arch_init_vm(struct kvm *kvm, unsigned long type) char debug_name[16]; int i, rc; + mutex_init(&kvm->arch.pv.import_lock); + rc = -EINVAL; #ifdef CONFIG_KVM_S390_UCONTROL if (type & ~KVM_VM_S390_UCONTROL)