aboutsummaryrefslogtreecommitdiffstats
path: root/rust/helpers/mutex.c
diff options
context:
space:
mode:
authorMaxim Levitsky <[email protected]>2025-05-12 18:04:03 +0000
committerPaolo Bonzini <[email protected]>2025-05-27 16:16:41 +0000
commitfb49f07ba1d9d8c9bd8854878ae6b5b21ff9ac45 (patch)
tree62d4f79d9b829d884245ee9187a1c905201866e9 /rust/helpers/mutex.c
parentlocking/mutex: implement mutex_trylock_nested (diff)
downloadkernel-fb49f07ba1d9d8c9bd8854878ae6b5b21ff9ac45.tar.gz
kernel-fb49f07ba1d9d8c9bd8854878ae6b5b21ff9ac45.zip
locking/mutex: implement mutex_lock_killable_nest_lock
KVM's SEV intra-host migration code needs to lock all vCPUs of the source and the target VM, before it proceeds with the migration. The number of vCPUs that belong to each VM is not bounded by anything except a self-imposed KVM limit of CONFIG_KVM_MAX_NR_VCPUS vCPUs which is significantly larger than the depth of lockdep's lock stack. Luckily, the locks in both of the cases mentioned above, are held under the 'kvm->lock' of each VM, which means that we can use the little known lockdep feature called a "nest_lock" to support this use case in a cleaner way, compared to the way it's currently done. Implement and expose 'mutex_lock_killable_nest_lock' for this purpose. Signed-off-by: Maxim Levitsky <[email protected]> Acked-by: Peter Zijlstra (Intel) <[email protected]> Message-ID: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
Diffstat (limited to 'rust/helpers/mutex.c')
0 files changed, 0 insertions, 0 deletions