Skip to content

Commit 0a51d0f

Browse files
committed
HACK: Wait between KVM_RUNs
For some reason, on SEV-SNP guests there exists a race condition in which an ENOMEM is returned from KVM_RUN that disappears when sleeping the thread for some time. This will be investigated and hopefully be dropped at a later point. Signed-off-by: Tyler Fanelli <[email protected]>
1 parent c401d21 commit 0a51d0f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/vmm/src/linux/vstate.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,9 @@ impl Vcpu {
11751175
///
11761176
/// Returns error or enum specifying whether emulation was handled or interrupted.
11771177
fn run_emulation(&mut self) -> Result<VcpuEmulation> {
1178+
// HACK: wait a bit between KVM_RUNs to work around an SNP issue.
1179+
thread::sleep(std::time::Duration::from_millis(1));
1180+
11781181
match self.fd.run() {
11791182
Ok(run) => match run {
11801183
#[cfg(target_arch = "x86_64")]

0 commit comments

Comments
 (0)