Skip to content

Commit 985913e

Browse files
committed
prepare for kvm testing
1 parent 33f286b commit 985913e

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed

README.adoc

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -505,14 +505,14 @@ The limitations are severe however:
505505
* can't <<gdb,GDB step debug the kernel>>, since the source and cross toolchain with GDB are not available. Buildroot cannot easily use a host toolchain: <<prebuilt-toolchain>>.
506506
+
507507
Maybe we could work around this by just downloading the kernel source somehow, and using a host prebuilt GDB, but we felt that it would be too messy and unreliable.
508-
* you won't get the latest version of this repository. Our <<travis>> attempt to automate builds failed, and storing a release for every commit would likely make GitHub mad at us.
508+
* you won't get the latest version of this repository. Our <<travis>> attempt to automate builds failed, and storing a release for every commit would likely make GitHub mad at us anyways.
509509
* <<gem5>> is not currently supported, although it should not be too hard to do. Annoyances:
510510
+
511511
** there is no Debian package for it, so you have to compile your own, so you might as well just build the image itself
512512
** it does not handle <<gem5-qcow2,qcow2>>, and we haven't gotten <<squashfs>> to work yet, therefore we would have to either distribute large ext2 images, or constantly fight with <<br2_target_rootfs_ext2_size>>
513513
** QEMU uses `bzImage` and gem5 the raw `vmlinux`, and we don't want to distribute the same thing twice...
514514
+
515-
And our attempt at using link:https://github.com/torvalds/linux/blob/master/scripts/extract-vmlinux[`extract-vmlinux`] failed for `aarch64` with:
515+
Our attempt at using link:https://github.com/torvalds/linux/blob/master/scripts/extract-vmlinux[`extract-vmlinux`] to convert between them failed for `aarch64` with:
516516
+
517517
....
518518
run-detectors: unable to find an interpreter for
@@ -2824,7 +2824,9 @@ gem5 can generate DTBs on ARM with `--generate-dtb`, but we don't use that featu
28242824

28252825
== KVM
28262826

2827-
You can make QEMU or gem5 <<benchmark-linux-kernel-boot,run faster>> by passing enabling KVM with:
2827+
link: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.
2828+
2829+
You can make QEMU or gem5 by passing enabling KVM with:
28282830

28292831
....
28302832
./run --kvm
@@ -2836,21 +2838,19 @@ but it was broken in gem5 with pending patches: https://www.mail-archive.com/gem
28362838
panic: KVM: Failed to enter virtualized mode (hw reason: 0x80000021)
28372839
....
28382840

2839-
KVM uses the link:https://en.wikipedia.org/wiki/Kernel-based_Virtual_Machine[KVM Linux kernel feature] of the host to run most instructions natively.
2841+
KVM works by running userland instructions natively directly on the real hardware instead of running a software simulation of those instructions.
2842+
2843+
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 link:https://www.youtube.com/watch?v=8ItXpmLsINs[running an ARM desktop for some weird reason] :-)
28402844

28412845
We don't enable KVM by default because:
28422846

2843-
* only works if the architecture of the guest equals that of the host.
2844-
+
2845-
We have only tested / supported it on x86, but it is rumoured that QEMU and gem5 also have ARM KVM support if you are link:https://www.youtube.com/watch?v=8ItXpmLsINs[running an ARM desktop for some weird reason] :-)
2846-
* limits visibility, since more things are running natively:
2847+
* it limits visibility, since more things are running natively:
28472848
** can't use GDB
28482849
** can't do instruction tracing
2849-
* kernel boots are already fast enough without `-enable-kvm`
2850-
2851-
The main use case for `-enable-kvm` in this repository is to test if something that takes a long time to run is functionally correct.
2850+
** on gem5, you lose cycle counts and therefor any notion of performance
2851+
* QEMU kernel boots are already fast enough for most purposes without it
28522852

2853-
For example, when porting a benchmark to Buildroot, you can first use QEMU's KVM to test that benchmarks is producing the correct results, before analysing them more deeply in gem5, which runs much slower.
2853+
One important use case for KVM is to fast forward gem5 execution, often to skip boot, take a <<gem5-checkpoint>>, and then move on to a more detailed and slow simulation
28542854

28552855
== User mode simulation
28562856

build

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,12 @@ name_to_component_map = {
129129
'device-tree-compiler',
130130
'diod',
131131
'libgoogle-perftools-dev',
132+
'm4',
132133
'protobuf-compiler',
133134
'python-dev',
134135
'python-pip',
135136
'scons',
137+
'zlib1g-dev',
136138
},
137139
python2_pkgs={
138140
# Generate graphs of config.ini under m5out.

0 commit comments

Comments
 (0)