WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: kvm  (Read 194 times)

Offline meo

  • Hero Member
  • *****
  • Posts: 666
kvm
« on: May 06, 2026, 09:48:17 AM »
I would appreciate a lot if the kvm package could be done for piCore also. I see it among the tce extensions but not for piCore.

Kind Regards,
meo
"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15579
Re: kvm
« Reply #1 on: May 06, 2026, 10:01:26 AM »
Is there a kvm-arm kernel driver?

Offline meo

  • Hero Member
  • *****
  • Posts: 666
Re: kvm
« Reply #2 on: May 06, 2026, 10:26:15 AM »
Thanks for your interest. When I checked for it on my Raspberry Pi i couldn't find anything related to kvm for the piCore. When I cheched the awailable tcz packages i saw it was present to it probably is for TC 17.

Greetings,
meo

PS The reason that I'm making this request is that I can only come to a certain point using only qemu without any accelerator. DS
"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15579
Re: kvm
« Reply #3 on: May 06, 2026, 11:39:03 AM »
looking at the x86_64 and aarch64 kernel config, I don't see where there is the possibility for a kvm-arm driver?

Code: [Select]
CONFIG_VIRTUALIZATION=y
CONFIG_KVM_X86=m
CONFIG_KVM=m
CONFIG_KVM_WERROR=y
# CONFIG_KVM_SW_PROTECTED_VM is not set
CONFIG_KVM_INTEL=m
CONFIG_KVM_INTEL_PROVE_VE=y
CONFIG_KVM_AMD=m
CONFIG_KVM_AMD_SEV=y
CONFIG_KVM_IOAPIC=y
CONFIG_KVM_SMM=y
# CONFIG_KVM_HYPERV is not set
# CONFIG_KVM_XEN is not set
# CONFIG_KVM_PROVE_MMU is not set
CONFIG_KVM_EXTERNAL_WRITE_TRACKING=y
CONFIG_KVM_MAX_NR_VCPUS=1024

Code: [Select]
CONFIG_VIRTUALIZATION=y
CONFIG_KVM=y
# CONFIG_NVHE_EL2_DEBUG is not set
# CONFIG_PTDUMP_STAGE2_DEBUGFS is not set

Offline meo

  • Hero Member
  • *****
  • Posts: 666
Re: kvm
« Reply #4 on: May 06, 2026, 02:22:24 PM »
I found this browsing the tcz packages kvm-6.18.2-tinycore64.tcz. I just assumed that it would helpful using qemu to run another OS inside of piCore. Maybe I drew the wrong conclusion but when I tried to use kvm in connection with qemy I got an error message that kvm wasn't present.

Kind Regards,
meo
"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15579
Re: kvm
« Reply #5 on: May 06, 2026, 02:27:24 PM »
When using kvm with CorePure64 you need to load kvm-intel or kvm-amd depending on your cpu. If you don’t do this you will get the same error message if you try to use kvm with qemu.

Offline meo

  • Hero Member
  • *****
  • Posts: 666
Re: kvm
« Reply #6 on: May 06, 2026, 02:47:18 PM »
I did some research and found this "Yes, KVM (Kernel-based Virtual Machine) significantly accelerates QEMU on ARM64. By using the -enable-kvm flag with -cpu host, QEMU shifts from slow software emulation to running guest code directly on the host processor, providing near-native speed."

Greetings,
meo
"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire

Offline meo

  • Hero Member
  • *****
  • Posts: 666
Re: kvm
« Reply #7 on: May 06, 2026, 02:58:35 PM »
The command from terminal like this: qemu-system-x86_64 -enable-kvm -m 7G -device AC97 -cdrom image.iso -smp 2". I gave a similar command and got the error about kvm not being present. I could start it without kvm but practically not do anything since it was so slow. So I thought that it was just to install kvm. Maybe it isn't. I might be wrong but I think that someway it can improve.

Greetings,
meo
"All that is very well," answered Candide, "but let us cultivate our garden." - Francois-Marie Arouet Voltaire

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 12744
Re: kvm
« Reply #8 on: May 06, 2026, 03:41:52 PM »
Hi meo
I did some research ...
Quote
... shifts from slow software emulation to running guest code directly on the host processor, providing near-native speed."
I did some research too. If you trying to use a x86_64 system to emulate ARM, you
will be limited to slow software emulation.

Note the bold print in the quote above.Running guest ARM code on a x86_64 host
processor can't be done. The guest and host CPUs have different instruction sets
and architectures.

From what I've read, you need to use ARM64 to emulate ARM CPUs at near native
speed. I didn't research it too deeply, but I got the impression no drivers were involved.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15579
Re: kvm
« Reply #9 on: May 06, 2026, 03:45:50 PM »
Ah - I was under the impression we were trying to emulate x86_64 on aarch64…

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 15579
Re: kvm
« Reply #10 on: Today at 06:38:59 AM »
I updated qemu in the piCore64 repo as the existing extension would not launch in a gtk3 or sdl2 window.

The updated extension reports that kvm is enabled, but -enable-kvm fails. kvm support appears to be compiled into the piCore kernel, but I cannot find a kvm-arm kernel driver in or out of tree that may or may not be required.

I double checked with x86/x86_64 and a kvm-intel kernel driver is required for kvm to work on my laptop.

Booting the TinyCorePure64 iso using qemu on an RPi5 is quite slow, but OK once loaded.
« Last Edit: Today at 06:41:28 AM by Juanito »