Ubuntu Mate 18.04- KVM not working

Post Reply
davidwkerr
Posts: 37
Joined: Wed Mar 01, 2017 9:26 am
languages_spoken: English, French
ODROIDs: 5* XU4, 1xC2, 1xC1+
Location: Sydney, Australia
Has thanked: 0
Been thanked: 0
Contact:

Ubuntu Mate 18.04- KVM not working

Post by davidwkerr » Wed Mar 25, 2020 1:25 pm

Latest 18.04, updated:

Linux odroid 4.14.173-173 #1 SMP PREEMPT Mon Mar 16 17:08:14 -03 2020 armv7l armv7l armv7l GNU/Linux

I have changed the boot.ini to select the correct dtb file, as follows and also removed all but the kvm file:

setenv fdtloaded "false"
if test "x${board_name}" = "x"; then setenv board_name "xu4"; fi
if test "${board_name}" = "xu4"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4-kvm.dtb; setenv fdtloaded "true"; fi
if test "${board_name}" = "xu3"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3.dtb; setenv fdtloaded "true"; fi
if test "${board_name}" = "xu3l"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu3-lite.dtb; setenv fdtloaded "true"; fi
if test "${fdtloaded}" = "false"; then fatload mmc 0:1 0x44000000 exynos5422-odroidxu4-kvm.dtb; setenv fdtloaded "true"; fi

odroid@odroid:~$ sudo kvm-ok
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used

But I understood that this kernel was built with kvm!

dmesg returns no kvm references.

virt-manager reports no kvm.

I tried rebuilding the kernel, but I did not succeed.

Perhaps some knowledgeable person can explain what I need to do. I am believing (at the moment) that maybe the kernel was NOT built with kvm.

This is what I downloaded- not the minimal image: Ubuntu 18.04.3 (20190929)
lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.4 LTS
Release: 18.04
Codename: bionic

Regds,
Dave

davidwkerr
Posts: 37
Joined: Wed Mar 01, 2017 9:26 am
languages_spoken: English, French
ODROIDs: 5* XU4, 1xC2, 1xC1+
Location: Sydney, Australia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ubuntu Mate 18.04- KVM not working

Post by davidwkerr » Wed Mar 25, 2020 3:03 pm

Okay,
I am certain the supplied kernel does not have kvm even though there is a kvm dtb file.
I am currently building a new one with kvm and will report back when successful.
Dave

davidwkerr
Posts: 37
Joined: Wed Mar 01, 2017 9:26 am
languages_spoken: English, French
ODROIDs: 5* XU4, 1xC2, 1xC1+
Location: Sydney, Australia
Has thanked: 0
Been thanked: 0
Contact:

Re: Ubuntu Mate 18.04- KVM not working

Post by davidwkerr » Wed Mar 25, 2020 4:54 pm

The default kernel build seems fine.
However, the one using odroidxu4_kvm_defconfig fails when performing

sudo make modules_install

It fails with all modules missing.

So, I'm not sure if anyone has tried a kvm build very recently. If you have, please let me know. Hopefully someone wiser than myself can assist.

Regds,Dave

davidwkerr
Posts: 37
Joined: Wed Mar 01, 2017 9:26 am
languages_spoken: English, French
ODROIDs: 5* XU4, 1xC2, 1xC1+
Location: Sydney, Australia
Has thanked: 0
Been thanked: 0
Contact:

Re: SOLVED Ubuntu Mate 18.04- KVM not working

Post by davidwkerr » Sun Mar 29, 2020 2:27 pm

Okay. The default kernel does not have kvm.

The kvm kernel build does not work. (4.14.173+)

However, applying this patch and then doing the kvm build and installing things in the correct spots solves the problem.

https://paste.ubuntu.com/p/bB8CfKbq55/

Regards,
Dave

jwilson
Posts: 3
Joined: Tue Feb 27, 2018 2:00 pm
languages_spoken: english
ODROIDs: C2, XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Ubuntu Mate 18.04- KVM not working

Post by jwilson » Sat May 23, 2020 4:06 pm

Hi Dave,

I am in the same boat as you were. Trying to enable KVM support with 18.04 minimal on the XU4. I've gone through all the steps you have described above with no luck. Now I'm about to start compiling and have a question. Did you just follow the instructions at https://wiki.odroid.com/odroid-xu4/soft ... ing_kernel for cross compile? If yes, did you use the https://releases.linaro.org/components/ ... ihf.tar.xz toolchain, or did you use a later version? If you didn't cross compile, are there any additional steps you had to take to ensure a successful compile (other than applying the patch)?

Reason I ask is that I tried the native compile on the XU4 on 18.04 after I applied the patch, but I still had no KVM in dmesg or kvm-ok although the compile was successful. The only difference in that attempt was that it was a 16.04 upgraded to 18.04. I reflashed the eMMC with the latest 18.04 minimal, and tried updating boot.ini to using the kvm dtb but no luck. As a last ditch attempt, I am going to try compiling the kernel again.

Any advice is greatly appreciated.

thanks -Jeremy

jwilson
Posts: 3
Joined: Tue Feb 27, 2018 2:00 pm
languages_spoken: english
ODROIDs: C2, XU4
Has thanked: 0
Been thanked: 0
Contact:

Re: Ubuntu Mate 18.04- KVM not working

Post by jwilson » Sat May 23, 2020 9:09 pm

Here are the steps I followed:

Flashed Ubuntu 18.04.3 LTS (v1.2) from https://wiki.odroid.com/odroid-xu4/os_i ... 10-minimal on to an eMMC. Booted the XU4, then compiled the kernel with KVM support as follows:

$ sudo -i
$ apt update
$ apt install git bc libssl-dev libncurses5-dev
$ git clone --depth 1 https://github.com/hardkernel/linux -b odroidxu4-4.14.y
$ cd linux
$ patch -p1 < /home/user/patchfile
$ make odroidxu4_kvm_defconfig
$ make -j 8
$ make modules
$ make modules_install
$ make zImage dtbs
$ cp arch/arm/boot/zImage /media/boot/zImage_kvm
$ cp arch/arm/boot/dts/exynos5422-odroidxu4-kvm.dtb /media/boot/

followed by an edit of /media/boot/boot.ini as follows:

# modify /media/boot/boot.ini
(......)
# Load kernel, initrd and dtb in that sequence
fatload mmc 0:1 0x40008000 zImage_kvm
(......)
if test "${board_name}" = "xu4"; then fatload mmc 0:1 0x44000000 exynos5422-odrooidxu4-kvm.dtb; setenv fdtloaded "true"; fi
(......)

After a reboot,

$ dmesg | grep HYP

[ 0.188912] CPU: All CPU(s) started in HYP mode.

$ dmesg | grep kvm

[ 0.794932] kvm [1]: 8-bit VMID
[ 0.796430] kvm [1]: vgic interrupt IRQ16
[ 0.796898] kvm [1]: Hyp mode initialized successfully

$ cat /proc/interrupts | grep arch_timer
58: 0 0 0 0 0 0 0 0 GICv2 29 Level arch_timer
59: 0 0 0 0 0 0 0 0 GICv2 30 Level arch_timer

$ kvm-ok
INFO: Your CPU does not support KVM extensions
KVM acceleration can NOT be used

Can anyone please point out what am I missing here? Why is the hardware KVM support not getting enabled?

Thanks.

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 1 guest