~/bend-docscommunity

src/vmm/abi.bend checks

raw source on the hub · import 0x5fb57f1b8ad4cb61031f616c44af7445/src/vmm/abi.bend as Abi

2 imports
import Base
import ../lib/u64.bend as U

Types

type RawExit source · line 17 · raw

Data

A vCPU exit as Hypervisor.framework reports it, decoded no further.

type PowerOp source · line 30 · raw

Data

type NetCmd source · line 37 · raw

Data

Host network commands from the NAT (src/net/nat.bend). Connections are numbered by the NAT; addresses are IPv4 as U32 (10.0.2.2 = 167772674). The host maps 10.0.2.2 to its own loopback and 10.0.2.3 to its DNS resolver.

type NetEvent source · line 68 · raw

Data

What the host reports back to the NAT.

type Iov source · line 96 · raw

Data

A piece of guest memory: len bytes at addr. Devices name the memory of a descriptor chain this way, and the host moves bytes in and out of it.

type FsOp source · line 111 · raw

Data

Host file operations for virtio-9p (src/fs/p9.bend). Paths are relative to the shared directory, "" being its root, components separated by "/", never "." or ".." (the 9p server builds them from names it validated; the host refuses anything else). Times are seconds since the Unix epoch.

type FsAttr source · line 137 · raw

Data

A file's attributes (lstat): mode is st_mode (type and permission bits).

type FsEntry source · line 141 · raw

Data

A directory entry: name, inode, and its type (DT_DIR 4, DT_REG 8, DT_LNK 10, ...).

type FsResult source · line 144 · raw

Data

type VsockCmd source · line 161 · raw

Data

