Commit ea54dd3
KVM: Treat the device list as an rculist
A subsequent change to KVM/arm64 will necessitate walking the device
list outside of the kvm->lock. Prepare by converting to an rculist. This
has zero effect on the VM destruction path, as it is expected every
reader is backed by a reference on the kvm struct.
On the other hand, ensure a given device is completely destroyed before
dropping the kvm->lock in the release() path, as certain devices expect
to be a singleton (e.g. the vfio-kvm device).
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Sean Christopherson <seanjc@google.com>
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Link: https://lore.kernel.org/r/20240422200158.2606761-2-oliver.upton@linux.dev
Signed-off-by: Marc Zyngier <maz@kernel.org>1 parent fec50db commit ea54dd3
2 files changed
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1329 | 1329 | | |
1330 | 1330 | | |
1331 | 1331 | | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
1332 | 1338 | | |
1333 | 1339 | | |
1334 | 1340 | | |
| |||
4725 | 4731 | | |
4726 | 4732 | | |
4727 | 4733 | | |
4728 | | - | |
| 4734 | + | |
| 4735 | + | |
4729 | 4736 | | |
4730 | 4737 | | |
4731 | 4738 | | |
| |||
4808 | 4815 | | |
4809 | 4816 | | |
4810 | 4817 | | |
4811 | | - | |
| 4818 | + | |
4812 | 4819 | | |
4813 | 4820 | | |
4814 | 4821 | | |
| |||
4819 | 4826 | | |
4820 | 4827 | | |
4821 | 4828 | | |
4822 | | - | |
| 4829 | + | |
| 4830 | + | |
4823 | 4831 | | |
4824 | 4832 | | |
4825 | 4833 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
| 369 | + | |
| 370 | + | |
369 | 371 | | |
370 | 372 | | |
371 | 373 | | |
| |||
0 commit comments