If I try to use more than --num-cpus=8
cores, e.g. 16, 32 or 64, the terminal just stays blank.
Tested with gem5 at commit 2a9573f5942b5416fb0570cf5cb6cdecba733392 and Linux kernel 4.16.
Related thread: https://www.mail-archive.com/gem5-users@gem5.org/msg15469.html
If I add more to Ciro's answer, the current GICv2 model in gem5 supports single core by default because of this line of code. Without enabling gem5ExtensionsEnabled
, it won't update the highest_int
with the receiving interrupt number, and as a result the received interrupt won't get posted to a specified cpu to invoke a handler. That is, there is no jump to interrupt handler. In addition, even when we turn on gem5ExtensionsEnabled
, I think that it will support up to 4 cores because the default values of INT_BITS_MAX
and itLines
are 32 and 128, respectively (see this); it checks 32 interrupt lines per core across 4 cores. For example, imagine that a system features 16 cores and cpu 5 executes the loop. Also, suppose that the other core (say core 11) already has an interrupt with higher priority than this. Then, the loop will ignore the other interrupt from core 11 because the loop index x
can grow at most to 3.
To turn on gem5ExtensionsEnabled
, you can pass an option --param='system.realview.gic.gem5_extensions=True'
to your command as Ciro stated. However, note that the parameter is used to set haveGem5Extensions
variable at here, not setting gem5ExtensionsEnabled
, which is enabled only when a firmware code writes some data (0x200) to GIC distributor register at GICD_TYPER offset (see this).
As mentioned at: https://www.mail-archive.com/gem5-dev@gem5.org/msg24593.html you need to:
use the ARM linux kernel fork from: https://gem5.googlesource.com/arm/linux/+/refs/heads/gem5/v4.15 in particular the GICv2 extension script commit
for fs.py
add the options --param 'system.realview.gic.gem5_extensions = True' --generate-dtb
Tested on gem5 a5bc2291391b0497fdc60fdc960e07bcecebfb8f (Nov 2018) with Linux kernel v4.15, aarch64.