Skip to content

Commit b1a39a7

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: Convert comment into an assertion in kvm_io_bus_register_dev()
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 6bef365 commit b1a39a7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

virt/kvm/kvm_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5545,14 +5545,15 @@ int kvm_io_bus_read(struct kvm_vcpu *vcpu, enum kvm_bus bus_idx, gpa_t addr,
55455545
return r < 0 ? r : 0;
55465546
}
55475547

5548-
/* Caller must hold slots_lock. */
55495548
int kvm_io_bus_register_dev(struct kvm *kvm, enum kvm_bus bus_idx, gpa_t addr,
55505549
int len, struct kvm_io_device *dev)
55515550
{
55525551
int i;
55535552
struct kvm_io_bus *new_bus, *bus;
55545553
struct kvm_io_range range;
55555554

5555+
lockdep_assert_held(&kvm->slots_lock);
5556+
55565557
bus = kvm_get_bus(kvm, bus_idx);
55575558
if (!bus)
55585559
return -ENOMEM;

0 commit comments

Comments
 (0)