~/bend-docscommunity

src/vmm/machine.bend checks

raw source on the hub · import 0x53d84b18be53da049fb18b7759d158da/src/vmm/machine.bend as Machine

15 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 ../disk/pack.bend as Pk
import ./layout.bend as L
import ./abi.bend as V

Types

type Control source · line 61 · raw

Data

type Machine source · line 70 · raw

Data

type Step source · line 111 · raw

Data

One handled exit: the machine after it and what the vCPU does next.

type Wrote source · line 319 · raw

Data

A virtio write: the devices after it, the bytes the guest wrote to hvc0 and the frames it transmitted.

type PackDone source · line 1040 · raw

Data

A control command's machine and its reply.

Definitions

def Machine.devs source · line 74 · raw

@kinds:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.DevKind> -> List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev>

One fresh device per kind, in slot order.

def Machine.lows source · line 82 · raw

@kinds:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.DevKind> -> List<&2, Bool>

One low interrupt line per kind.

def Machine.new source · line 91 · raw

@ncpus:Nat -> @kinds:List<&2, 0x53d84b18be53da049fb18b7759d158da/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 98 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @+n:U32 -> List<&2, 0x53d84b18be53da049fb18b7759d158da/src/vmm/layout.Region>

The regions of virtio slots n, n+1, ... for the devices left.

def Machine.bus source · line 105 · raw

@m:Machine -> List<&2, 0x53d84b18be53da049fb18b7759d158da/src/vmm/layout.Region>

def Machine.line source · line 117 · raw

@-R:Type -> @intid:U32 -> @old:Bool -> @new:Bool -> 0x53d84b18be53da049fb18b7759d158da/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 134 · raw

@-R:Type -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @+n:U32 -> 0x53d84b18be53da049fb18b7759d158da/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 151 · raw

@-R:Type -> @+now:U32 -> @m:Machine -> 0x53d84b18be53da049fb18b7759d158da/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 163 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/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 172 · raw

@lines:List<&2, Bool> -> @k:Nat -> Bool

def Machine.set_line source · line 181 · raw

@lines:List<&2, Bool> -> @k:Nat -> @+v:Bool -> List<&2, Bool>

def Machine.line_at source · line 190 · raw

@-R:Type -> @+k:Nat -> @m:Machine -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.net_slot source · line 198 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/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 207 · raw

@m:Machine -> List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev>

def Machine.rtc_line source · line 213 · raw

@-R:Type -> @+now:U32 -> @m:Machine -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

The RTC's line only, at time now.

def Machine.irqs_uart.at source · line 224 · raw

@-R:Type -> @+now:U32 -> @m:Machine -> 0x53d84b18be53da049fb18b7759d158da/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 234 · 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 239 · raw

@-R:Type -> @armed:Bool -> @m:Machine -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.irqs source · line 251 · raw

@-R:Type -> @+m:Machine -> 0x53d84b18be53da049fb18b7759d158da/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 254 · raw

@-R:Type -> @armed:Bool -> @m:Machine -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.irqs_uart source · line 263 · raw

@-R:Type -> @+m:Machine -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.virtio_lines.rtc source · line 270 · raw

@-R:Type -> @armed:Bool -> @m:Machine -> 0x53d84b18be53da049fb18b7759d158da/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 279 · raw

@-R:Type -> @+k:Nat -> @+m:Machine -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.write_lines source · line 288 · raw

@-R:Type -> @+n:Nat -> @+m:Machine -> 0x53d84b18be53da049fb18b7759d158da/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 297 · raw

@t:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @r:Pair(0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev, U32) -> Pair(List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev>, U32)

def Machine.devs_read.tail source · line 302 · raw

@d:0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev -> @r:Pair(List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev>, U32) -> Pair(List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev>, U32)

def Machine.devs_read source · line 308 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @n:Nat -> @off:U32 -> @size:U32 -> Pair(List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev>, U32)

The read of virtio device n of the list; 0 past its end.

def Machine.wrote.head source · line 322 · raw

@t:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @o:0x53d84b18be53da049fb18b7759d158da/src/virtio/device.DevOut -> Wrote

