Skip to content

Commit 7b05182

Browse files
committed
tmp(vmm): do not attempt kvmclock_ctrl if secret free
kvmclock is currently not supported by Secret Freedom and will always fail. Signed-off-by: Nikita Kalyazin <[email protected]>
1 parent 064a763 commit 7b05182

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/vmm/src/vstate/vcpu.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,10 +353,13 @@ impl Vcpu {
353353
// does not panic on resume, see https://docs.kernel.org/virt/kvm/api.html .
354354
// We do not want to fail if the call is not successful, because depending
355355
// that may be acceptable depending on the workload.
356+
// TODO: once kvmclock is supported with Secret Fredom, remove this condition.
356357
#[cfg(target_arch = "x86_64")]
357-
if let Err(err) = self.kvm_vcpu.fd.kvmclock_ctrl() {
358-
METRICS.vcpu.kvmclock_ctrl_fails.inc();
359-
warn!("KVM_KVMCLOCK_CTRL call failed {}", err);
358+
if self.userfault_channel.is_none() {
359+
if let Err(err) = self.kvm_vcpu.fd.kvmclock_ctrl() {
360+
METRICS.vcpu.kvmclock_ctrl_fails.inc();
361+
warn!("KVM_KVMCLOCK_CTRL call failed {}", err);
362+
}
360363
}
361364

362365
// Move to 'paused' state.

0 commit comments

Comments
 (0)