projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6bef365
)
KVM: Convert comment into an assertion in kvm_io_bus_register_dev()
author
Marc Zyngier
<maz@kernel.org>
Thu, 7 Dec 2023 15:12:01 +0000
(15:12 +0000)
committer
Oliver Upton
<oliver.upton@linux.dev>
Tue, 12 Dec 2023 07:11:38 +0000
(07:11 +0000)
Instead of having a comment indicating the need to hold slots_lock
when calling kvm_io_bus_register_dev(), make it explicit with
a lockdep assertion.
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link:
https://lore.kernel.org/r/20231207151201.3028710-6-maz@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
virt/kvm/kvm_main.c
patch
|
blob
|
history
diff --git
a/virt/kvm/kvm_main.c
b/virt/kvm/kvm_main.c
index 486800a7024b373f167f12b48ce1f13b095e6098..278d31ae45d86956ec4f694de1f13e7f23b9a512 100644
(file)
--- a/
virt/kvm/kvm_main.c
+++ b/
virt/kvm/kvm_main.c
@@
-5545,7
+5545,6
@@
int kvm_io_bus_read(struct kvm_vcpu *vcpu, enum kvm_bus bus_idx, gpa_t addr,
return r < 0 ? r : 0;
}
-/* Caller must hold slots_lock. */
int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
int len, struct kvm_io_device *dev)
{
@@
-5553,6
+5552,8
@@
int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
struct kvm_io_bus *new_bus, *bus;
struct kvm_io_range range;
+ lockdep_assert_held(&kvm->slots_lock);
+
bus = kvm_get_bus(kvm, bus_idx);
if (!bus)
return -ENOMEM;