def Machine.wrote.tail source · line 327 · raw

@d:0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev -> @w:Wrote -> Wrote

def Machine.devs_write source · line 333 · raw

@-R:Type -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @n:Nat -> @off:U32 -> @v:U32 -> 0x53d84b18be53da049fb18b7759d158da/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 346 · raw

@p:0x53d84b18be53da049fb18b7759d158da/src/arm64/psci.PsciState -> @ui:Bool -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @rt:0x53d84b18be53da049fb18b7759d158da/src/dev/pl031.Pl031 -> @ri:Bool -> @nt:0x53d84b18be53da049fb18b7759d158da/src/net/nat.Slirp -> @fl:0x53d84b18be53da049fb18b7759d158da/src/dev/pflash.Pflash -> @r:Pair(0x53d84b18be53da049fb18b7759d158da/src/dev/pl011.Pl011, U32) -> Pair(Machine, U32)

def Machine.virtio_read source · line 351 · raw

@p:0x53d84b18be53da049fb18b7759d158da/src/arm64/psci.PsciState -> @u:0x53d84b18be53da049fb18b7759d158da/src/dev/pl011.Pl011 -> @ui:Bool -> @lines:List<&2, Bool> -> @rt:0x53d84b18be53da049fb18b7759d158da/src/dev/pl031.Pl031 -> @ri:Bool -> @nt:0x53d84b18be53da049fb18b7759d158da/src/net/nat.Slirp -> @fl:0x53d84b18be53da049fb18b7759d158da/src/dev/pflash.Pflash -> @r:Pair(List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev>, U32) -> Pair(Machine, U32)

def Machine.dev_read source · line 357 · 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 365 · raw

@-R:Type -> @bs:List<&2, U32> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Unit>

Prints bytes on the console, when there are any.

def Machine.uart_write source · line 372 · raw

@-R:Type -> @p:0x53d84b18be53da049fb18b7759d158da/src/arm64/psci.PsciState -> @ui:Bool -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @rt:0x53d84b18be53da049fb18b7759d158da/src/dev/pl031.Pl031 -> @ri:Bool -> @nt:0x53d84b18be53da049fb18b7759d158da/src/net/nat.Slirp -> @fl:0x53d84b18be53da049fb18b7759d158da/src/dev/pflash.Pflash -> @r:Pair(0x53d84b18be53da049fb18b7759d158da/src/dev/pl011.Pl011, List<&2, U32>) -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.cmds source · line 382 · raw

@-R:Type -> @cs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.NetCmd> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Unit>

Sends host commands, in order.

def Machine.to_net.one source · line 393 · raw

@-R:Type -> @done:Bool -> @+d:0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev -> @fs:List<&2, List<&2, U32>> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, 0x53d84b18be53da049fb18b7759d158da/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 402 · raw

@-R:Type -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @+fs:List<&2, List<&2, U32>> -> @done:Bool -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, List<&2, 0x53d84b18be53da049fb18b7759d158da/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 415 · raw

@-R:Type -> @p:0x53d84b18be53da049fb18b7759d158da/src/arm64/psci.PsciState -> @u:0x53d84b18be53da049fb18b7759d158da/src/dev/pl011.Pl011 -> @ui:Bool -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @rt:0x53d84b18be53da049fb18b7759d158da/src/dev/pl031.Pl031 -> @ri:Bool -> @fl:0x53d84b18be53da049fb18b7759d158da/src/dev/pflash.Pflash -> @o:0x53d84b18be53da049fb18b7759d158da/src/net/nat.SlirpOut -> 0x53d84b18be53da049fb18b7759d158da/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 423 · raw

@fs:List<&2, List<&2, U32>> -> @cs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.NetCmd> -> @o:0x53d84b18be53da049fb18b7759d158da/src/net/nat.SlirpOut -> 0x53d84b18be53da049fb18b7759d158da/src/net/nat.SlirpOut

def Machine.guest_frame source · line 430 · raw

@o:0x53d84b18be53da049fb18b7759d158da/src/net/nat.SlirpOut -> @f:List<&2, U32> -> 0x53d84b18be53da049fb18b7759d158da/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 436 · raw

