Commit graph

22 commits

Author SHA1 Message Date
Changyuan Lyu
f10a1367e2 feat(cli): track error sources with snafu (2/n)
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-09 10:11:22 -07:00
Changyuan Lyu
0005413ff2 feat(vsock): add the vsock device flag
Some checks are pending
Rust / build_test (push) Waiting to run
usage: --vsock vhost,cid=$CID,dev=/dev/vhost-vsock

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-06-01 15:23:33 -07:00
Changyuan Lyu
7d2b04aa51 feat(fs): add the virtio-fs device flag
Some checks are pending
Rust / build_test (push) Waiting to run
A host directory can be shared with the guest by
1. virtiofsd[1] flag: `--shared-dir /path/to/dir --socket-path /tmp/virtiofsd`
2. Alioth flag: `--fs vu,socket=/tmp/virtiofsd,tag=host-dir`

[1]: https://gitlab.com/virtio-fs/virtiofsd

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-31 15:55:34 -07:00
Changyuan Lyu
7ca26a8781 feat(sev): boot Oak/Stage0 with Linux bzImage
Add kernel, initramfs, and cmdline to the FwCfg device when a
firmware image is provided at the same time. This enables Alioth to
boot SEV enabled guests with a compressed bzImage file.

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-25 22:03:34 -07:00
Changyuan Lyu
3c241aa63e chore: bump version to 0.2.0
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-24 13:56:06 -07:00
Changyuan Lyu
17f33e6b68 feat(kvm)!: allow specifying char dev file paths
This enables Alioth to work in environments where the devtmpfs
is not mounted at /dev.

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-24 13:46:01 -07:00
Changyuan Lyu
04f01b350e feat(sev): add a flag for launching SEV guests
With all the preparation, SEV guests are ready to go,

* SEV guests: --coco sev,policy=0x1
* SEV-ES guests: --coco sev,policy=0x5

We still need to make virtio devices work with SEV guests.

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-22 23:10:49 -07:00
Changyuan Lyu
9458fce313 feat(sev): register fw and RAM as encrypted
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-22 23:10:49 -07:00
Changyuan Lyu
6a66b2d299 feat(cli)!: use serde-aco to parse cli options
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-22 00:00:14 -07:00
Changyuan Lyu
50049516d6 feat(loader): support boot from stage0 firmware
Alioth is able to boot a Linux ELF kernel along with the stage0 [1]
firmware by

target/x86_64-unknown-linux-gnu/release/alioth \
    --log-to-file \
    run \
    --num-cpu 2 \
    --mem-size 1G \
    -f $HOME/data/oak_stage0.bin \
    --fw-cfg opt/stage0/elf_kernel,file=$HOME/data/vmlinuz-6.6.17.bin \
    --fw-cfg opt/stage0/initramfs,file=$HOME/data/initramfs.linux_amd64.cpio \
    --fw-cfg opt/stage0/cmdline,string="console=ttyS0"

[1] https://github.com/project-oak/oak/tree/main/stage0_bin

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-11 16:54:26 -07:00
Changyuan Lyu
8c63a87da5 feat(fw_cfg): plug the fw_cfg device into the VM
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-11 16:54:26 -07:00
Changyuan Lyu
1b2829a0d0 feat(net): use a tun/tap interface as a backend
The current virtio-net implementation assumes the tap device path is
referring to a macvtap or ipvtap. This commit allows using a tun/tap
interface pre-created by `ip tuntap add mode tap $IF_NAME` as a
backend.

Usage:

```
--net if=$IF_NAME,mac=$IF_MAC,mtu=$IF_MTU
```

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-09 23:39:38 -07:00
Changyuan Lyu
01f5cac223 feat(block): impl raw file backed virtio-block dev
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-06 00:25:28 -07:00
Changyuan Lyu
7f14a74c8b feat(virtio): impl tap-based net device
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-06 00:25:28 -07:00
Changyuan Lyu
b3568fa1db feat(virtio): plug the entropy device into the VM
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-06 00:25:28 -07:00
Changyuan Lyu
d29e0ff3ba feat(dev): implement QEMU's pvpanic-pci device
Ref: https://www.qemu.org/docs/master/specs/pvpanic.html

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-05 21:46:44 -07:00
Changyuan Lyu
fd0764dc02 feat(loader): support direct boot ABI of Xen/PVH
Ref: https://xenbits.xen.org/docs/4.18-testing/misc/pvh.html

Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-05-04 11:25:41 -07:00
Changyuan Lyu
5479762c7e chore(cargo): update package metadata
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-04-29 09:45:08 -07:00
Changyuan Lyu
d7e2955ace refactor: move Payload into module loader
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-04-29 09:38:55 -07:00
Changyuan Lyu
5267efa766 refactor: move Board to a seperate mod
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-04-29 09:38:55 -07:00
Changyuan Lyu
22b4c65b3e build: update dependencies
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-04-24 22:06:25 -07:00
Changyuan Lyu
7f2e3bf287 Initial release
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
2024-04-24 19:34:14 -07:00