Commit ce7ea0c
KVM: SVM: Move GHCB unmapping to fix RCU warning
When an SEV-ES guest is running, the GHCB is unmapped as part of the
vCPU run support. However, kvm_vcpu_unmap() triggers an RCU dereference
warning with CONFIG_PROVE_LOCKING=y because the SRCU lock is released
before invoking the vCPU run support.
Move the GHCB unmapping into the prepare_guest_switch callback, which is
invoked while still holding the SRCU lock, eliminating the RCU dereference
warning.
Fixes: 291bd20 ("KVM: SVM: Add initial support for a VMGEXIT VMEXIT")
Reported-by: Borislav Petkov <[email protected]>
Signed-off-by: Tom Lendacky <[email protected]>
Message-Id: <b2f9b79d15166f2c3e4375c0d9bc3268b7696455.1620332081.git.thomas.lendacky@amd.com>
Signed-off-by: Paolo Bonzini <[email protected]>1 parent 368340a commit ce7ea0c
3 files changed
+5
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2197 | 2197 | | |
2198 | 2198 | | |
2199 | 2199 | | |
2200 | | - | |
| 2200 | + | |
2201 | 2201 | | |
2202 | 2202 | | |
2203 | 2203 | | |
| |||
2233 | 2233 | | |
2234 | 2234 | | |
2235 | 2235 | | |
2236 | | - | |
2237 | | - | |
2238 | | - | |
2239 | 2236 | | |
2240 | 2237 | | |
2241 | 2238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1437 | 1437 | | |
1438 | 1438 | | |
1439 | 1439 | | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
1440 | 1443 | | |
1441 | 1444 | | |
1442 | 1445 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
581 | 581 | | |
582 | 582 | | |
583 | 583 | | |
| 584 | + | |
584 | 585 | | |
585 | 586 | | |
586 | 587 | | |
| |||
0 commit comments