Commit 0c2c7c0
KVM: SEV: Mark nested locking of vcpu->lock
svm_vm_migrate_from() uses sev_lock_vcpus_for_migration() to lock all
source and target vcpu->locks. Unfortunately there is an 8 subclass
limit, so a new subclass cannot be used for each vCPU. Instead maintain
ownership of the first vcpu's mutex.dep_map using a role specific
subclass: source vs target. Release the other vcpu's mutex.dep_maps.
Fixes: b566393 ("KVM: SEV: Add support for SEV intra host migration")
Reported-by: John Sperbeck<jsperbeck@google.com>
Suggested-by: David Rientjes <rientjes@google.com>
Suggested-by: Sean Christopherson <seanjc@google.com>
Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
Cc: Hillf Danton <hdanton@sina.com>
Cc: kvm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Peter Gonda <pgonda@google.com>
Message-Id: <20220502165807.529624-1-pgonda@google.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent 0414410 commit 0c2c7c0
1 file changed
Lines changed: 38 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1594 | 1594 | | |
1595 | 1595 | | |
1596 | 1596 | | |
| 1597 | + | |
| 1598 | + | |
| 1599 | + | |
| 1600 | + | |
| 1601 | + | |
| 1602 | + | |
1597 | 1603 | | |
1598 | | - | |
| 1604 | + | |
| 1605 | + | |
1599 | 1606 | | |
1600 | 1607 | | |
1601 | 1608 | | |
| 1609 | + | |
1602 | 1610 | | |
1603 | 1611 | | |
1604 | | - | |
| 1612 | + | |
1605 | 1613 | | |
| 1614 | + | |
| 1615 | + | |
| 1616 | + | |
| 1617 | + | |
| 1618 | + | |
| 1619 | + | |
| 1620 | + | |
| 1621 | + | |
| 1622 | + | |
| 1623 | + | |
| 1624 | + | |
1606 | 1625 | | |
1607 | 1626 | | |
1608 | 1627 | | |
1609 | 1628 | | |
1610 | 1629 | | |
| 1630 | + | |
| 1631 | + | |
1611 | 1632 | | |
1612 | 1633 | | |
1613 | 1634 | | |
1614 | 1635 | | |
| 1636 | + | |
| 1637 | + | |
| 1638 | + | |
| 1639 | + | |
| 1640 | + | |
| 1641 | + | |
1615 | 1642 | | |
1616 | 1643 | | |
1617 | 1644 | | |
| |||
1621 | 1648 | | |
1622 | 1649 | | |
1623 | 1650 | | |
| 1651 | + | |
1624 | 1652 | | |
1625 | 1653 | | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
1626 | 1660 | | |
1627 | 1661 | | |
1628 | 1662 | | |
| |||
1748 | 1782 | | |
1749 | 1783 | | |
1750 | 1784 | | |
1751 | | - | |
| 1785 | + | |
1752 | 1786 | | |
1753 | 1787 | | |
1754 | | - | |
| 1788 | + | |
1755 | 1789 | | |
1756 | 1790 | | |
1757 | 1791 | | |
| |||
0 commit comments