Host commands from virtio-vsock (src/virtio/vsock.bend). Connections are numbered by the device for guest-initiated ones and by the host (from 2147483648 up) for host-initiated ones. The host maps guest port P on the host CID to the Unix socket "<--vsock path>_P" (Firecracker's convention).

type VsockEvent source · line 180 · raw

Data

type FlashCmd source · line 198 · raw

Data

Host commands of the UEFI variable flash (src/dev/pflash.bend); offsets are within the bank.

type Vm source · line 209 · raw

@-A:Type -> Type

A program of host effects that ends with a value of type A. Each effect applies to the vCPU whose exit is being handled, unless it names a cpu.

type Op source · line 304 · raw

@-R:Type -> @-A:Type -> Type

Device code is written in Op, a continuation monad over Vm: its bind needs no recursion, so do Op<R, A>: blocks pass Bend's termination check. R is the type the whole exit handler finally returns (usually the machine).

Definitions

def Reg.pc source · line 13 · raw

U32

Register numbers used by VmSetReg: 0..30 are X0..X30, 31 is PC.

def Iov.total source · line 100 · raw

@xs:List<&2, Iov> -> U32

The total length of some pieces.

def Op.pure source · line 307 · raw

@-R:Type -> @-A:Type -> @x:A -> Op<R, A>

def Op.run source · line 310 · raw

@-R:Type -> @-A:Type -> @m:Op<R, A> -> @k:(@_:A -> Vm<R>) -> Vm<R>

def Op.bind source · line 315 · raw

@-R:Type -> @-A:Type -> @-B:Type -> @m:Op<R, A> -> @f:(@_:A -> Op<R, B>) -> Op<R, B>

def Op.finish source · line 319 · raw

@-R:Type -> @m:Op<R, R> -> Vm<R>

Ends an Op whose result is the final value.

def Op.read source · line 322 · raw

@-R:Type -> @addr:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @len:U32 -> Op<R, List<&2, U32>>

def Op.write source · line 325 · raw

@-R:Type -> @addr:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @bytes:List<&2, U32> -> Op<R, Unit>

def Op.set_reg source · line 328 · raw

@-R:Type -> @reg:U32 -> @value:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> Op<R, Unit>

def Op.advance_pc source · line 331 · raw

@-R:Type -> Op<R, Unit>

def Op.console source · line 334 · raw

@-R:Type -> @bytes:List<&2, U32> -> Op<R, Unit>

def Op.irq source · line 337 · raw

@-R:Type -> @intid:U32 -> @level:Bool -> Op<R, Unit>

def Op.power source · line 340 · raw

@-R:Type -> @op:PowerOp -> Op<R, Unit>

def Op.cpu_on source · line 343 · raw

@-R:Type -> @cpu:U32 -> @entry:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @ctx:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> Op<R, Unit>

def Op.log source · line 346 · raw

@-R:Type -> @msg:String -> Op<R, Unit>

def Op.disk_read source · line 349 · raw

@-R:Type -> @disk:U32 -> @offset:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @len:U32 -> Op<R, List<&2, U32>>

def Op.disk_write source · line 352 · raw

@-R:Type -> @disk:U32 -> @offset:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @bytes:List<&2, U32> -> Op<R, Unit>

def Op.disk_to_ram source · line 355 · raw

@-R:Type -> @disk:U32 -> @offset:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @iovs:List<&2, Iov> -> Op<R, Unit>

def Op.ram_to_disk source · line 358 · raw

@-R:Type -> @disk:U32 -> @offset:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @iovs:List<&2, Iov> -> Op<R, Unit>

def Op.net_to_ram source · line 361 · raw

@-R:Type -> @conn:U32 -> @off:U32 -> @iovs:List<&2, Iov> -> Op<R, Unit>

def Op.vs_to_ram source · line 364 · raw

@-R:Type -> @conn:U32 -> @off:U32 -> @iovs:List<&2, Iov> -> Op<R, Unit>

def Op.lan_to_ram source · line 367 · raw

@-R:Type -> @iovs:List<&2, Iov> -> Op<R, Unit>

def Op.stage source · line 370 · raw

@-R:Type -> @iovs:List<&2, Iov> -> Op<R, U32>

def Op.zero_ram source · line 373 · raw

@-R:Type -> @iovs:List<&2, Iov> -> Op<R, Unit>

def Op.ram_release source · line 376 · raw

@-R:Type -> @iovs:List<&2, Iov> -> Op<R, Unit>

def Op.disk_alloc source · line 379 · raw

@-R:Type -> @disk:U32 -> @len:U32 -> Op<R, 0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64>

def Op.disk_copy source · line 382 · raw

@-R:Type -> @src:U32 -> @soff:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @dst:U32 -> @doff:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @len:U32 -> Op<R, Unit>

def Op.inflate_to_ram source · line 385 · raw

@-R:Type -> @disk:U32 -> @off:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @clen:U32 -> @skip:U32 -> @iovs:List<&2, Iov> -> Op<R, Unit>

def Op.inflate_to_disk source · line 388 · raw

@-R:Type -> @disk:U32 -> @off:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @clen:U32 -> @dst:U32 -> @doff:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @skip:U32 -> @len:U32 -> Op<R, Unit>

def Op.disk_status source · line 391 · raw

@-R:Type -> @disk:U32 -> Op<R, U32>

def Op.random source · line 394 · raw

@-R:Type -> @len:U32 -> Op<R, List<&2, U32>>

def Op.now source · line 397 · raw

@-R:Type -> Op<R, 0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64>

def Op.disk_flush source · line 400 · raw

@-R:Type -> @disk:U32 -> Op<R, Unit>

def Op.disk_discard source · line 403 · raw

@-R:Type -> @disk:U32 -> @offset:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @len:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> Op<R, Unit>

def Op.disk_space source · line 406 · raw

@-R:Type -> @disk:U32 -> Op<R, List<&2, U32>>

def Op.disk_set_hint source · line 409 · raw

@-R:Type -> @disk:U32 -> @at:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> Op<R, Unit>

def Op.disk_zero source · line 412 · raw

@-R:Type -> @disk:U32 -> @offset:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @len:U32 -> Op<R, Unit>

def Op.disk_zero_keep source · line 418 · raw

@-R:Type -> @disk:U32 -> @offset:0x5fb57f1b8ad4cb61031f616c44af7445/src/lib/u64.U64 -> @len:U32 -> Op<R, Unit>

The range reads as zeros afterwards and stays allocated (virtio-blk WRITE_ZEROES without UNMAP): zeros written, or the file system's zero range where it has one.

def Op.net source · line 421 · raw

@-R:Type -> @cmd:NetCmd -> Op<R, Unit>

def Op.fs source · line 424 · raw

@-R:Type -> @share:U32 -> @op:FsOp -> Op<R, FsResult>

def Op.vsock source · line 427 · raw

@-R:Type -> @cmd:VsockCmd -> Op<R, Unit>

def Op.flash source · line 430 · raw

@-R:Type -> @cmd:FlashCmd -> Op<R, U32>