		Xvisor on QEMU RISC-V VirtIO Board

This section of readme explains how to build & run Xvisor for RISC-V VirtIO
board emulated by QEMU.

To achieve this, we will require RISC-V BBL (Berkley Bootloader) which can
be found at: https://github.com/riscv/riscv-pk.git

Please follow the steps below to build & run Xvisor on RISC-V VirtIO board:

  [1. Build environment for Xvisor]
  # CROSS_COMPILE=riscv64-unknown-linux-gnu-

  [2. GoTo Xvisor source directory]
  # cd <xvisor_source_directory>

  [3. Initialize Xvisor submodules]
  # git submodule init
  # git submodule update
  (Note: This is required to be done only once in freshly cloned xvisor source)

  [4. Configure Xvisor with Generic 64bit default settings]
  # make ARCH=riscv generic-64b-defconfig

  [5. Build Xvisor & DTBs]
  # make

  [6. Build RISC-V BBL with Xvisor payload]
  # mkdir -p ./build/build-riscv-pk
  # cd ./build/build-riscv-pk
  # <riscv_pk_source_directory>/configure --host=riscv64-unknown-linux-gnu --with-payload=../vmm.elf
  # make
  # cd ../..

  [7. Create disk image for Xvisor]
  # mkdir -p ./build/disk/tmp
  # mkdir -p ./build/disk/system
  # cp -f ./docs/banner/roman.txt ./build/disk/system/banner.txt
  # cp -f ./docs/logo/xvisor_logo_name.ppm ./build/disk/system/logo.ppm
  # cp -f ./tests/riscv/virt/xscript/zero_guest.xscript ./build/disk/boot.xscript
  # genext2fs -B 1024 -b 32768 -d ./build/disk ./build/disk.img

  [8. Launch QEMU]
  # qemu-system-riscv64 -M virt -m 256M -display none -serial stdio -kernel ./build/build-riscv-pk/bbl -initrd ./build/disk.img -append "vmm.console=uart@10000000 vmm.bootcmd=\"vfs mount initrd /; vfs run /boot.xscript; vfs cat /system/banner.txt\""

  [9. Try few commands of Xvisor]
  XVisor# help
  XVisor# host info
  XVisor# host irq stats

  (Note: replace all <> brackets based on your workspace)
  (Note: some of the above steps will need to be adapted for other
   types of RISC-V host)
  (Note: for more info on your desired RISC-V host refer docs/riscv/)
  (Note: you are free to change the ordering of above steps based
   on your workspace)
