Commit bf42b02
committed
KVM: SEV: Do COPY_ENC_CONTEXT_FROM with both VMs locked
Now that we have a facility to lock two VMs with deadlock
protection, use it for the creation of mirror VMs as well. One of
COPY_ENC_CONTEXT_FROM(dst, src) and COPY_ENC_CONTEXT_FROM(src, dst)
would always fail, so the combination is nonsensical and it is okay to
return -EBUSY if it is attempted.
This sidesteps the question of what happens if a VM is
MOVE_ENC_CONTEXT_FROM'd at the same time as it is
COPY_ENC_CONTEXT_FROM'd: the locking prevents that from
happening.
Cc: Peter Gonda <pgonda@google.com>
Cc: Sean Christopherson <seanjc@google.com>
Reviewed-by: Sean Christopherson <seanjc@google.com>
Message-Id: <20211123005036.2954379-10-pbonzini@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>1 parent dc79c9f commit bf42b02
1 file changed
Lines changed: 24 additions & 42 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1955 | 1955 | | |
1956 | 1956 | | |
1957 | 1957 | | |
1958 | | - | |
| 1958 | + | |
1959 | 1959 | | |
1960 | 1960 | | |
1961 | 1961 | | |
1962 | 1962 | | |
1963 | 1963 | | |
1964 | | - | |
| 1964 | + | |
1965 | 1965 | | |
1966 | 1966 | | |
1967 | 1967 | | |
1968 | | - | |
1969 | | - | |
1970 | | - | |
1971 | | - | |
1972 | | - | |
1973 | | - | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
1974 | 1971 | | |
1975 | | - | |
1976 | | - | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
1977 | 1980 | | |
1978 | | - | |
| 1981 | + | |
1979 | 1982 | | |
1980 | 1983 | | |
1981 | | - | |
1982 | | - | |
1983 | | - | |
1984 | 1984 | | |
1985 | 1985 | | |
1986 | 1986 | | |
1987 | 1987 | | |
| 1988 | + | |
1988 | 1989 | | |
1989 | 1990 | | |
1990 | | - | |
1991 | | - | |
1992 | | - | |
1993 | | - | |
1994 | | - | |
1995 | | - | |
1996 | | - | |
1997 | | - | |
1998 | | - | |
1999 | | - | |
2000 | | - | |
2001 | | - | |
2002 | | - | |
2003 | | - | |
2004 | 1991 | | |
2005 | 1992 | | |
2006 | 1993 | | |
2007 | 1994 | | |
2008 | | - | |
2009 | | - | |
2010 | | - | |
2011 | | - | |
| 1995 | + | |
| 1996 | + | |
| 1997 | + | |
| 1998 | + | |
2012 | 1999 | | |
| 2000 | + | |
| 2001 | + | |
2013 | 2002 | | |
2014 | 2003 | | |
2015 | 2004 | | |
2016 | 2005 | | |
2017 | 2006 | | |
2018 | 2007 | | |
2019 | | - | |
2020 | | - | |
2021 | | - | |
2022 | | - | |
2023 | | - | |
2024 | | - | |
2025 | | - | |
2026 | | - | |
2027 | | - | |
2028 | | - | |
| 2008 | + | |
| 2009 | + | |
| 2010 | + | |
2029 | 2011 | | |
2030 | 2012 | | |
2031 | 2013 | | |
| |||
0 commit comments