diff options
author | Paul Mackerras <paulus@ozlabs.org> | 2019-05-29 11:54:00 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@ozlabs.org> | 2019-05-29 13:44:36 +1000 |
commit | 1659e27d2bc1ef47b6d031abe01b467f18cb72d9 (patch) | |
tree | 9624c611a13ad720ec5593df5cccf04afef21bc1 /arch/Kconfig | |
parent | 0d4ee88d92884c661fcafd5576da243aa943dc24 (diff) |
KVM: PPC: Book3S: Use new mutex to synchronize access to rtas token list
Currently the Book 3S KVM code uses kvm->lock to synchronize access
to the kvm->arch.rtas_tokens list. Because this list is scanned
inside kvmppc_rtas_hcall(), which is called with the vcpu mutex held,
taking kvm->lock cause a lock inversion problem, which could lead to
a deadlock.
To fix this, we add a new mutex, kvm->arch.rtas_token_lock, which nests
inside the vcpu mutexes, and use that instead of kvm->lock when
accessing the rtas token list.
This removes the lockdep_assert_held() in kvmppc_rtas_tokens_free().
At this point we don't hold the new mutex, but that is OK because
kvmppc_rtas_tokens_free() is only called when the whole VM is being
destroyed, and at that point nothing can be looking up a token in
the list.
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
Diffstat (limited to 'arch/Kconfig')
0 files changed, 0 insertions, 0 deletions