I'm trying to increase the speed at which qemu runs, so for example one tick of the real CPU will correspond to two ticks of the virtual time of qemu. Is this possible and if so does anyone have any pointers on how to go about doing this?
You can't do this. QEMU is not made for such thing.
QEMU does not simulate timing of execution. It doesn't know anything about CPU caches etc., so it can't be accurate even if it is desirable. It simply executes guest code, as fast as it can. No acceleration or deceleration.
At least do not seek solution this way.
There are qemu options which can alter the advance of time as seen by the guest.
The args I used (with qemu v4.2.0) are:
qemu-system-x86_64 -rtc base=localtime,clock=vm -icount shift=7,align=off,sleep=off ...
Note that icount is not compatible with hardware acceleration. Also note that a shift value too high may cause the guest OS to misbehave. For example, when I tried a value of 10, the linux kernel kept complaining of tasks stalled >120s.
Of possible interest: comments on https://github.com/zephyrproject-rtos/zephyr/issues/14173 and the linked issues/PRs.
Maybe you should give a look at tickpolicy
options from libvirt https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/Virtualization_Deployment_and_Administration_Guide/sect-Virtualization-Tips_and_tricks-Libvirt_Managed_Timers.html.
It's able to 'catchup' host time. The effect is that the guest seems accelerated.
The option is translated from libvirt to qemu as -rtc ,driftfix=slew
Note that it won't change how fast code will be executed.
© 2022 - 2024 — McMap. All rights reserved.