2626- [ Implementation History] ( #implementation-history )
2727- [ Drawbacks] ( #drawbacks )
2828- [ Alternatives] ( #alternatives )
29- <!-- /toc -->
29+ <!-- /toc -->
3030
3131## Summary
3232
@@ -38,7 +38,8 @@ as streams, RPC, and other I/O patterns in both single-threaded and multi-thread
3838
3939The design leverages virtio's well-defined publishing/consumption semantics and memory safety
4040guarantees while adapting them to Hyperlight's specific needs. Since we control both ends of the
41- queue, we can deviate from strict virtio compliance where it makes sense.
41+ queue, we can deviate from strict virtio compliance where it makes sense (see
42+ [ Difference from virtio spec] ( #difference-from-virtio-spec ) section).
4243
4344## Motivation
4445
@@ -206,10 +207,10 @@ with atomic publishing of flags ensure that the other side will never observe a
206207- Driver: Write descriptor fields ? memory barrier ? atomic Release-store flags
207208- Device: Atomic Acquire-load flags ? memory barrier ? read descriptor fields
208209
209- Because the packed ring reuses the same descriptor slot for both ` available ` and ` used ` states and both
210- sides only poll a single next slot, each side needs to differentiate between "this change belongs to
211- the current lap in the ring" and "this is an old value from the previous lap." This is done using
212- "wrap" counters:
210+ Because the packed ring reuses the same descriptor slot for both ` available ` and ` used ` states and
211+ both sides only poll a single next slot, each side needs to differentiate between "this change
212+ belongs to the current lap in the ring" and "this is an old value from the previous lap." This is
213+ done using "wrap" counters:
213214
214215- Each side keeps a boolean "wrap" flag that toggles when it passes the last descriptor in the ring,
215216- When the driver publishes an available descriptor, it sets ` AVAIL ` to its wrap bit and ` USED ` to
@@ -355,7 +356,7 @@ descriptor layer or in the flatbuffer schema:
355356Snapshotting requires that the descriptor table has no in-flight guest-to-host requests and any
356357attempt to snapshot a sandbox with such pending requests will result in a snapshot failure.
357358
358- ### Difference from spec
359+ ### Difference from virtio spec
359360
360361- Do not support indirect descriptor table (can be deferred to future work if needed),
361362- Do not support feature negotiation, set of features is fixed for driver and device,
@@ -721,6 +722,23 @@ impl RingReceiver
721722- Performance benchmarks vs. current VM exit approach
722723- Stress testing under high load
723724
725+ ### Implementation Plan
726+
727+ As proposed, the queue will eventually replace the current stack‑based mechanism for function calls.
728+ The initial implementation will be gated behind a feature flag. The work can be roughly broken down
729+ into:
730+
731+ - Introduce a low‑level queue implementation that operates on shared memory.
732+ - Introduce a serialization trait for data that can be safely sent through the queue.
733+ - Introduce a high‑level API over the queue.
734+ - Integrate the queue infrastructure with the existing memory model and function‑call API.
735+
736+ Future work includes:
737+
738+ - Adding ` Future ` and ` Stream ` as function argument and return types.
739+ - Supporting host and guest running on separate threads.
740+ - Providing an asynchronous API for function calls, streams, and related workflows.
741+
724742## Implementation History
725743
726744- ** 2025-11-12** : HIP proposed
0 commit comments