Skip to content

KVM RISCV64 on QEMU

Rajnesh Kanwal edited this page Feb 2, 2023 · 26 revisions

Currently, we can boot RISC-V 64bit SMP Guest using KVM RISC-V on QEMU. We use QEMU as our development vehicle for RISC-V hypervisor development.

To achieve this, we need following components:

  1. QEMU with RISC-V Hypervisor Extension Emulation
  2. Common Host & Guest Kernel
  3. KVM RISC-V module
  4. KVMTOOL
  5. Host RootFS with KVM RISC-V module, KVMTOOL and Guest Kernel

The below sub-sections provide detailed steps to build and run RISC-V KVM on QEMU. All components except QEMU require a RISC-V 64bit cross-compiler so for we use Linux multilib toolchain from RISC-V GNU Compiler Toolchain project (Refer, https://github.com/riscv/riscv-gnu-toolchain). If you have a different RISC-V 64bit cross-compiler then set CROSS_COMPILE environment variable appropriately in steps below.

1. Build QEMU with RISC-V Hypervisor Extension Emulation

git clone https://gitlab.com/qemu-project/qemu.git
cd qemu
git submodule init
git submodule update --recursive
./configure --target-list="riscv32-softmmu riscv64-softmmu"
make
cd ..

The above commands will create ./qemu/build/qemu-system-riscv64 which will be our QEMU system emulator.

2. Build Common Host & Guest Linux Kernel Image

We can use same RISC-V 64bit Linux kernel as Guest and Host kernel so no need to compile them separately.

git clone https://github.com/kvm-riscv/linux.git
export ARCH=riscv
export CROSS_COMPILE=riscv64-unknown-linux-gnu-
mkdir build-riscv64
make -C linux O=`pwd`/build-riscv64 defconfig
make -C linux O=`pwd`/build-riscv64

The above commands will create:

  1. build-riscv64/arch/riscv/boot/Image which will be our Guest and Host kernel
  2. build-riscv64/arch/riscv/kvm/kvm.ko which will be our KVM RISC-V module

3. Add libfdt library to CROSS_COMPILE SYSROOT directory

We need libfdt library in the cross-compile toolchain for compiling KVMTOOL RISC-V (described in next step). The libfdt library is generally not available in the cross-compile toolchain so we need to explicitly compile libfdt from DTC project and add it to CROSS_COMPILE SYSROOT directory.

git clone git://git.kernel.org/pub/scm/utils/dtc/dtc.git
cd dtc
export ARCH=riscv
export CROSS_COMPILE=riscv64-unknown-linux-gnu-
export CC="${CROSS_COMPILE}gcc -mabi=lp64d -march=rv64gc"
TRIPLET=$($CC -dumpmachine)
SYSROOT=$($CC -print-sysroot)
make libfdt
make NO_PYTHON=1 NO_YAML=1 DESTDIR=$SYSROOT PREFIX=/usr LIBDIR=/usr/lib64/lp64d install-lib install-includes
cd ..

The above commands will install cross-compiled libfdt library at $SYSROOT/usr/lib64/lp64d directory of cross-compile toolchain.

4. Build KVMTOOL

git clone https://git.kernel.org/pub/scm/linux/kernel/git/will/kvmtool.git
export ARCH=riscv
export CROSS_COMPILE=riscv64-unknown-linux-gnu-
cd kvmtool
make lkvm-static
${CROSS_COMPILE}strip lkvm-static
cd ..

The above commands will create kvmtool/lkvm-static which will be our user-space tool for KVM RISC-V.

5. Build Host RootFS containing KVM RISC-V module, KVMTOOL and Guest Linux

export ARCH=riscv
export CROSS_COMPILE=riscv64-unknown-linux-gnu-
git clone https://github.com/kvm-riscv/howto.git
wget https://busybox.net/downloads/busybox-1.33.1.tar.bz2
tar -C . -xvf ./busybox-1.33.1.tar.bz2
mv ./busybox-1.33.1 ./busybox-1.33.1-kvm-riscv64
cp -f ./howto/configs/busybox-1.33.1_defconfig busybox-1.33.1-kvm-riscv64/.config
make -C busybox-1.33.1-kvm-riscv64 oldconfig
make -C busybox-1.33.1-kvm-riscv64 install
mkdir -p busybox-1.33.1-kvm-riscv64/_install/etc/init.d
mkdir -p busybox-1.33.1-kvm-riscv64/_install/dev
mkdir -p busybox-1.33.1-kvm-riscv64/_install/proc
mkdir -p busybox-1.33.1-kvm-riscv64/_install/sys
mkdir -p busybox-1.33.1-kvm-riscv64/_install/apps
ln -sf /sbin/init busybox-1.33.1-kvm-riscv64/_install/init
cp -f ./howto/configs/busybox/fstab busybox-1.33.1-kvm-riscv64/_install/etc/fstab
cp -f ./howto/configs/busybox/rcS busybox-1.33.1-kvm-riscv64/_install/etc/init.d/rcS
cp -f ./howto/configs/busybox/motd busybox-1.33.1-kvm-riscv64/_install/etc/motd
cp -f ./kvmtool/lkvm-static busybox-1.33.1-kvm-riscv64/_install/apps
cp -f ./build-riscv64/arch/riscv/boot/Image busybox-1.33.1-kvm-riscv64/_install/apps
cp -f ./build-riscv64/arch/riscv/kvm/kvm.ko busybox-1.33.1-kvm-riscv64/_install/apps
cd busybox-1.33.1-kvm-riscv64/_install; find ./ | cpio -o -H newc > ../../rootfs_kvm_riscv64.img; cd -

The above commands will create rootfs_kvm_riscv64.img which will be our Host RootFS containing KVMTOOL and Guest Linux.

6. Run RISC-V KVM on QEMU

Run Host Linux with Host RootFS on QEMU

./qemu/build/qemu-system-riscv64 -cpu rv64 -M virt -m 512M -nographic -kernel ./build-riscv64/arch/riscv/boot/Image -initrd ./rootfs_kvm_riscv64.img -append "root=/dev/ram rw console=ttyS0 earlycon=sbi"

Insert the KVM RISC-V module

insmod apps/kvm.ko

Run Guest Linux using KVMTOOL after the KVM RISC-V module is inserted

./apps/lkvm-static run -m 128 -c2 --console serial -p "console=ttyS0 earlycon" -k ./apps/Image --debug

7. Reference Bootlog

anup@anup-ubuntu64:~/Work/riscv-test/kvm-riscv$ ./qemu/build/qemu-system-riscv64 -cpu rv64 -M virt -m 512M -nographic  -kernel ./build-riscv64/arch/riscv/boot/Image -initrd ./rootfs_kvm_riscv64.img -append "root=/dev/ram rw console=ttyS0 earlycon=sbi"

OpenSBI v0.8-6-gec1abf6
   ____                    _____ ____ _____
  / __ \                  / ____|  _ \_   _|
 | |  | |_ __   ___ _ __ | (___ | |_) || |
 | |  | | '_ \ / _ \ '_ \ \___ \|  _ < | |
 | |__| | |_) |  __/ | | |____) | |_) || |_
  \____/| .__/ \___|_| |_|_____/|____/_____|
        | |
        |_|

