Commit 49e5d16
KVM: arm64: vgic: Don't acquire its_lock before config_lock
commit f003277 ("KVM: arm64: Use config_lock to protect vgic
state") was meant to rectify a longstanding lock ordering issue in KVM
where the kvm->lock is taken while holding vcpu->mutex. As it so
happens, the aforementioned commit introduced yet another locking issue
by acquiring the its_lock before acquiring the config lock.
This is obviously wrong, especially considering that the lock ordering
is well documented in vgic.c. Reshuffle the locks once more to take the
config_lock before the its_lock. While at it, sprinkle in the lockdep
hinting that has become popular as of late to keep lockdep apprised of
our ordering.
Cc: stable@vger.kernel.org
Fixes: f003277 ("KVM: arm64: Use config_lock to protect vgic state")
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230412062733.988229-1-oliver.upton@linux.dev1 parent f003277 commit 49e5d16
1 file changed
Lines changed: 12 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1958 | 1958 | | |
1959 | 1959 | | |
1960 | 1960 | | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
1961 | 1971 | | |
1962 | 1972 | | |
1963 | 1973 | | |
| |||
2752 | 2762 | | |
2753 | 2763 | | |
2754 | 2764 | | |
2755 | | - | |
2756 | 2765 | | |
2757 | 2766 | | |
2758 | | - | |
2759 | 2767 | | |
2760 | 2768 | | |
2761 | 2769 | | |
2762 | 2770 | | |
2763 | 2771 | | |
| 2772 | + | |
2764 | 2773 | | |
2765 | 2774 | | |
2766 | 2775 | | |
| |||
2774 | 2783 | | |
2775 | 2784 | | |
2776 | 2785 | | |
| 2786 | + | |
2777 | 2787 | | |
2778 | 2788 | | |
2779 | | - | |
2780 | 2789 | | |
2781 | 2790 | | |
2782 | 2791 | | |
| |||
0 commit comments