~/bend-docscommunity

src/virtio/device.bend checks

raw source on the hub · import 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/device.bend as Device

16 imports
import Base
import ../lib/u64.bend as U
import ../lib/bytes.bend as B
import ../vmm/abi.bend as V
import ./mmio.bend as M
import ./queue.bend as Q
import ./rng.bend as Rng
import ./blk.bend as Blk
import ../disk/store.bend as St
import ./console.bend as Con
import ./net.bend as N
import ../fs/p9.bend as P
import ./vsock.bend as Vs
import ./input.bend as In
import ./lan.bend as Ln
import ./balloon.bend as Bl

Types

type DevKind source · line 68 · raw

Data

type DevState source · line 87 · raw

Data

The per-kind state of a device.

type Dev source · line 100 · raw

Data

type DevOut source · line 105 · raw

Data

The device after a write, the bytes the guest wrote to hvc0 and the frames the guest transmitted, in order.

type Pass source · line 314 · raw

Data

What a pass on one queue did: the queue, the new state, the bytes for the host console, the frames for the host, and whether it used any chain.

Definitions

def Dev.features source · line 109 · raw

0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64

VIRTIO_F_VERSION_1: bit 32, so bit 0 of the high word (the rng features).

def Dev.max_frames source · line 113 · raw

Nat

The most frames a net device keeps for the guest.

def Dev.mmio source · line 117 · raw

@kind:DevKind -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio

The transport of a fresh device of the given kind.

def Dev.state source · line 144 · raw

@kind:DevKind -> DevState

The state of a fresh device of the given kind.

def Dev.new source · line 169 · raw

@kind:DevKind -> Dev

def Dev.read.fin source · line 173 · raw

@k:DevKind -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @st:DevState -> @r:Pair(0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio, U32) -> Pair(Dev, U32)

def Dev.read source · line 178 · raw

@d:Dev -> @off:U32 -> @size:U32 -> Pair(Dev, U32)

def Dev.build source · line 184 · raw

@cs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.QueueCfg> -> List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq>

One Q.Vq per queue configuration, in order.

def Dev.cfgs source · line 191 · raw

@m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.QueueCfg>

def Dev.qget source · line 197 · raw

@qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @+i:U32 -> @+sel:U32 -> Maybe<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq>

Queue sel of the list; i counts the list position.

def Dev.qput source · line 205 · raw

@qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @+i:U32 -> @+sel:U32 -> @+q:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq -> List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq>

Replaces queue sel of the list by q; i counts the list position.

def Dev.raise_if source · line 213 · raw

@used:Bool -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio

Raises the used-buffer interrupt (status bit 1) when used.

def Dev.process source · line 223 · raw

@-R:Type -> @k:DevKind -> @q:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Pair(0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq, Bool)>

Runs the process of a kind without state on a queue. The kinds with state (console, net, 9p) run their passes in Dev.pass instead; here they use no chain.

def Dev.input_of source · line 249 · raw

@st:DevState -> List<&2, U32>

The pending console input of a state (none for other kinds).

def Dev.frames_of source · line 269 · raw

@st:DevState -> List<&2, List<&2, U32>>

The pending frames of a state (none for other kinds).

def Dev.p9_of source · line 289 · raw

@st:DevState -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/fs/p9.P9State

The 9p server state of a state (a fresh one for other kinds).

def Dev.cap source · line 309 · raw

@+fs:List<&2, List<&2, U32>> -> List<&2, List<&2, U32>>

The last Dev.max_frames() frames.

def Dev.pass.plain source · line 317 · raw

@st:DevState -> @r:Pair(0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq, Bool) -> Pass

def Dev.pass.con_tx source · line 322 · raw

@st:DevState -> @r:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/console.ConTx -> Pass

def Dev.pass.con_rx source · line 327 · raw

@r:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/console.ConRx -> Pass

def Dev.pass.net_tx source · line 332 · raw

@st:DevState -> @r:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/net.NetTx -> Pass

def Dev.pass.net_rx source · line 337 · raw

