aarch-64 emulation much slower since release 8.1.5 (issue also present on 8.2.1)
Host environment
-
Operating system: RockyLinux 8
-
OS/kernel version: 4.18.0-477.27.1.el8_8.x86_64 #1 SMP Wed Sep 20 15:55:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
-
Architecture: x86
-
QEMU flavor: qemu-aarch64
-
QEMU version: 8.1.5
-
QEMU command line:
qemu-system-aarch64 -M virt -m 2G -kernel <custom ARM based kernel> -cpu cortex-a72
Emulated/Virtualized environment
- Operating system: Linux
- OS/kernel version: Linux isam-reborn 5.4.268-rt87-Arm-Cortex_a72 #1 SMP PREEMPT Mon Oct 11 18:30:00 UTC 2021 aarch64 GNU/Linux
- Architecture: ARM
Description of problem
Since QEMU 8.1.5 our aarch64 based emulation got much slower. We use a linux 5.4 kernel which we cross-compile with the ARM toolchain. Things that are noticable:
- Boot time got a lot longer
- All memory accesses seem to take 3x longer (can be verified by e.g. executing below script, address does not matter):
date
for i in $(seq 0 1000); do
devmem 0x200000000 2>/dev/null
done
date
Steps to reproduce
Just boot an ARM based kernel on the virt machine and execute above script.
Additional information
I've tried reproducing the issue on the master branch. There the issue is not present. It only seems to be present on releases 8.1.5 and 8.2.1.
I've narrowed the problem down to following commit on the 8.2 branch (@bonzini): ef74024b accel/tcg: Revert mapping of PCREL translation block to multiple virtual addresses.
Let me know if any other information / tests are required.