@@ -328,10 +328,13 @@ impl Vcpu {
328
328
// does not panic on resume, see https://docs.kernel.org/virt/kvm/api.html .
329
329
// We do not want to fail if the call is not successful, because depending
330
330
// that may be acceptable depending on the workload.
331
+ // TODO: once kvmclock is supported with Secret Fredom, remove this condition.
331
332
#[ cfg( target_arch = "x86_64" ) ]
332
- if let Err ( err) = self . kvm_vcpu . fd . kvmclock_ctrl ( ) {
333
- METRICS . vcpu . kvmclock_ctrl_fails . inc ( ) ;
334
- warn ! ( "KVM_KVMCLOCK_CTRL call failed {}" , err) ;
333
+ if self . userfault_resolved . is_none ( ) {
334
+ if let Err ( err) = self . kvm_vcpu . fd . kvmclock_ctrl ( ) {
335
+ METRICS . vcpu . kvmclock_ctrl_fails . inc ( ) ;
336
+ warn ! ( "KVM_KVMCLOCK_CTRL call failed {}" , err) ;
337
+ }
335
338
}
336
339
337
340
return StateMachine :: next ( Self :: paused) ;
@@ -357,10 +360,13 @@ impl Vcpu {
357
360
// does not panic on resume, see https://docs.kernel.org/virt/kvm/api.html .
358
361
// We do not want to fail if the call is not successful, because depending
359
362
// that may be acceptable depending on the workload.
363
+ // TODO: once kvmclock is supported with Secret Fredom, remove this condition.
360
364
#[ cfg( target_arch = "x86_64" ) ]
361
- if let Err ( err) = self . kvm_vcpu . fd . kvmclock_ctrl ( ) {
362
- METRICS . vcpu . kvmclock_ctrl_fails . inc ( ) ;
363
- warn ! ( "KVM_KVMCLOCK_CTRL call failed {}" , err) ;
365
+ if self . userfault_resolved . is_none ( ) {
366
+ if let Err ( err) = self . kvm_vcpu . fd . kvmclock_ctrl ( ) {
367
+ METRICS . vcpu . kvmclock_ctrl_fails . inc ( ) ;
368
+ warn ! ( "KVM_KVMCLOCK_CTRL call failed {}" , err) ;
369
+ }
364
370
}
365
371
366
372
// Move to 'paused' state.
0 commit comments