@r:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/net.NetRx -> Pass

def Dev.pass.p9 source · line 342 · raw

@r:0x5fb57f1b8ad4cb61031f616c44af7445/src/fs/p9.P9Pass -> Pass

def Dev.pass.con source · line 348 · raw

@-R:Type -> @tx:Bool -> @st:DevState -> @q:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Pass>

The console's pass: transmitq0 (tx) or receiveq0.

def Dev.pass.net source · line 360 · raw

@-R:Type -> @tx:Bool -> @st:DevState -> @q:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Pass>

The net device's pass: transmitq1 (tx) or receiveq1.

def Dev.vs_of source · line 372 · raw

@st:DevState -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/vsock.Vsock

The vsock state of a state (a fresh one, CID 3, for other kinds).

def Dev.pass.vs_tx source · line 391 · raw

@r:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/vsock.VsTx -> Pass

def Dev.pass.vs_rx source · line 396 · raw

@r:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/vsock.VsRx -> Pass

def Dev.pass.vsock source · line 403 · raw

@-R:Type -> @tx:Bool -> @rx:Bool -> @st:DevState -> @q:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Pass>

The vsock device's pass: tx (queue 1), rx (queue 0); the event queue (2) is never used.

def Dev.in_of source · line 417 · raw

@st:DevState -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/input.InputState

The input state of a state (a fresh one for other kinds).

def Dev.pass.in_rx source · line 424 · raw

@r:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/input.InRx -> Pass

def Dev.pass.in_status source · line 429 · raw

@st:DevState -> @r:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/console.ConTx -> Pass

def Dev.pass.input source · line 436 · raw

@-R:Type -> @ev:Bool -> @st:DevState -> @q:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Pass>

The input device's pass: eventq (ev) gets the pending events; statusq chains are taken and dropped.

def Dev.lan_of source · line 448 · raw

@st:DevState -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/lan.Lan

The LAN state of a state (a blank one for other kinds).

def Dev.bal_of source · line 456 · raw

@st:DevState -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/balloon.Bal

The balloon's state (a fresh one for a snapshot taken before it had one).

def Dev.auto_of source · line 465 · raw

@st:DevState -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/balloon.AutoSt

The automatic balloon's state (a fresh one for a snapshot taken before it had one).

def Dev.pass.bal source · line 472 · raw

@r:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/balloon.BalPass -> @a:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/balloon.AutoSt -> Pass

def Dev.pass.stats source · line 477 · raw

@r:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/balloon.StatsPass -> Pass

def Dev.pass.balloon source · line 484 · raw

@-R:Type -> @stats:Bool -> @+sel:U32 -> @+st:DevState -> @q:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Pass>

The balloon's pass on its queue sel (the module's own numbering: Bl.Balloon.logical).

def Dev.pass.lan_tx source · line 491 · raw

@r:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/lan.LanTx -> Pass

def Dev.pass.lan_rx source · line 496 · raw

@l:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/lan.Lan -> @r:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/lan.LanRxOut -> Pass

def Dev.pass.lan source · line 502 · raw

@-R:Type -> @tx:Bool -> @st:DevState -> @q:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Pass>

The LAN device's pass: transmit (queue 1) or receive (queue 0).

def Dev.pass source · line 515 · raw

@-R:Type -> @k:DevKind -> @st:DevState -> @+sel:U32 -> @q:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Pass>

Runs the kind's pass on queue sel (q).

def Dev.out source · line 551 · raw

@d:Dev -> DevOut

A device with nothing for the host.

def Dev.bal_sync source · line 556 · raw

@+st:DevState -> @+m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio

A balloon whose target moved (the automatic balloon: Bl.Balloon.stats_pass) tells the driver (config change interrupt).

def Dev.notify.fin source · line 563 · raw

@k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @sel:U32 -> @r:Pass -> DevOut

def Dev.sel_of source · line 571 · raw

@k:DevKind -> @+m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @+sel:U32 -> U32

The queue number a kind's pass takes: the balloon's own numbering (Bl.Balloon.logical: it depends on whether the driver accepted the stats queue, bit 1); others as the driver's.

