Skip to content

feat(virtio): add VM generation coordination - #123

Open
appcypher wants to merge 1 commit into
krunfrom
appcypher/vm-generation-id
Open

feat(virtio): add VM generation coordination#123
appcypher wants to merge 1 commit into
krunfrom
appcypher/vm-generation-id

Conversation

@appcypher

Copy link
Copy Markdown
Member

TL;DR

Add an event-driven virtio VM-generation device and runtime API that lets a guest acknowledge an exact host-published generation after refreshing kernel randomness.

Description

  • add a private virtio-mmio device with separate host request and guest processed fields
  • publish a caller-generated 16-byte identifier with a monotonic device-local sequence
  • make same-identifier retries idempotent and report replaced or stale requests as superseded
  • expose a condition-variable-backed completion handle without retaining the virtio device mutex while waiting
  • attach the device after existing devices so their established MMIO and IRQ allocation order remains stable
  • provide a runtime builder and VM control surface for installing, publishing, retrying, and waiting for generation processing

Test Plan

  • cargo fmt --all -- --check
  • cargo test --locked --offline -p msb_krun -p msb_krun_vmm -p msb_krun_devices --lib (130 passed)
  • Live macOS ARM64/HVF: pre-boot installation, exact acknowledgement, same-attempt retry, monotonic second update, and stale-request supersession
  • Live Linux x86_64/KVM: pre-boot installation, exact acknowledgement, same-attempt retry, monotonic second update, and stale-request supersession

Expose a config-only virtio device for publishing immutable generation identifiers and observing exact guest processing acknowledgements. Provide monotonic requests, idempotent retries, supersession outcomes, and an event-driven waiter without adding work to ordinary execution or I/O paths.

Attach the device after existing virtio devices to preserve their established MMIO and interrupt allocation order, and surface the control operations through VmControl.
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.

1 participant