Platform Name       : riscv-virtio,qemu
Platform Features   : timer,mfdeleg
Platform HART Count : 1
Boot HART ID        : 0
Boot HART ISA       : rv64imafdcsuh
BOOT HART Features  : pmp,scounteren,mcounteren,time
BOOT HART PMP Count : 16
Firmware Base       : 0x80000000
Firmware Size       : 92 KB
Runtime SBI Version : 0.2

MIDELEG : 0x0000000000000666
MEDELEG : 0x0000000000f0b509
PMP0    : 0x0000000080000000-0x000000008001ffff (A)
PMP1    : 0x0000000000000000-0xffffffffffffffff (A,R,W,X)
[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[    0.000000] Linux version 5.8.0-rc4-00022-g906eafa224e2 (anup@anup-ubuntu64-vm) (riscv64-unknown-linux-gnu-gcc (GCC) 9.2.0, GNU ld (GNU Binutils) 2.34) #1 SMP Fri Jul 24 19:10:43 IST 2020
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] Initial ramdisk at: 0x(____ptrval____) (29944320 bytes)
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080200000-0x000000009fffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080200000-0x000000009fffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x000000009fffffff]
[    0.000000] software IO TLB: mapped [mem 0x9b8fa000-0x9f8fa000] (64MB)
[    0.000000] SBI specification v0.2 detected
[    0.000000] SBI implementation ID=0x1 Version=0x8
[    0.000000] SBI v0.2 TIME extension detected
[    0.000000] SBI v0.2 IPI extension detected
[    0.000000] SBI v0.2 RFENCE extension detected
[    0.000000] SBI v0.2 HSM extension detected
[    0.000000] riscv: ISA extensions acdfhimsu
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: Embedded 17 pages/cpu s31704 r8192 d29736 u69632
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 128775
[    0.000000] Kernel command line: root=/dev/ram rw console=ttyS0 earlycon=sbi
[    0.000000] Dentry cache hash table entries: 65536 (order: 7, 524288 bytes, linear)
[    0.000000] Inode-cache hash table entries: 32768 (order: 6, 262144 bytes, linear)
[    0.000000] Sorting __ex_table...
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 401932K/522240K available (6456K kernel code, 4177K rwdata, 4096K rodata, 226K init, 323K bss, 120308K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=1.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=1
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: plic@c000000: mapped 53 interrupts with 1 handlers for 2 contexts.
[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[    0.001756] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[    0.023824] Console: colour dummy device 80x25
[    0.027402] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=40000)
[    0.029636] pid_max: default: 32768 minimum: 301
[    0.034227] Mount-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.036355] Mountpoint-cache hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    0.129148] rcu: Hierarchical SRCU implementation.
[    0.152721] smp: Bringing up secondary CPUs ...
[    0.153755] smp: Brought up 1 node, 1 CPU
[    0.175841] devtmpfs: initialized
[    0.189073] random: get_random_u32 called from bucket_table_alloc.isra.0+0x4e/0x154 with crng_init=0
[    0.197512] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    0.200933] futex hash table entries: 256 (order: 2, 16384 bytes, linear)
[    0.220870] NET: Registered protocol family 16
[    0.348701] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    0.392763] vgaarb: loaded
[    0.407080] SCSI subsystem initialized
[    0.422080] usbcore: registered new interface driver usbfs
[    0.423305] usbcore: registered new interface driver hub
[    0.424185] usbcore: registered new device driver usb
[    0.461745] clocksource: Switched to clocksource riscv_clocksource
[    0.514095] NET: Registered protocol family 2
[    0.528529] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    0.530290] TCP established hash table entries: 4096 (order: 3, 32768 bytes, linear)
[    0.531646] TCP bind hash table entries: 4096 (order: 4, 65536 bytes, linear)
[    0.532928] TCP: Hash tables configured (established 4096 bind 4096)
[    0.538985] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.540705] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    0.544261] NET: Registered protocol family 1
[    0.562610] RPC: Registered named UNIX socket transport module.
[    0.563485] RPC: Registered udp transport module.
[    0.564042] RPC: Registered tcp transport module.
[    0.565086] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    0.565951] PCI: CLS 0 bytes, default 64
[    0.586778] Unpacking initramfs...
[    1.093160] Freeing initrd memory: 29240K
[    1.094977] kvm [1]: hypervisor extension available
[    1.096555] kvm [1]: host has 14 VMID bits
[    1.107946] workingset: timestamp_bits=62 max_order=17 bucket_order=0
[    1.131630] NFS: Registering the id_resolver key type
[    1.142533] Key type id_resolver registered
[    1.143345] Key type id_legacy registered
[    1.144346] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    1.146719] 9p: Installing v9fs 9p2000 file system support
[    1.150370] NET: Registered protocol family 38
[    1.151575] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    1.160518] io scheduler mq-deadline registered
[    1.164754] io scheduler kyber registered
[    1.174222] pci-host-generic 30000000.pci: host bridge /soc/pci@30000000 ranges:
[    1.176551] pci-host-generic 30000000.pci:       IO 0x0003000000..0x000300ffff -> 0x0000000000
[    1.178580] pci-host-generic 30000000.pci:      MEM 0x0040000000..0x007fffffff -> 0x0040000000
[    1.183167] pci-host-generic 30000000.pci: ECAM at [mem 0x30000000-0x3fffffff] for [bus 00-ff]
[    1.186223] pci-host-generic 30000000.pci: PCI host bridge to bus 0000:00
[    1.194053] pci_bus 0000:00: root bus resource [bus 00-ff]
[    1.195089] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    1.196175] pci_bus 0000:00: root bus resource [mem 0x40000000-0x7fffffff]
[    1.199601] pci 0000:00:00.0: [1b36:0008] type 00 class 0x060000
[    1.402833] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    1.426389] printk: console [ttyS0] disabled
[    1.429731] 10000000.uart: ttyS0 at MMIO 0x10000000 (irq = 2, base_baud = 230400) is a 16550A
[    1.438034] printk: console [ttyS0] enabled
[    1.438034] printk: console [ttyS0] enabled
[    1.439706] printk: bootconsole [sbi0] disabled
[    1.439706] printk: bootconsole [sbi0] disabled
[    1.446702] [drm] radeon kernel modesetting enabled.
[    1.498558] loop: module loaded
[    1.507331] libphy: Fixed MDIO Bus: probed
[    1.511661] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    1.512098] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    1.513120] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.513976] ehci-pci: EHCI PCI platform driver
[    1.514768] ehci-platform: EHCI generic platform driver
[    1.515809] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.516997] ohci-pci: OHCI PCI platform driver
[    1.521850] ohci-platform: OHCI generic platform driver
[    1.526169] usbcore: registered new interface driver uas
[    1.529822] usbcore: registered new interface driver usb-storage
[    1.531497] mousedev: PS/2 mouse device common for all mice
[    1.539493] goldfish_rtc 101000.rtc: registered as rtc0
[    1.547803] goldfish_rtc 101000.rtc: setting system clock to 2020-07-24T14:13:03 UTC (1595599983)
[    1.552683] syscon-poweroff soc:poweroff: pm_power_off already claimed (____ptrval____) sbi_shutdown
[    1.553664] syscon-poweroff: probe of soc:poweroff failed with error -16
[    1.555564] usbcore: registered new interface driver usbhid
[    1.556169] usbhid: USB HID core driver
[    1.559380] NET: Registered protocol family 10
[    1.581800] Segment Routing with IPv6
[    1.584368] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    1.593630] NET: Registered protocol family 17
[    1.596262] 9pnet: Installing 9P2000 support
[    1.597109] Key type dns_resolver registered
[    1.736463] Freeing unused kernel memory: 224K
[    1.748111] Run /init as init process
           _  _
          | ||_|
          | | _ ____  _   _  _  _ 
          | || |  _ \| | | |\ \/ /
          | || | | | | |_| |/    \
          |_||_|_| |_|\____|\_/\_/

               Busybox Rootfs

