Question Help compiling kernel with KVM

Search This thread
Hi,
I wanted to compile a custom kernel with KVM for the ROG Phone 5 on the latest Android 12 (EU variant) so I looked at the Kirisakura kernel for base (from @Freak07) and I looked at the script that starts compiling the kernel. I could not find some things that was required such as the Google's GCC thing or the "DU_Tools" but I still managed to start compiling the kernel after editing the defconfig file using make menuconfig to enable KVM. Once I did that I ran the script but after like two minutes I got an error (Error 2).
So can someone help me doing this please?
Thanks.
 

chrisaw

Senior Member
Jun 12, 2007
314
237
Hey Alex - been looking in to creating a build script using docker for this out of curiosity.

Out of interest though - how are you planning to use KVM once it's enabled?
 
Hey Alex - been looking in to creating a build script using docker for this out of curiosity.

Out of interest though - how are you planning to use KVM once it's enabled?
Hey, I didn't tried using docker (because I don't know how to xD) and I want to use KVM because I heard that the Snapdragon 888 is compatible with it so I was thinking about doing a Windows 10 arm VM with native performance.
Got this building cleanly and producing a flashable ZIP:


Build instructions:

Code:
$ cd <kernel sources>/build/
$ ./build.sh

You will need Docker installed on your system via whatever means necessary and this is really aimed at Linux systems although you could also run the build on a Windows or Mac PC if you setup Docker correctly.
Thanks I will try that :)
 

Ssaikatsaha

Member
Dec 21, 2020
37
1
Your chances of getting that working easily are slim.

Adding the KVM support to the kernel is easy but the problem you then get is about switching the CPU to "HYP" mode. (just based on what I read online)

If you have further info about this I'd be interested in reading it and seeing if we can get something which works. What I can tell you is that /dev/kvm does not get created simply by the changes I made.

Also be aware that /proc/config.gz is spoofed in these kernels with the "stock" config file so running something like "zcat /proc/config.gz" wont show KVM is enabled but it is. :)
Yes you are R8! Without hyp we can't enable KVM support.. but i found a site where telling android 13 has full KVM support.. but don't know it's true or not..

Because KVM support only available on some snapdragon chipset only..