Skip to content

Commit d5c559f

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 669ee36 commit d5c559f

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
@@ -1173,6 +1173,9 @@ impl Vcpu {
11731173
///
11741174
/// Returns error or enum specifying whether emulation was handled or interrupted.
11751175
fn run_emulation(&mut self) -> Result<VcpuEmulation> {
1176+
// HACK: wait a bit between KVM_RUNs to work around an SNP issue.
1177+
thread::sleep(std::time::Duration::from_millis(1));
1178+
11761179
match self.fd.run() {
11771180
Ok(run) => match run {
11781181
#[cfg(target_arch = "x86_64")]

0 commit comments

Comments
 (0)