Please press Enter to activate this console. 
/ # 
/ # cat /proc/cpuinfo 
processor	: 0
hart		: 0
isa		: rv64imafdcsuh
mmu		: sv48

/ # cat /proc/interrupts 
           CPU0       
  1:          0  SiFive PLIC  11  101000.rtc
  2:        153  SiFive PLIC  10  ttyS0
  5:        449  RISC-V INTC   5  riscv-timer
IPI0:         0  Rescheduling interrupts
IPI1:         0  Function call interrupts
IPI2:         0  CPU stop interrupts
/ # 
/ # dmesg | grep kvm
[    1.094977] kvm [1]: hypervisor extension available
[    1.096555] kvm [1]: host has 14 VMID bits
[   20.254215] random: fast init done
/ # 
/ # ./apps/lkvm-static run -m 128 -c2 --console serial -p "console=ttyS0 earlyco
n=sbi" -k ./apps/Image --debug
  # lkvm run -k ./apps/Image -m 128 -c 2 --name guest-49
  Info: (riscv/kvm.c) kvm__arch_load_kernel_image:115: Loaded kernel to 0x80200000 (17180396 bytes)
  Info: (riscv/kvm.c) kvm__arch_load_kernel_image:126: Placing fdt at 0x81800000 - 0x87ffffff
  # Warning: The maximum recommended amount of VCPUs is 1
  Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x10000000:5
  Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x10000200:6
  Info: (virtio/mmio.c) virtio_mmio_init:325: virtio-mmio.devices=0x200@0x10000400:7