@n:0x53d84b18be53da049fb18b7759d158da/src/net/nat.Slirp -> @fs:List<&2, List<&2, U32>> -> 0x53d84b18be53da049fb18b7759d158da/src/net/nat.SlirpOut

Frames from the guest through the NAT, in order.

def Machine.vsock_cmds source · line 440 · raw

@-R:Type -> @cs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.VsockCmd> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Unit>

Vsock commands for the host, in order.

def Machine.virtio_frames source · line 451 · raw

@-R:Type -> @none:Bool -> @p:0x53d84b18be53da049fb18b7759d158da/src/arm64/psci.PsciState -> @u:0x53d84b18be53da049fb18b7759d158da/src/dev/pl011.Pl011 -> @ui:Bool -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @rt:0x53d84b18be53da049fb18b7759d158da/src/dev/pl031.Pl031 -> @ri:Bool -> @nt:0x53d84b18be53da049fb18b7759d158da/src/net/nat.Slirp -> @fl:0x53d84b18be53da049fb18b7759d158da/src/dev/pflash.Pflash -> @fs:List<&2, List<&2, U32>> -> 0x53d84b18be53da049fb18b7759d158da/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 460 · raw

@-R:Type -> @p:0x53d84b18be53da049fb18b7759d158da/src/arm64/psci.PsciState -> @u:0x53d84b18be53da049fb18b7759d158da/src/dev/pl011.Pl011 -> @ui:Bool -> @lines:List<&2, Bool> -> @rt:0x53d84b18be53da049fb18b7759d158da/src/dev/pl031.Pl031 -> @ri:Bool -> @nt:0x53d84b18be53da049fb18b7759d158da/src/net/nat.Slirp -> @fl:0x53d84b18be53da049fb18b7759d158da/src/dev/pflash.Pflash -> @w:Wrote -> 0x53d84b18be53da049fb18b7759d158da/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 469 · raw

@-R:Type -> @n:Nat -> @m:Machine -> @off:U32 -> @v:U32 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

The 32-bit write of v to bus device n at off.

def Machine.put source · line 481 · raw

@-R:Type -> @xzr:Bool -> @r:U32 -> @v:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Unit>

Sets register r unless it is 31 (XZR).

def Machine.put_reg source · line 488 · raw

@-R:Type -> @+r:U32 -> @v:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Unit>

def Machine.mask source · line 492 · raw

@+size:U32 -> U32

The bits of an access of size bytes, within 32 bits.

def Machine.extend source · line 497 · raw

@+v:U32 -> @+size:U32 -> @sse:Bool -> @+sf:Bool -> 0x53d84b18be53da049fb18b7759d158da/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 504 · raw

@write:Bool -> String

def Machine.unmapped source · line 512 · raw

@write:Bool -> @m:Machine -> @ipa:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @size:U32 -> @+srt:U32 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

An access no device holds: reads give 0, writes are dropped.

def Machine.read_lines source · line 522 · raw

@-R:Type -> @lines:Bool -> @+m:Machine -> 0x53d84b18be53da049fb18b7759d158da/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 530 · raw

@r:Pair(Machine, U32) -> @+size:U32 -> @srt:U32 -> @sse:Bool -> @sf:Bool -> @lines:Bool -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

A device read has happened: the register, the lines, the PC.

def Machine.access source · line 539 · raw

@write:Bool -> @+n:Nat -> @m:Machine -> @off:U32 -> @size:U32 -> @srt:U32 -> @value:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

def Machine.route source · line 551 · raw

@hit:Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/vmm/layout.Hit> -> @m:Machine -> @ipa:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @write:Bool -> @size:U32 -> @srt:U32 -> @value:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

def Machine.rtc_read.fin source · line 560 · raw

@p:0x53d84b18be53da049fb18b7759d158da/src/arm64/psci.PsciState -> @u:0x53d84b18be53da049fb18b7759d158da/src/dev/pl011.Pl011 -> @ui:Bool -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @ri:Bool -> @nt:0x53d84b18be53da049fb18b7759d158da/src/net/nat.Slirp -> @fl:0x53d84b18be53da049fb18b7759d158da/src/dev/pflash.Pflash -> @r:Pair(0x53d84b18be53da049fb18b7759d158da/src/dev/pl031.Pl031, U32) -> Pair(Machine, U32)

