Skip to content

Commit 4f115bb

Browse files
committed
gem5: improve factoring of gem5 linux kernel build references
1 parent cb32b29 commit 4f115bb

File tree

1 file changed

+39
-20
lines changed

1 file changed

+39
-20
lines changed

README.adoc

Lines changed: 39 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3488,17 +3488,14 @@ TODO could not get it working on `x86_64`, only ARM.
34883488

34893489
Overview: https://stackoverflow.com/questions/50364863/how-to-get-graphical-gui-output-and-user-touch-keyboard-mouse-input-in-a-ful/50364864#50364864
34903490

3491-
More concretely:
3491+
More concretely, first build the kernel with the <<gem5-arm-linux-kernel-patches>>, and then run:
34923492

34933493
....
3494-
git -C "$(./getvar linux_source_dir)" fetch https://gem5.googlesource.com/arm/linux gem5/v4.15:gem5/v4.15
3495-
git -C "$(./getvar linux_source_dir)" checkout gem5/v4.15
34963494
./build-linux \
34973495
--arch arm \
34983496
--custom-config-file-gem5 \
34993497
--linux-build-id gem5-v4.15 \
35003498
;
3501-
git -C "$(./getvar linux_source_dir)" checkout -
35023499
./run --arch arm --gem5 --linux-build-id gem5-v4.15
35033500
....
35043501

@@ -3588,17 +3585,9 @@ The DP650 is a newer display hardware than HDLCD. TODO is its interface publicly
35883585

35893586
The key option to enable support in Linux is `DRM_MALI_DISPLAY=y` which we enable at link:linux_config/display[].
35903587

3588+
Build the kernel exactly as for <<graphic-mode-gem5-aarch64>> and then run with:
3589+
35913590
....
3592-
./build-linux
3593-
git -C "$(./getvar linux_source_dir)" fetch https://gem5.googlesource.com/arm/linux gem5/v4.15:gem5/v4.15
3594-
git -C "$(./getvar linux_source_dir)" checkout gem5/v4.15
3595-
./build-linux \
3596-
--arch aarch64 \
3597-
--config-fragment linux_config/display \
3598-
--custom-config-file "$(./getvar linux_source_dir)/arch/arm64/configs/gem5_defconfig" \
3599-
--linux-build-id gem5-v4.15 \
3600-
;
3601-
git -C "$(./getvar linux_source_dir)" checkout -
36023591
./run --arch aarch64 --dp650 --gem5 --linux-build-id gem5-v4.15
36033592
....
36043593

@@ -4121,8 +4110,8 @@ That file contains `BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/qemu/x86_64/linux
41214110

41224111
Other configs which we had previously tested at 4e0d9af81fcce2ce4e777cb82a1990d7c2ca7c1e are:
41234112

4124-
* `arm` and `aarch64` configs present in the official ARM gem5 Linux kernel fork: https://gem5.googlesource.com/arm/linux, e.g. for arm v4.9: link:https://gem5.googlesource.com/arm/linux/+/917e007a4150d26a0aa95e4f5353ba72753669c7/arch/arm/configs/gem5_defconfig[]. The patches there are just simple optimizations and instrumentation, but they are not needed to boot.
4125-
* Jason's magic `x86_64` config: http://web.archive.org/web/20171229121642/http://www.lowepower.com/jason/files/config which is referenced at: link:http://web.archive.org/web/20171229121525/http://www.lowepower.com/jason/setting-up-gem5-full-system.html[]. QEMU boots with that by removing `# CONFIG_VIRTIO_PCI is not set`
4113+
* `arm` and `aarch64` configs present in the official ARM gem5 Linux kernel fork: <<gem5-arm-linux-kernel-patches>>. Some of the configs present there are added by the patches.
4114+
* Jason's magic `x86_64` config: http://web.archive.org/web/20171229121642/http://www.lowepower.com/jason/files/config which is referenced at: link:http://web.archive.org/web/20171229121525/http://www.lowepower.com/jason/setting-up-gem5-full-system.html[]. QEMU boots with that by removing `# CONFIG_VIRTIO_PCI is not set`.
41264115

41274116
=== Kernel version
41284117

@@ -8729,6 +8718,19 @@ getconf _NPROCESSORS_CONF
87298718

87308719
https://stackoverflow.com/questions/50248067/how-to-run-a-gem5-arm-aarch64-full-system-simulation-with-fs-py-with-more-than-8
87318720

8721+
Build the kernel with the <<gem5-arm-linux-kernel-patches>>, and then run:
8722+
8723+
....
8724+
./run \
8725+
--arch aarch64 \
8726+
--linux-build-id gem5-v4.15 \
8727+
--gem5 \
8728+
--cpus 16 \
8729+
-- \
8730+
--param 'system.realview.gic.gem5_extensions = True' \
8731+
;
8732+
....
8733+
87328734
===== gem5 cache size
87338735

87348736
https://stackoverflow.com/questions/49624061/how-to-run-gem5-simulator-in-fs-mode-without-cache/49634544#49634544
@@ -9751,14 +9753,31 @@ What they mean: https://stackoverflow.com/questions/50583962/what-are-the-gem5-a
97519753

97529754
=== gem5 arm Linux kernel patches
97539755

9754-
https://gem5.googlesource.com/arm/linux/ contains an ARM Linux kernel fork with a few gem5 specific Linux kernel patches on top of mainline created by ARM Holdings.
9756+
https://gem5.googlesource.com/arm/linux/ contains an ARM Linux kernel forks with a few gem5 specific Linux kernel patches on top of mainline created by ARM Holdings on top of a few upstream kernel releases.
9757+
9758+
The patches are optional: the vanilla kernel does boot. But they add some interesting gem5-specific optimizations, instrumentations and device support.
97559759

9756-
Those patches look interesting, but it is obviously not possible to understand what they actually do from their commit message.
9760+
The patches also <<notable-alternate-gem5-kernel-configs,add defconfigs>> that are known to work well with gem5.
9761+
9762+
E.g. for arm v4.9 there is: link:https://gem5.googlesource.com/arm/linux/+/917e007a4150d26a0aa95e4f5353ba72753669c7/arch/arm/configs/gem5_defconfig[].
9763+
9764+
In order to use those patches and their associated configs, and, we recommend using <<linux-kernel-build-variants>> as:
9765+
9766+
....
9767+
git -C "$(./getvar linux_source_dir)" fetch https://gem5.googlesource.com/arm/linux gem5/v4.15:gem5/v4.15
9768+
git -C "$(./getvar linux_source_dir)" checkout gem5/v4.15
9769+
./build-linux \
9770+
--arch aarch64 \
9771+
--custom-config-file-gem5 \
9772+
--linux-build-id gem5-v4.15 \
9773+
;
9774+
git -C "$(./getvar linux_source_dir)" checkout -
9775+
....
97579776

9758-
So let's explain them one by one here as we understand them:
9777+
It is obviously not possible to understand what they actually do from their commit message, so let's explain them one by one here as we understand them:
97599778

97609779
* `drm: Add component-aware simple encoder` allows you to see images through VNC: <<gem5-graphic-mode>>
9761-
* `gem5: Add support for gem5's extended GIC mode` adds support for more than 8 cores: https://stackoverflow.com/questions/50248067/how-to-run-a-gem5-arm-aarch64-full-system-simulation-with-fs-py-with-more-than-8/50248068#5024806
9780+
* `gem5: Add support for gem5's extended GIC mode` adds support for more than 8 cores: <<gem5-arm-more-than-8-cores>>
97629781

97639782
=== m5out directory
97649783

0 commit comments

Comments
 (0)