mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
gem5 kvm section
This commit is contained in:
24
README.adoc
24
README.adoc
@@ -3500,18 +3500,12 @@ gem5 can generate DTBs on ARM with `--generate-dtb`. The generated DTB is placed
|
||||
|
||||
https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine[KVM] is Linux kernel interface that <<benchmark-linux-kernel-boot,greatly speeds up>> execution of virtual machines.
|
||||
|
||||
You can make QEMU or gem5 by passing enabling KVM with:
|
||||
You can make QEMU or <<gem5-kvm,gem5>> by passing enabling KVM with:
|
||||
|
||||
....
|
||||
./run --kvm
|
||||
....
|
||||
|
||||
but it was broken in gem5 with pending patches: https://www.mail-archive.com/gem5-users@gem5.org/msg15046.html It fails immediately on:
|
||||
|
||||
....
|
||||
panic: KVM: Failed to enter virtualized mode (hw reason: 0x80000021)
|
||||
....
|
||||
|
||||
KVM works by running userland instructions natively directly on the real hardware instead of running a software simulation of those instructions.
|
||||
|
||||
Therefore, KVM only works if you the host architecture is the same as the guest architecture. This means that this will likely only work for x86 guests since almost all development machines are x86 nowadays. Unless you are https://www.youtube.com/watch?v=8ItXpmLsINs[running an ARM desktop for some weird reason] :-)
|
||||
@@ -3551,6 +3545,20 @@ We don't want to build the full Buildroot image inside the VM as that would be w
|
||||
|
||||
TODO: do the right thing and cross compile QEMU and gem5. gem5's Python parts might be a pain. QEMU should be easy: https://stackoverflow.com/questions/26514252/cross-compile-qemu-for-arm
|
||||
|
||||
=== gem5 KVM
|
||||
|
||||
While gem5 does have KVM, as of 2019 its support has not been very good, because debugging it is harder and people haven't focused intensively on it.
|
||||
|
||||
X86 was broken with pending patches: https://www.mail-archive.com/gem5-users@gem5.org/msg15046.html It failed immediately on:
|
||||
|
||||
....
|
||||
panic: KVM: Failed to enter virtualized mode (hw reason: 0x80000021)
|
||||
....
|
||||
|
||||
Bibliography:
|
||||
|
||||
* ARM thread: https://stackoverflow.com/questions/53523087/how-to-run-gem5-on-kvm-on-arm-with-multiple-cores
|
||||
|
||||
== User mode simulation
|
||||
|
||||
Both QEMU and gem5 have an user mode simulation mode in addition to full system simulation that we consider elsewhere in this project.
|
||||
@@ -12442,6 +12450,8 @@ Implementations:
|
||||
Useful to <<gem5-restore-checkpoint-with-a-different-cpu,boot Linux fast and then checkpoint and switch to a more detailed CPU>>.
|
||||
* `TimingSimpleCPU`: memory accesses are realistic, but the CPU has no pipeline. The simulation is faster than detailed models, but slower than `AtomicSimpleCPU`. TODO: application?
|
||||
|
||||
<<gem5-kvm,KVM CPUs>> are an alternative way of fast forwarding boot when they work.
|
||||
|
||||
==== gem5 MinorCPU
|
||||
|
||||
Generic in-order core that does not model any specific CPU.
|
||||
|
||||
Reference in New Issue
Block a user