[    0.000000] OF: fdt: Ignoring memory range 0x80000000 - 0x80200000
[    0.000000] Linux version 5.8.0-rc4-00022-g906eafa224e2 (anup@anup-ubuntu64-vm) (riscv64-unknown-linux-gnu-gcc (GCC) 9.2.0, GNU ld (GNU Binutils) 2.34) #1 SMP Fri Jul 24 19:10:43 IST 2020
[    0.000000] earlycon: sbi0 at I/O port 0x0 (options '')
[    0.000000] printk: bootconsole [sbi0] enabled
[    0.000000] initrd not found or empty - disabling initrd
[    0.000000] Zone ranges:
[    0.000000]   DMA32    [mem 0x0000000080200000-0x0000000087ffffff]
[    0.000000]   Normal   empty
[    0.000000] Movable zone start for each node
[    0.000000] Early memory node ranges
[    0.000000]   node   0: [mem 0x0000000080200000-0x0000000087ffffff]
[    0.000000] Initmem setup node 0 [mem 0x0000000080200000-0x0000000087ffffff]
[    0.000000] software IO TLB: mapped [mem 0x83e3b000-0x87e3b000] (64MB)
[    0.000000] SBI specification v0.1 detected
[    0.000000] riscv: ISA extensions acdfimsu
[    0.000000] riscv: ELF capabilities acdfim
[    0.000000] percpu: Embedded 17 pages/cpu s31704 r8192 d29736 u69632
[    0.000000] Built 1 zonelists, mobility grouping on.  Total pages: 31815
[    0.000000] Kernel command line:  console=ttyS0 rw rootflags=trans=virtio,version=9p2000.L,cache=loose rootfstype=9p init=/virt/init  ip=dhcp console=ttyS0 earlycon=sbi
[    0.000000] Dentry cache hash table entries: 16384 (order: 5, 131072 bytes, linear)
[    0.000000] Inode-cache hash table entries: 8192 (order: 4, 65536 bytes, linear)
[    0.000000] Sorting __ex_table...
[    0.000000] mem auto-init: stack:off, heap alloc:off, heap free:off
[    0.000000] Memory: 43852K/129024K available (6456K kernel code, 4177K rwdata, 4096K rodata, 226K init, 323K bss, 85172K reserved, 0K cma-reserved)
[    0.000000] SLUB: HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1
[    0.000000] rcu: Hierarchical RCU implementation.
[    0.000000] rcu: 	RCU restricting CPUs from NR_CPUS=8 to nr_cpu_ids=2.
[    0.000000] rcu: RCU calculated value of scheduler-enlistment delay is 25 jiffies.
[    0.000000] rcu: Adjusting geometry for rcu_fanout_leaf=16, nr_cpu_ids=2
[    0.000000] NR_IRQS: 64, nr_irqs: 64, preallocated irqs: 0
[    0.000000] riscv-intc: 64 local interrupts mapped
[    0.000000] plic: interrupt-controller@0c000000: mapped 1024 interrupts with 2 handlers for 4 contexts.
[    0.000000] riscv_timer_init_dt: Registering clocksource cpuid [0] hartid [0]
[    0.000000] clocksource: riscv_clocksource: mask: 0xffffffffffffffff max_cycles: 0x24e6a1710, max_idle_ns: 440795202120 ns
[    0.000462] sched_clock: 64 bits at 10MHz, resolution 100ns, wraps every 4398046511100ns
[    0.192140] Console: colour dummy device 80x25
[    0.285393] Calibrating delay loop (skipped), value calculated using timer frequency.. 20.00 BogoMIPS (lpj=40000)
[    0.458458] pid_max: default: 32768 minimum: 301
[    0.540658] Mount-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    0.648749] Mountpoint-cache hash table entries: 512 (order: 0, 4096 bytes, linear)
[    1.185338] rcu: Hierarchical SRCU implementation.
[    1.349954] smp: Bringing up secondary CPUs ...
[    1.470979] smp: Brought up 1 node, 2 CPUs
[    1.617900] devtmpfs: initialized
[    1.657406] random: get_random_u32 called from bucket_table_alloc.isra.0+0x4e/0x154 with crng_init=0
[    1.747392] clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 7645041785100000 ns
[    1.826483] futex hash table entries: 512 (order: 3, 32768 bytes, linear)
[    1.907386] NET: Registered protocol family 16
[    2.213718] HugeTLB registered 2.00 MiB page size, pre-allocated 0 pages
[    2.475095] vgaarb: loaded
[    2.501863] SCSI subsystem initialized
[    2.595730] usbcore: registered new interface driver usbfs
[    2.639905] usbcore: registered new interface driver hub
[    2.696809] usbcore: registered new device driver usb
[    2.822278] clocksource: Switched to clocksource riscv_clocksource
[    3.299615] NET: Registered protocol family 2
[    3.356880] tcp_listen_portaddr_hash hash table entries: 256 (order: 0, 4096 bytes, linear)
[    3.414392] TCP established hash table entries: 1024 (order: 1, 8192 bytes, linear)
[    3.470756] TCP bind hash table entries: 1024 (order: 2, 16384 bytes, linear)
[    3.514658] TCP: Hash tables configured (established 1024 bind 1024)
[    3.576687] UDP hash table entries: 256 (order: 1, 8192 bytes, linear)
[    3.630177] UDP-Lite hash table entries: 256 (order: 1, 8192 bytes, linear)
[    3.680676] NET: Registered protocol family 1
[    3.775284] RPC: Registered named UNIX socket transport module.
[    3.819144] RPC: Registered udp transport module.
[    3.841901] RPC: Registered tcp transport module.
[    3.874103] RPC: Registered tcp NFSv4.1 backchannel transport module.
[    3.925972] PCI: CLS 0 bytes, default 64
[    3.990906] kvm [1]: hypervisor extension not available
[    4.084109] workingset: timestamp_bits=62 max_order=14 bucket_order=0
[    4.329006] NFS: Registering the id_resolver key type
[    4.368354] Key type id_resolver registered
[    4.402982] Key type id_legacy registered
[    4.458342] nfs4filelayout_init: NFSv4 File Layout Driver Registering...
[    4.508398] 9p: Installing v9fs 9p2000 file system support
[    4.554785] NET: Registered protocol family 38
[    4.577585] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252)
[    4.618380] io scheduler mq-deadline registered
[    4.657852] io scheduler kyber registered
[    4.701986] pci-host-generic 30000000.pci: host bridge /smb/pci ranges:
[    4.737162] pci-host-generic 30000000.pci:       IO 0x0000000000..0x000000ffff -> 0x0000000000
[    4.802374] pci-host-generic 30000000.pci:      MEM 0x0040000000..0x007fffffff -> 0x0040000000
[    4.875638] pci-host-generic 30000000.pci: ECAM at [mem 0x30000000-0x3fffffff] for [bus 00-01]
[    4.935941] pci-host-generic 30000000.pci: PCI host bridge to bus 0000:00
[    4.986299] pci_bus 0000:00: root bus resource [bus 00-01]
[    5.026790] pci_bus 0000:00: root bus resource [io  0x0000-0xffff]
[    5.056620] pci_bus 0000:00: root bus resource [mem 0x40000000-0x7fffffff]
[    6.504299] Serial: 8250/16550 driver, 4 ports, IRQ sharing disabled
[    6.599439] printk: [   49.963914] random: crng init done
console [ttyS0] disabled
[    6.654700] 3f8.U6_16550A: ttyS0 at MMIO 0x3f8 (irq = 4, base_baud = 115200) is a 16550A
[    6.790086] printk: console [ttyS0] enabled
[    6.790086] printk: console [ttyS0] enabled
[    6.956712] printk: bootconsole [sbi0] disabled
[    6.956712] printk: bootconsole [sbi0] disabled
[    7.260082] 2f8.U6_16550A: ttyS1 at MMIO 0x2f8 (irq = 6, base_baud = 115200) is a 16550A
[    7.472211] 3e8.U6_16550A: ttyS2 at MMIO 0x3e8 (irq = 7, base_baud = 115200) is a 16550A
[    7.648595] 2e8.U6_16550A: ttyS3 at MMIO 0x2e8 (irq = 8, base_baud = 115200) is a 16550A
[    7.876601] [drm] radeon kernel modesetting enabled.
[    8.367585] loop: module loaded
[    8.429445] libphy: Fixed MDIO Bus: probed
[    8.619027] e1000e: Intel(R) PRO/1000 Network Driver - 3.2.6-k
[    8.672326] e1000e: Copyright(c) 1999 - 2015 Intel Corporation.
[    8.735401] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    8.786957] ehci-pci: EHCI PCI platform driver
[    8.838507] ehci-platform: EHCI generic platform driver
[    8.888295] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    8.935779] ohci-pci: OHCI PCI platform driver
[    8.988653] ohci-platform: OHCI generic platform driver
[    9.057997] usbcore: registered new interface driver uas
[    9.112335] usbcore: registered new interface driver usb-storage
[    9.198880] mousedev: PS/2 mouse device common for all mice
[    9.302016] usbcore: registered new interface driver usbhid
[    9.395929] usbhid: USB HID core driver
[    9.471423] NET: Registered protocol family 10
[    9.592811] Segment Routing with IPv6
[    9.641775] sit: IPv6, IPv4 and MPLS over IPv4 tunneling driver
[    9.786196] NET: Registered protocol family 17
[    9.840752] 9pnet: Installing 9P2000 support
[    9.946881] Key type dns_resolver registered
[   10.211675] Sending DHCP requests ., OK
[   10.397504] IP-Config: Got DHCP answer from 192.168.33.1, my address is 192.168.33.15
[   10.508955] IP-Config: Complete:
[   10.581026]      device=eth0, hwaddr=02:15:15:15:15:15, ipaddr=192.168.33.15, mask=255.255.255.0, gw=192.168.33.1
[   10.721266]      host=192.168.33.15, domain=, nis-domain=(none)
[   10.843717]      bootserver=192.168.33.1, rootserver=0.0.0.0, rootpath=
[   10.843797]      nameserver0=192.168.33.1
[   11.330174] VFS: Mounted root (9p filesystem) on device 0:15.
[   11.479845] devtmpfs: mounted
[   11.782526] Freeing unused kernel memory: 224K
[   11.945910] Run /virt/init as init process
Mounting...
/ # 
[   14.411692] random: fast init done
/ # cat /proc/interrupts 
           CPU0       CPU1       
  1:        116          0  SiFive PLIC   5  virtio0
  2:        148          0  SiFive PLIC   6  virtio1
  3:          9          0  SiFive PLIC   7  virtio2
  4:         51          0  SiFive PLIC   1  ttyS0
  5:       1114       1054  RISC-V INTC   5  riscv-timer