def Dev.notify source · line 579 · raw

@-R:Type -> @mq:Maybe<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @+k:DevKind -> @+m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @st:DevState -> @+sel:U32 -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, DevOut>

Runs the pass on queue sel when it exists.

def DevOut.dev source · line 589 · raw

@o:DevOut -> Dev

Acts on the event of a transport write.

def Dev.flush source · line 594 · raw

@-R:Type -> @k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @st:DevState -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Dev>

def Dev.flush.out source · line 601 · raw

@-R:Type -> @k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @st:DevState -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, DevOut>

The rx pass (Dev.flush) with its vsock commands kept (VsRelease).

def DevOut.join source · line 605 · raw

@bs:List<&2, U32> -> @fs:List<&2, List<&2, U32>> -> @vc:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.VsockCmd> -> @o:DevOut -> DevOut

def Dev.after.vsock source · line 610 · raw

@-R:Type -> @again:Bool -> @o:DevOut -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, DevOut>

def Dev.is_vsock source · line 621 · raw

@k:DevKind -> Bool

def Dev.is_lan source · line 628 · raw

@k:DevKind -> Bool

def Dev.on_event source · line 635 · raw

@-R:Type -> @ev:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.MmioEvent -> @k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @st:DevState -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, DevOut>

def Dev.write.fin source · line 651 · raw

@-R:Type -> @k:DevKind -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @st:DevState -> @r:Pair(0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.MmioEvent) -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, DevOut>

def Dev.is_input source · line 656 · raw

@k:DevKind -> Bool

def Dev.tablet_of source · line 663 · raw

@k:DevKind -> Bool

def Dev.write.go source · line 672 · raw

@-R:Type -> @select:Bool -> @+k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @st:DevState -> @+off:U32 -> @v:U32 -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, DevOut>

A write to an input device's select or subsel byte rebuilds its config space; other writes go to the transport.

def Dev.write source · line 680 · raw

@-R:Type -> @d:Dev -> @+off:U32 -> @v:U32 -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, DevOut>

def Dev.is_console source · line 687 · raw

@k:DevKind -> Bool

Delivers a device's pending input or frames into its queue 0, when it exists.

def Dev.is_net source · line 712 · raw

@k:DevKind -> Bool

def Dev.input.go source · line 737 · raw

@-R:Type -> @console:Bool -> @k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @st:DevState -> @bytes:List<&2, U32> -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Dev>

def Dev.input source · line 747 · raw

@-R:Type -> @d:Dev -> @bytes:List<&2, U32> -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Dev>

Bytes typed on the host console: a console device appends them to its pending input and delivers what fits into receiveq0 (raising interrupt status bit 1 when it used a chain). Other kinds are unchanged.

def Dev.deliver.go source · line 752 · raw

@-R:Type -> @net:Bool -> @k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @st:DevState -> @frames:List<&2, List<&2, U32>> -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Dev>

def Dev.deliver source · line 763 · raw

@-R:Type -> @d:Dev -> @frames:List<&2, List<&2, U32>> -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Dev>

Frames for the guest: a net device appends them to its pending frames (keeping the last Dev.max_frames()) and delivers what it can into receiveq1 (raising interrupt status bit 1 when it used a chain). Other kinds are unchanged.

def Dev.net source · line 769 · raw

@d:Dev -> Bool

Whether the device is a net device.

def Dev.backlog source · line 775 · raw

@d:Dev -> U32

The number of frames a net device holds for the guest (0 for other kinds).

def Dev.vsock source · line 781 · raw

@d:Dev -> Bool

Whether the device is a vsock device.

def Dev.big.mmio source · line 786 · raw

@m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> Bool

def Dev.big source · line 793 · raw

@d:Dev -> Bool

Whether a net device's driver took GUEST_CSUM and GUEST_TSO4 (bits 1 and 7): it then receives TCP segments of up to 64 KiB as host frames.

def Dev.vsock_backlog source · line 799 · raw

@d:Dev -> U32