def Machine.rtc_read source · line 565 · raw

@m:Machine -> @off:U32 -> @now:U32 -> Pair(Machine, U32)

def Machine.rtc_write source · line 570 · raw

@m:Machine -> @off:U32 -> @v:U32 -> @now:U32 -> Machine

def Machine.rtc_loaded source · line 576 · raw

@r:Pair(Machine, U32) -> @+size:U32 -> @srt:U32 -> @sse:Bool -> @sf:Bool -> @+now:U32 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

An RTC read has happened: the register, the lines, the PC.

def Machine.rtc_access source · line 586 · raw

@write:Bool -> @m:Machine -> @off:U32 -> @size:U32 -> @srt:U32 -> @value:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> @+now:U32 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

An RTC access at off, at time now.

def Machine.rtc_hit source · line 597 · raw

@+ipa:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/vmm/layout.Hit>

def Machine.decode source · line 601 · raw

@rtc:Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/vmm/layout.Hit> -> @m:Machine -> @ipa:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @write:Bool -> @size:U32 -> @srt:U32 -> @value:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

The RTC access when it holds ipa, else the bus.

def Machine.with_flash source · line 614 · raw

@m:Machine -> @fl:0x53d84b18be53da049fb18b7759d158da/src/dev/pflash.Pflash -> Machine

def Machine.flash_of source · line 619 · raw

@m:Machine -> 0x53d84b18be53da049fb18b7759d158da/src/dev/pflash.Pflash

def Machine.flash_cmds source · line 625 · raw

@-R:Type -> @cs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.FlashCmd> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Unit>

Runs flash commands in order.

def Machine.flash_wrote source · line 634 · raw

@m:Machine -> @o:0x53d84b18be53da049fb18b7759d158da/src/dev/pflash.PfOut -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

def Machine.flash_value source · line 644 · raw

@-R:Type -> @r:Maybe<&2, U32> -> @off:U32 -> @size:U32 -> 0x53d84b18be53da049fb18b7759d158da/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 651 · raw

@write:Bool -> @m:Machine -> @+off:U32 -> @+size:U32 -> @srt:U32 -> @value:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

def Machine.flash_hit source · line 664 · raw

@+ipa:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/vmm/layout.Hit>

def Machine.decode.flash source · line 668 · raw

@flash:Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/vmm/layout.Hit> -> @m:Machine -> @+ipa:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @write:Bool -> @size:U32 -> @srt:U32 -> @value:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> 0x53d84b18be53da049fb18b7759d158da/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 675 · raw

@m:Machine -> @ipa:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @write:Bool -> @size:U32 -> @srt:U32 -> @value:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @sse:Bool -> @sf:Bool -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

def Machine.psci.effect source · line 681 · raw

@e:0x53d84b18be53da049fb18b7759d158da/src/arm64/psci.PsciEffect -> @m:Machine -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

def Machine.psci.fin source · line 700 · raw

@r:0x53d84b18be53da049fb18b7759d158da/src/arm64/psci.PsciResult -> @u:0x53d84b18be53da049fb18b7759d158da/src/dev/pl011.Pl011 -> @ui:Bool -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @lines:List<&2, Bool> -> @rt:0x53d84b18be53da049fb18b7759d158da/src/dev/pl031.Pl031 -> @ri:Bool -> @nt:0x53d84b18be53da049fb18b7759d158da/src/net/nat.Slirp -> @fl:0x53d84b18be53da049fb18b7759d158da/src/dev/pflash.Pflash -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

def Machine.psci source · line 708 · raw

@cpu:U32 -> @m:Machine -> @x0:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @x1:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @x2:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @x3:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

