Skip to content

Commit 6b7416e

Browse files
committed
README: Update to reflect current functionality and usage
Signed-off-by: Rob Bradford <[email protected]>
1 parent 81a53f0 commit 6b7416e

File tree

1 file changed

+30
-80
lines changed

1 file changed

+30
-80
lines changed

README.md

Lines changed: 30 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,25 @@
1-
# Simple KVM firmware
1+
# Rust Hypervisor Firmware
22

3-
**This project is an experiment and should not be used production workloads.**
3+
This repository contains a simple firmware that is designed to be launched from
4+
anything that supports loading ELF binaries and running them with the
5+
PVH booting standard
46

5-
This repository contains a simple KVM firmware that is designed to be launched
6-
from anything that supports loading ELF binaries and running them with the
7-
Linux kernel loading standard.
8-
9-
The ultimate goal is to be able to use this "firmware" to be able to load a
10-
bootloader from within a disk image.
7+
The purpose is to be able to use this firmware to be able to load a
8+
bootloader from within a disk image without requiring the use of a complex
9+
firmware such as TianoCore/edk2 and without requiring the VMM to reuse
10+
functionality used for booting the Linux kernel.
1111

1212
Currently it will directly load a kernel from a disk image that follows the
1313
[Boot Loader Specification](https://systemd.io/BOOT_LOADER_SPECIFICATION)
1414

15+
There is also minimal EFI compatibility support allowing the boot of some
16+
images that use EFI (shim + GRUB2 as used by Ubuntu).
17+
1518
The firmware is primarily developed against [Cloud
16-
Hypervisor](https://github.com/intel/cloud-hypervisor).
19+
Hypervisor](https://github.com/cloud-hypervisor/cloud-hypervisor) but there is
20+
also support for using QEMU's PVH loader.
1721

18-
This project was orginally developed using
22+
This project was originally developed using
1923
[Firecracker](https://github.com/firecracker-microvm) however as it does not
2024
currently support resetting the virtio block device it is not possible to boot
2125
all the way into the OS.
@@ -32,7 +36,7 @@ target/target/release/hypervisor-fw
3236

3337
## Features
3438

35-
* virtio (MMIO & PCI) block support
39+
* virtio (PCI) block support
3640
* GPT parsing (to find EFI system partition)
3741
* FAT12/16/32 directory traversal and file reading
3842
* bzImage loader
@@ -42,17 +46,16 @@ target/target/release/hypervisor-fw
4246

4347
## Running
4448

45-
Works with Cloud Hypervisor and Firecracker as a drop in replacement for the
46-
Linux kernel. It does not work with crosvm as crosvm has a hardcoded kernel
47-
function start address.
49+
Works with Cloud Hypervisor and QEMU via their PVH loaders as an alternative to
50+
the Linux kernel.
4851

49-
Cloud Hypervisor is currently the primary development target for the firmware
50-
although support for other VMMs will be considered.
52+
Cloud Hypervisor and QEMU are currently the primary development targets for the
53+
firmware although support for other VMMs will be considered.
5154

5255
### Cloud Hypervisor
5356

5457
As per [getting
55-
started](https://github.com/intel/cloud-hypervisor/blob/master/README.md#2-getting-started)
58+
started](https://github.com/cloud-hypervisor/cloud-hypervisor/blob/master/README.md#2-getting-started)
5659

5760
However instead of using the binary firmware for the parameter to `--kernel`
5861
instead use the binary you build above.
@@ -62,57 +65,29 @@ $ pushd $CLOUDH
6265
$ sudo setcap cap_net_admin+ep ./cloud-hypervisor/target/release/cloud-hypervisor
6366
$ ./cloud-hypervisor/target/release/cloud-hypervisor \
6467
--kernel ./target/target/release/hypervisor-fw \
65-
--disk path=./clear-29160-kvm.img \
68+
--disk path=focal-server-cloudimg-amd64.raw \
6669
--cpus boot=4 \
6770
--memory size=512M \
6871
--net "tap=,mac=,ip=,mask=" \
6972
--rng
7073
$ popd
7174
```
7275

73-
### Firecracker
76+
### QEMU
7477

75-
As per [quick
76-
start](https://github.com/firecracker-microvm/firecracker/blob/master/docs/getting-started.md)
78+
Use the QEMU `-kernel` parameter to specify the path to the firmware.
7779

78-
Replacing the kernel and rootfs to point at the firmware and the full disk
79-
image instead.
80+
e.g.
8081

8182
```
82-
curl --unix-socket /tmp/firecracker.socket -i \
83-
-X PUT 'http://localhost/boot-source' \
84-
-H 'Accept: application/json' \
85-
-H 'Content-Type: application/json' \
86-
-d '{
87-
"kernel_image_path": "target/target/release/hypervisor-fw",
88-
"boot_args": ""
89-
}'
90-
91-
curl --unix-socket /tmp/firecracker.socket -i \
92-
-X PUT 'http://localhost/drives/rootfs' \
93-
-H 'Accept: application/json' \
94-
-H 'Content-Type: application/json' \
95-
-d '{
96-
"drive_id": "rootfs",
97-
"path_on_host": "clear-28660-kvm.img",
98-
"is_root_device": true,
99-
"is_read_only": false
100-
}'
101-
102-
curl --unix-socket /tmp/firecracker.socket -i \
103-
-X PUT 'http://localhost/actions' \
104-
-H 'Accept: application/json' \
105-
-H 'Content-Type: application/json' \
106-
-d '{
107-
"action_type": "InstanceStart"
108-
}'
109-
83+
$ qemu-system-x86_64 -machine q35,accel=kvm -cpu host,-vmx -m 1G\
84+
-kernel ./target/target/release/hypervisor-fw \
85+
-display none -nodefaults \
86+
-serial stdio \
87+
-drive id=os,file=focal-server-cloudimg-amd64.raw,if=none \
88+
-device virtio-blk-pci,drive=os,disable-legacy=on
11089
```
11190

112-
**Currently Firecracker's virtio block device does not support resetting the
113-
device and as such it is not possible for the booted Linux kernel to take over
114-
the device from the firmware.**
115-
11691
## Testing
11792

11893
"cargo test" needs disk images from make-test-disks.sh
@@ -122,28 +97,3 @@ And clear-28660-kvm.img:
12297
https://download.clearlinux.org/releases/28660/clear/clear-28660-kvm.img.xz
12398

12499
sha1sum: 5fc086643dea4b20c59a795a262e0d2400fab15f
125-
126-
## Security
127-
128-
**Reporting a Potential Security Vulnerability**: If you have discovered
129-
potential security vulnerability in this project, please send an e-mail to
130-
[email protected]. For issues related to Intel Products, please visit
131-
https://security-center.intel.com.
132-
133-
It is important to include the following details:
134-
- The projects and versions affected
135-
- Detailed description of the vulnerability
136-
- Information on known exploits
137-
138-
Vulnerability information is extremely sensitive. Please encrypt all security
139-
vulnerability reports using our *PGP key*
140-
141-
A member of the Intel Product Security Team will review your e-mail and
142-
contact you to to collaborate on resolving the issue. For more information on
143-
how Intel works to resolve security issues, see: *Vulnerability Handling
144-
Guidelines*
145-
146-
PGP Key: https://www.intel.com/content/www/us/en/security-center/pgp-public-key.html
147-
148-
Vulnerability Handling Guidelines: https://www.intel.com/content/www/us/en/security-center/vulnerability-handling-guidelines.html
149-

0 commit comments

Comments
 (0)