~/bend-docscommunity

src/vmm/abi.bend checks

raw source on the hub · import 0x797e6e88f253acc21022638860fd49ed/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 142 · raw

Data

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

type FsEntry source · line 146 · raw

Data

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

type FsResult source · line 149 · raw

Data

type VsockCmd source · line 169 · 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 188 · raw

Data

type FlashCmd source · line 206 · raw

Data

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

type Vm source · line 217 · 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 312 · 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 315 · raw

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

def Op.run source · line 318 · raw

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

def Op.bind source · line 323 · raw

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

def Op.finish source · line 327 · raw

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

Ends an Op whose result is the final value.

def Op.read source · line 330 · raw

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

def Op.write source · line 333 · raw

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

def Op.set_reg source · line 336 · raw

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

def Op.advance_pc source · line 339 · raw

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

def Op.console source · line 342 · raw

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

def Op.irq source · line 345 · raw

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

def Op.power source · line 348 · raw

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

def Op.cpu_on source · line 351 · raw

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

def Op.log source · line 354 · raw

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

def Op.disk_read source · line 357 · raw

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

def Op.disk_write source · line 360 · raw

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

def Op.disk_to_ram source · line 363 · raw

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

def Op.ram_to_disk source · line 366 · raw

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

def Op.net_to_ram source · line 369 · raw

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

def Op.vs_to_ram source · line 372 · raw

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

def Op.lan_to_ram source · line 375 · raw

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

def Op.stage source · line 378 · raw

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

def Op.zero_ram source · line 381 · raw

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

def Op.ram_release source · line 384 · raw

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

def Op.disk_alloc source · line 387 · raw

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

def Op.disk_copy source · line 390 · raw

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

def Op.inflate_to_ram source · line 393 · raw

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

def Op.inflate_to_disk source · line 396 · raw

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

def Op.disk_status source · line 399 · raw

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

def Op.random source · line 402 · raw

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

def Op.now source · line 405 · raw

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

def Op.disk_flush source · line 408 · raw

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

def Op.disk_discard source · line 411 · raw

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

def Op.disk_space source · line 414 · raw

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

def Op.disk_set_hint source · line 417 · raw

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

def Op.disk_zero source · line 420 · raw

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

def Op.disk_zero_keep source · line 426 · raw

@-R:Type -> @disk:U32 -> @offset:0x797e6e88f253acc21022638860fd49ed/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 429 · raw

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

def Op.fs source · line 432 · raw

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

def Op.vsock source · line 435 · raw

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

def Op.flash source · line 438 · raw

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