docs: Consolidate AArch64 guest booting doc into README

Take the opportunity to fix a bug in the `Booting the guest VM` doc
in README.

Signed-off-by: Henry Wang <Henry.Wang@arm.com>
This commit is contained in:
Henry Wang 2022-12-08 00:35:20 -05:00 committed by Rob Bradford
parent de4cd49c6d
commit b93d50582d
2 changed files with 37 additions and 32 deletions

View File

@ -107,13 +107,10 @@ do not wish to use the pre-built binaries.
## Booting Linux ## Booting Linux
The instructions below are for the `x86-64` platform. For `AArch64` please see Cloud Hypervisor supports direct kernel boot (the x86-64 kernel requires the kernel
the [AArch64 specific documentation](docs/arm64.md). built with PVH support) or booting via a firmware (either [Rust Hypervisor
Cloud Hypervisor supports direct kernel boot (if the kernel is built with PVH
support) or booting via a firmware (either [Rust Hypervisor
Firmware](https://github.com/cloud-hypervisor/rust-hypervisor-firmware) or an Firmware](https://github.com/cloud-hypervisor/rust-hypervisor-firmware) or an
edk2 UEFI firmware called `CLOUDHV`.) edk2 UEFI firmware called `CLOUDHV` / `CLOUDHV_EFI`.)
Binary builds of the firmware files are available for the latest release of Binary builds of the firmware files are available for the latest release of
[Rust Hyperivor [Rust Hyperivor
@ -218,6 +215,8 @@ $ qemu-img convert -p -f qcow2 -O raw focal-server-cloudimg-arm64.img focal-serv
These sample commands boot the disk image using the custom kernel whilst also These sample commands boot the disk image using the custom kernel whilst also
supplying the desired kernel command line. supplying the desired kernel command line.
- x86-64
```shell ```shell
$ sudo setcap cap_net_admin+ep ./cloud-hypervisor $ sudo setcap cap_net_admin+ep ./cloud-hypervisor
$ ./create-cloud-init.sh $ ./create-cloud-init.sh
@ -230,9 +229,26 @@ $ ./cloud-hypervisor \
--net "tap=,mac=,ip=,mask=" --net "tap=,mac=,ip=,mask="
``` ```
- AArch64
```shell
$ sudo setcap cap_net_admin+ep ./cloud-hypervisor
$ ./create-cloud-init.sh
$ ./cloud-hypervisor \
--kernel ./linux-cloud-hypervisor/arch/arm64/boot/Image \
--disk path=focal-server-cloudimg-arm64.raw path=/tmp/ubuntu-cloudinit.img \
--cmdline "console=hvc0 root=/dev/vda1 rw" \
--cpus boot=4 \
--memory size=1024M \
--net "tap=,mac=,ip=,mask="
```
If earlier kernel messages are required the serial console should be used instead of `virtio-console`. If earlier kernel messages are required the serial console should be used instead of `virtio-console`.
```./cloud-hypervisor \ - x86-64
```shell
$ ./cloud-hypervisor \
--kernel ./linux-cloud-hypervisor/arch/x86/boot/compressed/vmlinux.bin \ --kernel ./linux-cloud-hypervisor/arch/x86/boot/compressed/vmlinux.bin \
--console off \ --console off \
--serial tty \ --serial tty \
@ -243,6 +259,20 @@ If earlier kernel messages are required the serial console should be used instea
--net "tap=,mac=,ip=,mask=" --net "tap=,mac=,ip=,mask="
``` ```
- AArch64
```shell
$ ./cloud-hypervisor \
--kernel ./linux-cloud-hypervisor/arch/arm64/boot/Image \
--console off \
--serial tty \
--disk path=focal-server-cloudimg-arm64.raw \
--cmdline "console=ttyAMA0 root=/dev/vda1 rw" \
--cpus boot=4 \
--memory size=1024M \
--net "tap=,mac=,ip=,mask="
```
# 3. Status # 3. Status
Cloud Hypervisor is under active development. The following stability Cloud Hypervisor is under active development. The following stability

View File

@ -1,25 +0,0 @@
# How to build and test Cloud Hypervisor on AArch64
This document introduces how to build and test Cloud Hypervisor on AArch64.
Currently, Cloud Hypervisor supports 2 methods of booting on AArch64: UEFI
booting and direct-kernel booting. The document covers both methods.
All the steps are based on Ubuntu. We use the Ubuntu cloud image for guest VM
disk.
### Booting the guest VM
```bash
$ pushd $CLOUDH
$ sudo $CLOUDH/cloud-hypervisor/target/debug/cloud-hypervisor \
--api-socket /tmp/cloud-hypervisor.sock \
--kernel $CLOUDH/linux/arch/arm64/boot/Image \
--disk path=focal-server-cloudimg-arm64.raw \
--cmdline "keep_bootcon console=ttyAMA0 reboot=k panic=1 root=/dev/vda1 rw" \
--cpus boot=4 \
--memory size=4096M \
--net tap=,mac=12:34:56:78:90:01,ip=192.168.1.1,mask=255.255.255.0 \
--serial tty \
--console off
$ popd
```