A PSCI call (HVC #0, or any SMC) from cpu.

def Machine.hvc source · line 713 · raw

@zero:Bool -> @cpu:U32 -> @m:Machine -> @x0:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @x1:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @x2:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @x3:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

def Machine.fail source · line 723 · raw

@m:Machine -> @msg:String -> @code:U32 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

Logs a line and stops the VM with code.

def Machine.trap source · line 728 · raw

@cpu:U32 -> @m:Machine -> @t:0x53d84b18be53da049fb18b7759d158da/src/arm64/esr.Trap -> @x0:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @x1:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @x2:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> @x3:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<Step, Step>

def Machine.on_exit source · line 756 · raw

@cpu:U32 -> @m:Machine -> @e:0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.RawExit -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Vm<Step>

def Machine.uart_room source · line 768 · raw

@m:Machine -> Nat

How many bytes of console input the UART's receive FIFO takes now.

def Machine.devs_input source · line 774 · raw

@-R:Type -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @+bytes:List<&2, U32> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev>>

Console input to every device (D.Dev.input: console devices take it).

def Machine.input.go source · line 784 · raw

@-R:Type -> @m:Machine -> @+bytes:List<&2, U32> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.input source · line 794 · raw

@m:Machine -> @bytes:List<&2, U32> -> 0x53d84b18be53da049fb18b7759d158da/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 797 · raw

@-R:Type -> @m:Machine -> @ev:0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.NetEvent -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.net_event source · line 807 · raw

@m:Machine -> @ev:0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.NetEvent -> 0x53d84b18be53da049fb18b7759d158da/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 812 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/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 819 · raw

@ds:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> Bool

def Machine.net_big source · line 828 · 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 838 · 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 843 · raw

@m:Machine -> U32

def Machine.vsock_devs.out source · line 848 · raw

@-R:Type -> @o:0x53d84b18be53da049fb18b7759d158da/src/virtio/device.DevOut -> @t:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev>>

def Machine.vsock_index source · line 856 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> Nat

The index of the first VsockKind device (the list's length when none).

def Machine.vsock_at source · line 864 · raw

@-R:Type -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @n:Nat -> @ev:0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.VsockEvent -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev>>

A vsock event to device n of the list (no change past its end).

def Machine.vsock_devs source · line 879 · raw

@-R:Type -> @+devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @ev:0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.VsockEvent -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, List<&2, 0x53d84b18be53da049fb18b7759d158da/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 882 · raw

@-R:Type -> @m:Machine -> @ev:0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.VsockEvent -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.vsock_event source · line 889 · raw

@m:Machine -> @ev:0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.VsockEvent -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Vm<Machine>

def Machine.vsock_backlog.of source · line 892 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> U32

def Machine.vsock_backlog source · line 900 · raw

@m:Machine -> U32

The vsock device's backlog (D.Dev.vsock_backlog), for host backpressure.

def Machine.devs_hid source · line 907 · raw

@-R:Type -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @+ev:0x53d84b18be53da049fb18b7759d158da/src/virtio/input.Hid -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, List<&2, 0x53d84b18be53da049fb18b7759d158da/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 917 · raw

@-R:Type -> @m:Machine -> @ev:0x53d84b18be53da049fb18b7759d158da/src/virtio/input.Hid -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.hid source · line 927 · raw

@m:Machine -> @ev:0x53d84b18be53da049fb18b7759d158da/src/virtio/input.Hid -> 0x53d84b18be53da049fb18b7759d158da/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 933 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @+pages:U32 -> List<&2, 0x53d84b18be53da049fb18b7759d158da/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 940 · raw

@-R:Type -> @m:Machine -> @+pages:U32 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.balloon source · line 945 · raw

@m:Machine -> @+pages:U32 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Vm<Machine>

def Machine.devs_balloon_auto source · line 950 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> List<&2, 0x53d84b18be53da049fb18b7759d158da/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 957 · raw

@m:Machine -> Machine

def Machine.devs_auto source · line 963 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> Bool

Whether the machine has the automatic balloon.

def Machine.auto_balloon source · line 970 · raw

@m:Machine -> Bool

def Machine.devs_poll source · line 978 · raw

@-R:Type -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, List<&2, 0x53d84b18be53da049fb18b7759d158da/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 988 · raw

@-R:Type -> @m:Machine -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.balloon_poll source · line 995 · raw

@m:Machine -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Vm<Machine>

def Machine.balloon_of source · line 999 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/balloon.Bal>

The balloon's state, when the machine has one.

def Machine.balloon_info source · line 1006 · raw

@m:Machine -> Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/balloon.Bal>

def Machine.devs_lan source · line 1013 · raw

@-R:Type -> @devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @+len:U32 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, List<&2, 0x53d84b18be53da049fb18b7759d158da/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 1023 · raw

@-R:Type -> @m:Machine -> @len:U32 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, Machine>

def Machine.lan source · line 1033 · raw

@m:Machine -> @len:U32 -> 0x53d84b18be53da049fb18b7759d158da/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.

def Machine.pack.first source · line 1043 · raw

@m:Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/disk/pack.Pack> -> @rest:Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/disk/pack.Pack> -> Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/disk/pack.Pack>

def Machine.pack_of source · line 1050 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/disk/pack.Pack>

def Machine.pack source · line 1058 · raw

@m:Machine -> Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/disk/pack.Pack>

The machine's pack (--disk NAME:pack), if it has one.

def Machine.devs_pack_add source · line 1063 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @+path:String -> @+id:0x53d84b18be53da049fb18b7759d158da/src/disk/pack.PackId -> List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev>

def Machine.devs_pack_drop source · line 1070 · raw

@devs:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev> -> @+off:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> List<&2, 0x53d84b18be53da049fb18b7759d158da/src/virtio/device.Dev>

def Machine.pack_add.opened source · line 1080 · raw

@-R:Type -> @mid:Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/disk/pack.PackId> -> @m:Machine -> @+path:String -> @+errno:U32 -> @+off:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, PackDone>

After the open: the file is added at off (its slot at the pack's end) and the driver told (config change, then the interrupt lines as after a device access); an open that failed changes nothing.

def Machine.pack_add.go source · line 1091 · raw

@-R:Type -> @mp:Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/disk/pack.Pack> -> @m:Machine -> @+path:String -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, PackDone>

def Machine.pack_add source · line 1104 · raw

@+m:Machine -> @path:String -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Vm<PackDone>

pack add PATH: the host opens the file into the new entry's descriptor slot and says what it is; the pack takes it at its end. Reply: "OFFSET LENGTH" in bytes, or an error.

def Machine.pack_drop.can source · line 1107 · raw

@-R:Type -> @can:Bool -> @m:Machine -> @+pk:0x53d84b18be53da049fb18b7759d158da/src/disk/pack.Pack -> @+off:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, PackDone>

def Machine.pack_drop.go source · line 1119 · raw

@-R:Type -> @mp:Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/disk/pack.Pack> -> @m:Machine -> @+off:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, PackDone>

def Machine.pack_drop source · line 1128 · raw

@+m:Machine -> @+off:0x53d84b18be53da049fb18b7759d158da/src/lib/u64.U64 -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Vm<PackDone>

pack drop OFFSET: the live entry at OFFSET is dead from now on (reads of its slot fail; the slot is never given again) and its file is closed.

def Machine.pack_check.got source · line 1134 · raw

@-R:Type -> @same:Bool -> @+path:String -> @more:0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, String> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, String>

After a restore: each live entry's file, opened again, must be the one that was added; the first that is missing or changed is named (the restore fails, as a missing --disk image fails it); "" when all are.

def Machine.pack_check.one source · line 1141 · raw

@-R:Type -> @live:Bool -> @+n:U32 -> @+path:String -> @+id:0x53d84b18be53da049fb18b7759d158da/src/disk/pack.PackId -> @more:0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, String> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, String>

def Machine.pack_check.go source · line 1150 · raw

@-R:Type -> @es:List<&2, 0x53d84b18be53da049fb18b7759d158da/src/disk/pack.PackEntry> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, String>

def Machine.pack_check.of source · line 1157 · raw

@-R:Type -> @mp:Maybe<&2, 0x53d84b18be53da049fb18b7759d158da/src/disk/pack.Pack> -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Op<R, String>

def Machine.pack_check source · line 1164 · raw

@m:Machine -> 0x53d84b18be53da049fb18b7759d158da/src/vmm/abi.Vm<String>