IPI0:        14         15  Rescheduling interrupts
IPI1:       774        453  Function call interrupts
IPI2:         0          0  CPU stop interrupts
/ # 
/ # cat /proc/cpuinfo 
processor	: 0
hart		: 0
isa		: rv64imafdcsu
mmu		: sv48

processor	: 1
hart		: 1
isa		: rv64imafdcsu
mmu		: sv48

/ # 
/ # ping 192.168.33.1
PING 192.168.33.1 (192.168.33.1): 56 data bytes
64 bytes from 192.168.33.1: seq=0 ttl=64 time=91.396 ms
64 bytes from 192.168.33.1: seq=1 ttl=64 time=9.084 ms
64 bytes from 192.168.33.1: seq=2 ttl=64 time=7.331 ms
64 bytes from 192.168.33.1: seq=3 ttl=64 time=5.014 ms
64 bytes from 192.168.33.1: seq=4 ttl=64 time=5.153 ms
64 bytes from 192.168.33.1: seq=5 ttl=64 time=19.687 ms
64 bytes from 192.168.33.1: seq=6 ttl=64 time=9.199 ms
64 bytes from 192.168.33.1: seq=7 ttl=64 time=5.727 ms
64 bytes from 192.168.33.1: seq=8 ttl=64 time=11.390 ms
64 bytes from 192.168.33.1: seq=9 ttl=64 time=4.804 ms
64 bytes from 192.168.33.1: seq=10 ttl=64 time=7.332 ms
64 bytes from 192.168.33.1: seq=11 ttl=64 time=8.857 ms
64 bytes from 192.168.33.1: seq=12 ttl=64 time=6.873 ms
^C
--- 192.168.33.1 ping statistics ---
13 packets transmitted, 13 packets received, 7% packet loss
round-trip min/avg/max = 4.804/14.757/91.396 ms
/ # 
/ # 
/ # poweroff -f
[   50.417780] reboot: Power down

  # KVM session ended normally.
/ # 
/ #