A vsock device's backlog (Vs.Vsock.backlog; 0 for other kinds).

def Dev.host_vsock.fin source · line 804 · raw

@-R:Type -> @k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @o:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/vsock.VsOut -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, DevOut>

def Dev.host_vsock source · line 813 · raw

@-R:Type -> @d:Dev -> @ev:0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.VsockEvent -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, DevOut>

An event from the host's vsock sockets: through the protocol, then the packets it queued go into the rx queue. Other kinds are unchanged.

def Dev.irq source · line 820 · raw

@d:Dev -> Bool

After a vsock tx pass, the replies it queued go out through the rx queue. The interrupt line's level.

def Dev.hid.go source · line 825 · raw

@-R:Type -> @input:Bool -> @+k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @st:DevState -> @ev:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/input.Hid -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Dev>

def Dev.hid source · line 835 · raw

@-R:Type -> @d:Dev -> @ev:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/input.Hid -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Dev>

A keyboard or pointer report from the host: an input device queues its events (In.Input.push: the keyboard takes keys, the tablet moves and buttons) and delivers what fits into eventq. Other kinds are unchanged.

def Dev.lan_ready.go source · line 840 · raw

@-R:Type -> @lan:Bool -> @k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @st:DevState -> @+len:U32 -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Dev>

def Dev.lan_ready source · line 850 · raw

@-R:Type -> @d:Dev -> @+len:U32 -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Dev>

The host holds a frame of len bytes for the LAN NIC: a LAN device queues it and delivers what fits into its receive queue (raising interrupt status bit 1 when it used a chain). Other kinds are unchanged.

def Dev.forget_lan source · line 856 · raw

@d:Dev -> Dev

The LAN state of a device (forget_held after a restore).

def Dev.balloon.go source · line 866 · raw

@bal:Bool -> @+k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @+st:DevState -> @+pages:U32 -> Dev

The host sets the balloon's target (balloon MiB on the control socket): a balloon device takes it (pages of 4 KiB) and tells the driver (config change interrupt); other kinds are unchanged.

def Dev.is_balloon source · line 874 · raw

@k:DevKind -> Bool

def Dev.auto_kind source · line 882 · raw

@k:DevKind -> Bool

Whether this is the automatic balloon (--balloon auto, the default).

def Dev.is_auto_balloon source · line 889 · raw

@d:Dev -> Bool

def Dev.balloon source · line 894 · raw

@d:Dev -> @+pages:U32 -> Dev

def Dev.balloon_auto.go source · line 901 · raw

@bal:Bool -> @+k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @+st:DevState -> Dev

balloon auto: the automatic balloon takes over again from a target set by hand.

def Dev.balloon_auto source · line 908 · raw

@d:Dev -> Dev

def Dev.poll.fin source · line 919 · raw

@+k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @b:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/balloon.Bal -> @r:Pair(Pair(0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/balloon.AutoSt), Bool) -> Dev

Asking the automatic balloon's driver for fresh statistics: a stats buffer it posted and the device has not read yet is read first (the driver posts its first one before DRIVER_OK, when there are no queues to take it), then the one held goes back (Bl.Balloon.poll: on the driver's queue 2, with a used-buffer interrupt). Only when the driver accepted the stats queue: else its queue 2 reports free pages.

def Dev.poll.held source · line 925 · raw

@-R:Type -> @+k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @+qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @sp:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/balloon.StatsPass -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Dev>

def Dev.poll.go source · line 930 · raw

@-R:Type -> @mq:Maybe<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @+k:DevKind -> @m:0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/mmio.VirtioMmio -> @+qs:List<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/queue.Vq> -> @+st:DevState -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Dev>

def Dev.balloon_poll source · line 937 · raw

@-R:Type -> @d:Dev -> 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.Op<R, Dev>

def Dev.balloon_info source · line 943 · raw

@d:Dev -> Maybe<&2, 0x5fb57f1b8ad4cb61031f616c44af7445/src/virtio/balloon.Bal>

The balloon's target and count (4 KiB pages), when this is the balloon.