mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
readme: create linux kernel min config section
This commit is contained in:
52
README.adoc
52
README.adoc
@@ -4378,10 +4378,7 @@ Note that Buildroot can `sed` override some of the configurations, e.g. it force
|
|||||||
|
|
||||||
On top of those, we add the following by default:
|
On top of those, we add the following by default:
|
||||||
|
|
||||||
* link:linux_config/min[]: minimal tweaks required to boot gem5 or for using our slightly different QEMU command line options than Buildroot on all archs
|
* link:linux_config/min[]: see: <<linux-kernel-min-config>>
|
||||||
+
|
|
||||||
Having the same config working for both QEMU and gem5 (oh, the hours of bisection) means that you can deal with functional matters in QEMU, which runs much faster, and switch to gem5 only for performance issues.
|
|
||||||
+
|
|
||||||
* link:linux_config/default[]: other optional configs that we enable by default because they increase visibility, or expose some cool feature, and don't significantly increase build time nor add significant runtime overhead
|
* link:linux_config/default[]: other optional configs that we enable by default because they increase visibility, or expose some cool feature, and don't significantly increase build time nor add significant runtime overhead
|
||||||
+
|
+
|
||||||
We have since observed that the kernel size itself is very bloated compared to `defconfig`: <<linux-kernel-defconfig>>.
|
We have since observed that the kernel size itself is very bloated compared to `defconfig`: <<linux-kernel-defconfig>>.
|
||||||
@@ -4467,6 +4464,29 @@ Bibliography: https://unix.stackexchange.com/questions/29439/compiling-the-kerne
|
|||||||
|
|
||||||
Tested on 1e2b7f1e5e9e3073863dc17e25b2455c8ebdeadd + 1.
|
Tested on 1e2b7f1e5e9e3073863dc17e25b2455c8ebdeadd + 1.
|
||||||
|
|
||||||
|
====== Linux kernel min config
|
||||||
|
|
||||||
|
link:linux_config/min[] contains minimal tweaks required to boot gem5 or for using our slightly different QEMU command line options than Buildroot on all archs.
|
||||||
|
|
||||||
|
It is one of the default config fragments we use, as explained at: <<kernel-configs-about>>>.
|
||||||
|
|
||||||
|
Having the same config working for both QEMU and gem5 (oh, the hours of bisection) means that you can deal with functional matters in QEMU, which runs much faster, and switch to gem5 only for performance issues.
|
||||||
|
|
||||||
|
We can build just with `min` on top of the base config with:
|
||||||
|
|
||||||
|
....
|
||||||
|
./build-linux \
|
||||||
|
--arch aarch64 \
|
||||||
|
--config-fragment linux_config/min \
|
||||||
|
--custom-config-file linux_config/buildroot-aarch64 \
|
||||||
|
--linux-build-id min \
|
||||||
|
;
|
||||||
|
....
|
||||||
|
|
||||||
|
vmlinux had a very similar size to the default. It seems that link:linux_config/buildroot-aarch64[] contains or implies most link:linux_config/default[] options already? TODO: that seems odd, really?
|
||||||
|
|
||||||
|
Tested on 649d06d6758cefd080d04dc47fd6a5a26a620874 + 1.
|
||||||
|
|
||||||
===== Notable alternate gem5 kernel configs
|
===== Notable alternate gem5 kernel configs
|
||||||
|
|
||||||
Other configs which we had previously tested at 4e0d9af81fcce2ce4e777cb82a1990d7c2ca7c1e are:
|
Other configs which we had previously tested at 4e0d9af81fcce2ce4e777cb82a1990d7c2ca7c1e are:
|
||||||
@@ -10196,13 +10216,37 @@ git -C "$(./getvar linux_source_dir)" checkout gem5/v4.15
|
|||||||
--linux-build-id gem5-v4.15 \
|
--linux-build-id gem5-v4.15 \
|
||||||
;
|
;
|
||||||
git -C "$(./getvar linux_source_dir)" checkout -
|
git -C "$(./getvar linux_source_dir)" checkout -
|
||||||
|
./run \
|
||||||
|
--arch aarch64 \
|
||||||
|
--emulator gem5 \
|
||||||
|
--linux-build-id gem5-v4.15 \
|
||||||
|
;
|
||||||
....
|
....
|
||||||
|
|
||||||
|
QEMU also boots that kernel successfully:
|
||||||
|
|
||||||
|
....
|
||||||
|
./run \
|
||||||
|
--arch aarch64 \
|
||||||
|
--linux-build-id gem5-v4.15 \
|
||||||
|
;
|
||||||
|
....
|
||||||
|
|
||||||
|
but glibc kernel version checks make init fail with:
|
||||||
|
|
||||||
|
....
|
||||||
|
FATAL: kernel too old
|
||||||
|
....
|
||||||
|
|
||||||
|
because that kernel version is too old.
|
||||||
|
|
||||||
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:
|
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:
|
||||||
|
|
||||||
* `drm: Add component-aware simple encoder` allows you to see images through VNC: <<gem5-graphic-mode>>
|
* `drm: Add component-aware simple encoder` allows you to see images through VNC: <<gem5-graphic-mode>>
|
||||||
* `gem5: Add support for gem5's extended GIC mode` adds support for more than 8 cores: <<gem5-arm-more-than-8-cores>>
|
* `gem5: Add support for gem5's extended GIC mode` adds support for more than 8 cores: <<gem5-arm-more-than-8-cores>>
|
||||||
|
|
||||||
|
Tested on 649d06d6758cefd080d04dc47fd6a5a26a620874 + 1.
|
||||||
|
|
||||||
==== gem5 arm Linux kernel patches boot speedup
|
==== gem5 arm Linux kernel patches boot speedup
|
||||||
|
|
||||||
We have observed that with the kernel patches, boot is 2x faster, falling from 1m40s to 50s.
|
We have observed that with the kernel patches, boot is 2x faster, falling from 1m40s to 50s.
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ Run `make modules_install` after `make`.
|
|||||||
'gem5_defconfig'
|
'gem5_defconfig'
|
||||||
)
|
)
|
||||||
elif self.env['custom_config_file']:
|
elif self.env['custom_config_file']:
|
||||||
base_config_given = False
|
base_config_given = True
|
||||||
base_config_needs_copy = True
|
base_config_needs_copy = True
|
||||||
custom_config_file = self.env['custom_config_file']
|
custom_config_file = self.env['custom_config_file']
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# This file contains only configs which are required to boot all configurations and get a shell.
|
# https://github.com/cirosantilli/linux-kernel-module-cheat#linux-kernel-min-config
|
||||||
|
|
||||||
## gem5 x86
|
## gem5 x86
|
||||||
|
|
||||||
@@ -13,8 +13,6 @@ CONFIG_PCI=y
|
|||||||
|
|
||||||
## gem5 aarch64
|
## gem5 aarch64
|
||||||
|
|
||||||
# Minimal options required to run gem5 aarch64 in addition to QEMU's aarch64 setup.
|
|
||||||
# Doing such a minimal boot made the gem5 boot 3x faster on the P51, which is awesome.
|
|
||||||
CONFIG_ATA_PIIX=y
|
CONFIG_ATA_PIIX=y
|
||||||
CONFIG_PCI_HOST_GENERIC=y
|
CONFIG_PCI_HOST_GENERIC=y
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user