Skip to content

Conversation

@kilroyjones
Copy link

Changes

The first fix prevents guest soft lockup panics on resume by implementing KVM_KVMCLOCK_CTRL, which signals the guest kernel to reset its watchdog clock after a pause. This manual implementation also includes a new metric to track kvmclock_ctrl failures.

The second change modifies IoVecBuffer and IoVecBufferMut to support partial I/O operations by returning the total bytes processed rather than failing completely if an error occurs mid-stream. This ensures that any data successfully read or written before an interruption is acknowledged and returned to the caller.
...

Reason

...

License Acceptance

By submitting this pull request, I confirm that my contribution is made under
the terms of the Apache 2.0 license. For more information on following Developer
Certificate of Origin and signing off your commits, please check
CONTRIBUTING.md.

PR Checklist

  • If a specific issue led to this PR, this PR closes the issue.
  • The description of changes is clear and encompassing.
  • Any required documentation changes (code and docs) are included in this
    PR.
  • API changes follow the Runbook for Firecracker API changes.
  • User-facing changes are mentioned in CHANGELOG.md.
  • All added/changed functionality is tested.
  • New TODOs link to an issue.
  • Commits meet
    contribution quality standards.

  • This functionality cannot be added in rust-vmm.

@reijne
Copy link

reijne commented Jan 15, 2026

I cannot comment on the file but in src/vmm/src/vstate/vcpu/mod.rs there exists a TODO comment to use the functionality that I believe we have introduced now as a function:

fn running(&mut self) -> StateMachine<Self> {
...
// Break this emulation loop on any transition request/external event.
        match self.event_receiver.try_recv() {
            // Running ---- Pause ----> Paused
            Ok(VcpuEvent::Pause) => {
                // Nothing special to do.
                self.response_sender
                    .send(VcpuResponse::Paused)
                    .expect("vcpu channel unexpectedly closed");

                // TODO: we should call `KVM_KVMCLOCK_CTRL` here to make sure
                // TODO continued: the guest soft lockup watchdog does not panic on Resume.

                // Move to 'paused' state.
                state = StateMachine::next(Self::paused);
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants