src/vmm/machine.bend checks
raw source on the hub · import 0x2cb44898b57f05c48f38583063e077bf/src/vmm/machine.bend as Machine
14 imports
import Base import ../lib/u64.bend as U import ../lib/bytes.bend as B import ../arm64/esr.bend as E import ../arm64/psci.bend as P import ../dev/pl011.bend as Uart import ../dev/pl031.bend as Rtc import ../dev/pflash.bend as Pf import ../net/nat.bend as Nt import ../virtio/device.bend as D import ../virtio/input.bend as In import ../virtio/balloon.bend as Bl import ./layout.bend as L import ./abi.bend as V
Types
type Control source · line 60 · raw
Data
RunControl
IdleControl
WFI/WFE: the vCPU may sleep until an interrupt or its timer.
CpuStopControl
PSCI CPU_OFF: this vCPU stops; the VM goes on.
Stop@code:U32 -> Control
The VM stops: 0 power off, 1 reset, 2.. an error the VMM cannot handle.
type Machine source · line 69 · raw
Data
Machine@psci:0x2cb44898b57f05c48f38583063e077bf/src/arm64/psci.PsciState -> @uart:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl011.Pl011 -> @uart_irq:Bool -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @dev_irqs:List<&2, Bool> -> @rtc:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl031.Pl031 -> @rtc_irq:Bool -> @net:0x2cb44898b57f05c48f38583063e077bf/src/net/nat.Slirp -> @flash:0x2cb44898b57f05c48f38583063e077bf/src/dev/pflash.Pflash -> Machine
type Step source · line 110 · raw
Data
One handled exit: the machine after it and what the vCPU does next.
Step@machine:Machine -> @control:Control -> Step
type Wrote source · line 318 · raw
Data
A virtio write: the devices after it, the bytes the guest wrote to hvc0 and the frames it transmitted.
Wrote@devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @console:List<&2, U32> -> @frames:List<&2, List<&2, U32>> -> @vsock:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.VsockCmd> -> Wrote
Definitions
def Machine.devs source · line 73 · raw
@kinds:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.DevKind> -> List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>
One fresh device per kind, in slot order.
def Machine.lows source · line 81 · raw
@kinds:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.DevKind> -> List<&2, Bool>
One low interrupt line per kind.
def Machine.new source · line 90 · raw
@ncpus:Nat -> @kinds:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.DevKind> -> Machine
ncpus CPUs (only CPU 0 on), a fresh UART, one virtio device per kind in slot order, a fresh RTC and NAT, every interrupt line low.
def Machine.slots source · line 97 · raw
@devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @+n:U32 -> List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/vmm/layout.Region>
The regions of virtio slots n, n+1, ... for the devices left.
def Machine.bus source · line 104 · raw
@m:Machine -> List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/vmm/layout.Region>
def Machine.line source · line 116 · raw
@-R:Type -> @intid:U32 -> @old:Bool -> @new:Bool -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Bool>
The new level of a line; VmIrq when it differs from the old one.
def Machine.dev_lines source · line 133 · raw
@-R:Type -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @+n:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, List<&2, Bool>>
The lines of the virtio devices in slots n, n+1, ...; a device without a recorded level counts as low.
def Machine.irqs.at source · line 150 · raw
@-R:Type -> @+now:U32 -> @m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
Raises or lowers every line whose level changed and records the new levels; the RTC's at time now.
def Machine.nth_dev_irq source · line 162 · raw
@devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @k:Nat -> Bool
The line of virtio device k only: the old level at k, the device's, one raise or lower when they differ, the level recorded at k (the others untouched, without a step each).
def Machine.nth_line source · line 171 · raw
@lines:List<&2, Bool> -> @k:Nat -> Bool
def Machine.set_line source · line 180 · raw
@lines:List<&2, Bool> -> @k:Nat -> @+v:Bool -> List<&2, Bool>
def Machine.line_at source · line 189 · raw
@-R:Type -> @+k:Nat -> @m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.net_slot source · line 197 · raw
@devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @+i:Nat -> Nat
The slot of the first net device (the NAT's), or none (the list's length).
def Machine.devs_of source · line 206 · raw
@m:Machine -> List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>
def Machine.rtc_line source · line 212 · raw
@-R:Type -> @+now:U32 -> @m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
The RTC's line only, at time now.
def Machine.irqs_uart.at source · line 223 · raw
@-R:Type -> @+now:U32 -> @m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
The UART's and the RTC's lines only: after an access to the UART or the RTC, which leaves every virtio device as it was, so their lines cannot change (the virtio pass of Machine.irqs.at costs a step per device on every exit).
def Machine.alarm_armed source · line 233 · raw
@m:Machine -> Bool
Whether the RTC's alarm interrupt is unmasked (IMSC bit 0): only then does its line depend on the time.
def Machine.irqs.go source · line 238 · raw
@-R:Type -> @armed:Bool -> @m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.irqs source · line 250 · raw
@-R:Type -> @+m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
The same, at the time Op.now answers (read only when the alarm is armed, which keeps a host clock call off every exit).
def Machine.irqs_uart.go source · line 253 · raw
@-R:Type -> @armed:Bool -> @m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.irqs_uart source · line 262 · raw
@-R:Type -> @+m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.virtio_lines.rtc source · line 269 · raw
@-R:Type -> @armed:Bool -> @m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
After a write to virtio device k: only its line and the net device's can change (the frames it sent go through the NAT, whose answers go to the net device; console bytes, vsock commands and LAN frames go to the host), and the RTC's when its alarm is armed (time passes).
def Machine.virtio_lines source · line 278 · raw
@-R:Type -> @+k:Nat -> @+m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.write_lines source · line 287 · raw
@-R:Type -> @+n:Nat -> @+m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
The lines after a write to device n: the UART's (n 0) changes no virtio line; virtio device k's, its own and the net device's (Machine.virtio_lines).
def Machine.devs_read.head source · line 296 · raw
@t:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @r:Pair(0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev, U32) -> Pair(List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>, U32)
def Machine.devs_read.tail source · line 301 · raw
@d:0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev -> @r:Pair(List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>, U32) -> Pair(List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>, U32)
def Machine.devs_read source · line 307 · raw
@devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @n:Nat -> @off:U32 -> @size:U32 -> Pair(List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>, U32)
The read of virtio device n of the list; 0 past its end.
def Machine.wrote.head source · line 321 · raw
@t:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @o:0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.DevOut -> Wrote
def Machine.wrote.tail source · line 326 · raw
@d:0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev -> @w:Wrote -> Wrote
def Machine.devs_write source · line 332 · raw
@-R:Type -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @n:Nat -> @off:U32 -> @v:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Wrote>
The write to virtio device n of the list; nothing past its end.
def Machine.uart_read source · line 345 · raw
@p:0x2cb44898b57f05c48f38583063e077bf/src/arm64/psci.PsciState -> @ui:Bool -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @rt:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl031.Pl031 -> @ri:Bool -> @nt:0x2cb44898b57f05c48f38583063e077bf/src/net/nat.Slirp -> @fl:0x2cb44898b57f05c48f38583063e077bf/src/dev/pflash.Pflash -> @r:Pair(0x2cb44898b57f05c48f38583063e077bf/src/dev/pl011.Pl011, U32) -> Pair(Machine, U32)
def Machine.virtio_read source · line 350 · raw
@p:0x2cb44898b57f05c48f38583063e077bf/src/arm64/psci.PsciState -> @u:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl011.Pl011 -> @ui:Bool -> @lines:List<&2, Bool> -> @rt:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl031.Pl031 -> @ri:Bool -> @nt:0x2cb44898b57f05c48f38583063e077bf/src/net/nat.Slirp -> @fl:0x2cb44898b57f05c48f38583063e077bf/src/dev/pflash.Pflash -> @r:Pair(List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>, U32) -> Pair(Machine, U32)
def Machine.dev_read source · line 356 · raw
@n:Nat -> @m:Machine -> @off:U32 -> @size:U32 -> Pair(Machine, U32)
The 32-bit read of bus device n (0 the UART, k+1 virtio slot k) at off.
def Machine.print source · line 364 · raw
@-R:Type -> @bs:List<&2, U32> -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Unit>
Prints bytes on the console, when there are any.
def Machine.uart_write source · line 371 · raw
@-R:Type -> @p:0x2cb44898b57f05c48f38583063e077bf/src/arm64/psci.PsciState -> @ui:Bool -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @rt:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl031.Pl031 -> @ri:Bool -> @nt:0x2cb44898b57f05c48f38583063e077bf/src/net/nat.Slirp -> @fl:0x2cb44898b57f05c48f38583063e077bf/src/dev/pflash.Pflash -> @r:Pair(0x2cb44898b57f05c48f38583063e077bf/src/dev/pl011.Pl011, List<&2, U32>) -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.cmds source · line 381 · raw
@-R:Type -> @cs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.NetCmd> -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Unit>
Sends host commands, in order.
def Machine.to_net.one source · line 392 · raw
@-R:Type -> @done:Bool -> @+d:0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev -> @fs:List<&2, List<&2, U32>> -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>
The device after a delivery: frames go to the first net device (when done is False and d is one).
def Machine.to_net source · line 401 · raw
@-R:Type -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @+fs:List<&2, List<&2, U32>> -> @done:Bool -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>>
Delivers frames for the guest to the first net device of the list; done tells whether an earlier device took them. No frames, no change.
def Machine.slirp source · line 414 · raw
@-R:Type -> @p:0x2cb44898b57f05c48f38583063e077bf/src/arm64/psci.PsciState -> @u:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl011.Pl011 -> @ui:Bool -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @rt:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl031.Pl031 -> @ri:Bool -> @fl:0x2cb44898b57f05c48f38583063e077bf/src/dev/pflash.Pflash -> @o:0x2cb44898b57f05c48f38583063e077bf/src/net/nat.SlirpOut -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
Applies a NAT step: the new NAT state, its frames delivered to the first net device, its host commands as VmNet, in order.
def Machine.guest_frame.join source · line 422 · raw
@fs:List<&2, List<&2, U32>> -> @cs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.NetCmd> -> @o:0x2cb44898b57f05c48f38583063e077bf/src/net/nat.SlirpOut -> 0x2cb44898b57f05c48f38583063e077bf/src/net/nat.SlirpOut
def Machine.guest_frame source · line 429 · raw
@o:0x2cb44898b57f05c48f38583063e077bf/src/net/nat.SlirpOut -> @f:List<&2, U32> -> 0x2cb44898b57f05c48f38583063e077bf/src/net/nat.SlirpOut
One more frame from the guest through the NAT, its answers and commands after the earlier ones.
def Machine.guest_frames source · line 435 · raw
@n:0x2cb44898b57f05c48f38583063e077bf/src/net/nat.Slirp -> @fs:List<&2, List<&2, U32>> -> 0x2cb44898b57f05c48f38583063e077bf/src/net/nat.SlirpOut
Frames from the guest through the NAT, in order.
def Machine.vsock_cmds source · line 439 · raw
@-R:Type -> @cs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.VsockCmd> -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Unit>
Vsock commands for the host, in order.
def Machine.virtio_frames source · line 450 · raw
@-R:Type -> @none:Bool -> @p:0x2cb44898b57f05c48f38583063e077bf/src/arm64/psci.PsciState -> @u:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl011.Pl011 -> @ui:Bool -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @rt:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl031.Pl031 -> @ri:Bool -> @nt:0x2cb44898b57f05c48f38583063e077bf/src/net/nat.Slirp -> @fl:0x2cb44898b57f05c48f38583063e077bf/src/dev/pflash.Pflash -> @fs:List<&2, List<&2, U32>> -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
Transmitted frames through the NAT; none (most virtio writes) leave it as it is, without a pass over the devices.
def Machine.virtio_wrote source · line 459 · raw
@-R:Type -> @p:0x2cb44898b57f05c48f38583063e077bf/src/arm64/psci.PsciState -> @u:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl011.Pl011 -> @ui:Bool -> @lines:List<&2, Bool> -> @rt:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl031.Pl031 -> @ri:Bool -> @nt:0x2cb44898b57f05c48f38583063e077bf/src/net/nat.Slirp -> @fl:0x2cb44898b57f05c48f38583063e077bf/src/dev/pflash.Pflash -> @w:Wrote -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
After a virtio write: hvc0 bytes to the console, vsock commands to the host, transmitted frames through the NAT.
def Machine.dev_write source · line 468 · raw
@-R:Type -> @n:Nat -> @m:Machine -> @off:U32 -> @v:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
The 32-bit write of v to bus device n at off.
def Machine.put source · line 480 · raw
@-R:Type -> @xzr:Bool -> @r:U32 -> @v:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Unit>
Sets register r unless it is 31 (XZR).
def Machine.put_reg source · line 487 · raw
@-R:Type -> @+r:U32 -> @v:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Unit>
def Machine.mask source · line 491 · raw
@+size:U32 -> U32
The bits of an access of size bytes, within 32 bits.
def Machine.extend source · line 496 · raw
@+v:U32 -> @+size:U32 -> @sse:Bool -> @+sf:Bool -> 0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64
The loaded value: v masked to size bytes, then, when sse is set, sign- extended from size*8 bits to 64 bits (sf) or 32 bits (not sf).
def Machine.access_name source · line 503 · raw
@write:Bool -> String
def Machine.unmapped source · line 511 · raw
@write:Bool -> @m:Machine -> @ipa:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @size:U32 -> @+srt:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
An access no device holds: reads give 0, writes are dropped.
def Machine.read_lines source · line 521 · raw
@-R:Type -> @lines:Bool -> @+m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
The lines after a read: a UART read (lines true) can lower its interrupt; a virtio register read changes no line, so the pass is skipped.
def Machine.loaded source · line 529 · raw
@r:Pair(Machine, U32) -> @+size:U32 -> @srt:U32 -> @sse:Bool -> @sf:Bool -> @lines:Bool -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
A device read has happened: the register, the lines, the PC.
def Machine.access source · line 538 · raw
@write:Bool -> @+n:Nat -> @m:Machine -> @off:U32 -> @size:U32 -> @srt:U32 -> @value:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
def Machine.route source · line 550 · raw
@hit:Maybe<&2, 0x2cb44898b57f05c48f38583063e077bf/src/vmm/layout.Hit> -> @m:Machine -> @ipa:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @write:Bool -> @size:U32 -> @srt:U32 -> @value:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
def Machine.rtc_read.fin source · line 559 · raw
@p:0x2cb44898b57f05c48f38583063e077bf/src/arm64/psci.PsciState -> @u:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl011.Pl011 -> @ui:Bool -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @ri:Bool -> @nt:0x2cb44898b57f05c48f38583063e077bf/src/net/nat.Slirp -> @fl:0x2cb44898b57f05c48f38583063e077bf/src/dev/pflash.Pflash -> @r:Pair(0x2cb44898b57f05c48f38583063e077bf/src/dev/pl031.Pl031, U32) -> Pair(Machine, U32)
def Machine.rtc_read source · line 564 · raw
@m:Machine -> @off:U32 -> @now:U32 -> Pair(Machine, U32)
def Machine.rtc_write source · line 569 · raw
@m:Machine -> @off:U32 -> @v:U32 -> @now:U32 -> Machine
def Machine.rtc_loaded source · line 575 · raw
@r:Pair(Machine, U32) -> @+size:U32 -> @srt:U32 -> @sse:Bool -> @sf:Bool -> @+now:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
An RTC read has happened: the register, the lines, the PC.
def Machine.rtc_access source · line 585 · raw
@write:Bool -> @m:Machine -> @off:U32 -> @size:U32 -> @srt:U32 -> @value:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> @+now:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
An RTC access at off, at time now.
def Machine.rtc_hit source · line 596 · raw
@+ipa:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> Maybe<&2, 0x2cb44898b57f05c48f38583063e077bf/src/vmm/layout.Hit>
def Machine.decode source · line 600 · raw
@rtc:Maybe<&2, 0x2cb44898b57f05c48f38583063e077bf/src/vmm/layout.Hit> -> @m:Machine -> @ipa:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @write:Bool -> @size:U32 -> @srt:U32 -> @value:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
The RTC access when it holds ipa, else the bus.
def Machine.with_flash source · line 613 · raw
@m:Machine -> @fl:0x2cb44898b57f05c48f38583063e077bf/src/dev/pflash.Pflash -> Machine
def Machine.flash_of source · line 618 · raw
@m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/dev/pflash.Pflash
def Machine.flash_cmds source · line 624 · raw
@-R:Type -> @cs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.FlashCmd> -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Unit>
Runs flash commands in order.
def Machine.flash_wrote source · line 633 · raw
@m:Machine -> @o:0x2cb44898b57f05c48f38583063e077bf/src/dev/pflash.PfOut -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
def Machine.flash_value source · line 643 · raw
@-R:Type -> @r:Maybe<&2, U32> -> @off:U32 -> @size:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, U32>
A read in read-array mode reaches the host's bytes; any other mode answers its register.
def Machine.flash_access source · line 650 · raw
@write:Bool -> @m:Machine -> @+off:U32 -> @+size:U32 -> @srt:U32 -> @value:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
def Machine.flash_hit source · line 663 · raw
@+ipa:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> Maybe<&2, 0x2cb44898b57f05c48f38583063e077bf/src/vmm/layout.Hit>
def Machine.decode.flash source · line 667 · raw
@flash:Maybe<&2, 0x2cb44898b57f05c48f38583063e077bf/src/vmm/layout.Hit> -> @m:Machine -> @+ipa:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @write:Bool -> @size:U32 -> @srt:U32 -> @value:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
The flash access when bank 1 holds ipa, else the RTC or the bus.
def Machine.mmio source · line 674 · raw
@m:Machine -> @ipa:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @write:Bool -> @size:U32 -> @srt:U32 -> @value:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
def Machine.psci.effect source · line 680 · raw
@e:0x2cb44898b57f05c48f38583063e077bf/src/arm64/psci.PsciEffect -> @m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
def Machine.psci.fin source · line 699 · raw
@r:0x2cb44898b57f05c48f38583063e077bf/src/arm64/psci.PsciResult -> @u:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl011.Pl011 -> @ui:Bool -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @rt:0x2cb44898b57f05c48f38583063e077bf/src/dev/pl031.Pl031 -> @ri:Bool -> @nt:0x2cb44898b57f05c48f38583063e077bf/src/net/nat.Slirp -> @fl:0x2cb44898b57f05c48f38583063e077bf/src/dev/pflash.Pflash -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
def Machine.psci source · line 707 · raw
@cpu:U32 -> @m:Machine -> @x0:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @x1:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @x2:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @x3:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
A PSCI call (HVC #0, or any SMC) from cpu.
def Machine.hvc source · line 712 · raw
@zero:Bool -> @cpu:U32 -> @m:Machine -> @x0:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @x1:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @x2:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @x3:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
def Machine.fail source · line 722 · raw
@m:Machine -> @msg:String -> @code:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
Logs a line and stops the VM with code.
def Machine.trap source · line 727 · raw
@cpu:U32 -> @m:Machine -> @t:0x2cb44898b57f05c48f38583063e077bf/src/arm64/esr.Trap -> @x0:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @x1:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @x2:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> @x3:0x2cb44898b57f05c48f38583063e077bf/src/lib/u64.U64 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<Step, Step>
def Machine.on_exit source · line 755 · raw
@cpu:U32 -> @m:Machine -> @e:0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.RawExit -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Vm<Step>
def Machine.uart_room source · line 767 · raw
@m:Machine -> Nat
How many bytes of console input the UART's receive FIFO takes now.
def Machine.devs_input source · line 773 · raw
@-R:Type -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @+bytes:List<&2, U32> -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>>
Console input to every device (D.Dev.input: console devices take it).
def Machine.input.go source · line 783 · raw
@-R:Type -> @m:Machine -> @+bytes:List<&2, U32> -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.input source · line 793 · raw
@m:Machine -> @bytes:List<&2, U32> -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Vm<Machine>
Bytes typed on the host console: queued in the UART (Uart.Pl011.push_rx) and given to every ConsoleKind device (D.Dev.input), then the interrupt lines are updated as after a device access.
def Machine.net_event.go source · line 796 · raw
@-R:Type -> @m:Machine -> @ev:0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.NetEvent -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.net_event source · line 806 · raw
@m:Machine -> @ev:0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.NetEvent -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Vm<Machine>
A network event from the host: Slirp.host_event, its frames delivered to the first NetKind device, its commands as VmNet, in order, then the interrupt lines are updated as after a device access.
def Machine.backlog source · line 811 · raw
@devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> U32
The frames pending for the guest in the first of the devices that is a NetKind device; 0 when there is none.
def Machine.big source · line 818 · raw
@ds:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> Bool
def Machine.net_big source · line 827 · raw
@m:Machine -> Bool
Whether the first NetKind device takes TCP segments of up to 64 KiB (host frames, so host data comes as V.TcpReady): see D.Dev.big.
def Machine.net_show source · line 837 · raw
@+m:Machine -> String
The frames pending for the guest in the NetKind device (0 when there is none), plus the NAT's queued bytes in 1460-byte segments: what the host's readers wait on. The NAT's connections as text (the control socket's net command), with the frames pending for the guest.
def Machine.net_backlog source · line 842 · raw
@m:Machine -> U32
def Machine.vsock_devs.out source · line 847 · raw
@-R:Type -> @o:0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.DevOut -> @t:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>>
def Machine.vsock_index source · line 855 · raw
@devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> Nat
The index of the first VsockKind device (the list's length when none).
def Machine.vsock_at source · line 863 · raw
@-R:Type -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @n:Nat -> @ev:0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.VsockEvent -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>>
A vsock event to device n of the list (no change past its end).
def Machine.vsock_devs source · line 878 · raw
@-R:Type -> @+devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @ev:0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.VsockEvent -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>>
A vsock event from the host: to the first VsockKind device, its commands to the host, then the interrupt lines.
def Machine.vsock_event.go source · line 881 · raw
@-R:Type -> @m:Machine -> @ev:0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.VsockEvent -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.vsock_event source · line 888 · raw
@m:Machine -> @ev:0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.VsockEvent -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Vm<Machine>
def Machine.vsock_backlog.of source · line 891 · raw
@devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> U32
def Machine.vsock_backlog source · line 899 · raw
@m:Machine -> U32
The vsock device's backlog (D.Dev.vsock_backlog), for host backpressure.
def Machine.devs_hid source · line 906 · raw
@-R:Type -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @+ev:0x2cb44898b57f05c48f38583063e077bf/src/virtio/input.Hid -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>>
A keyboard or pointer report to every device (D.Dev.hid: input devices take it).
def Machine.hid.go source · line 916 · raw
@-R:Type -> @m:Machine -> @ev:0x2cb44898b57f05c48f38583063e077bf/src/virtio/input.Hid -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.hid source · line 926 · raw
@m:Machine -> @ev:0x2cb44898b57f05c48f38583063e077bf/src/virtio/input.Hid -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Vm<Machine>
A key, pointer move or button from the host's window: given to every InputKind device (D.Dev.hid), then the interrupt lines are updated as after a device access.
def Machine.devs_balloon source · line 932 · raw
@devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @+pages:U32 -> List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>
The balloon's target (balloon MiB): pages of 4 KiB to every device
(D.Dev.balloon: the balloon takes it and raises its config change
interrupt), then the interrupt lines as after a device access.
def Machine.balloon.go source · line 939 · raw
@-R:Type -> @m:Machine -> @+pages:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.balloon source · line 944 · raw
@m:Machine -> @+pages:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Vm<Machine>
def Machine.devs_balloon_auto source · line 949 · raw
@devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>
balloon auto on the control socket: the automatic balloon takes over
again from a target set by hand.
def Machine.balloon_auto source · line 956 · raw
@m:Machine -> Machine
def Machine.devs_auto source · line 962 · raw
@devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> Bool
Whether the machine has the automatic balloon.
def Machine.auto_balloon source · line 969 · raw
@m:Machine -> Bool
def Machine.devs_poll source · line 977 · raw
@-R:Type -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>>
Every Auto.period_ms() (host/main.bend's balloon_poll): the automatic balloon asks its driver for fresh statistics (D.Dev.balloon_poll), and the interrupt lines follow.
def Machine.balloon_poll.go source · line 987 · raw
@-R:Type -> @m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.balloon_poll source · line 994 · raw
@m:Machine -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Vm<Machine>
def Machine.balloon_of source · line 998 · raw
@devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> Maybe<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/balloon.Bal>
The balloon's state, when the machine has one.
def Machine.balloon_info source · line 1005 · raw
@m:Machine -> Maybe<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/balloon.Bal>
def Machine.devs_lan source · line 1012 · raw
@-R:Type -> @devs:List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev> -> @+len:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, List<&2, 0x2cb44898b57f05c48f38583063e077bf/src/virtio/device.Dev>>
A frame of len bytes the host holds for the LAN NIC, to every device (D.Dev.lan_ready: the LanKind device takes it).
def Machine.lan.go source · line 1022 · raw
@-R:Type -> @m:Machine -> @len:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Op<R, Machine>
def Machine.lan source · line 1032 · raw
@m:Machine -> @len:U32 -> 0x2cb44898b57f05c48f38583063e077bf/src/vmm/abi.Vm<Machine>
The host holds a LAN frame of len bytes for the guest (V.LanSend from another VM): delivered to the LAN NIC's receive queue, then the interrupt lines are updated as after a device access.