qemu icon indicating copy to clipboard operation
qemu copied to clipboard

Timer Precision in QEMU

Open asifsid-32 opened this issue 4 years ago • 2 comments

Hello All,

We are triggering software generated interrupts in qnx OS running on top of QEMU 5.2.0 While doing the profiling of the Interrupts getting triggered and received we could see that the timings are not matching with the one's configured. The timer configured for 5ms shows the timing as 10ms consistently. When checked the same in target HW it works correctly and prints the timing as 5ms.

The command to boot QNX on top of qemu is -

qemu-system-aarch64 -M xlnx-zcu102 -m 8G -serial mon:stdio -display none -device loader,file=QNX-IFS.bin,cpu-num=0

What can be the possible reasons for this issue. Do we need to add additional qemu command line option while booting OS ?

Regards Asif Siddiqui

asifsid-32 avatar Jul 30 '21 05:07 asifsid-32

Hi,

QEMU has a lower limit on timers at 10us. Have a look at hw/core/ptimer.c.

But 5ms is well above that, my guess is that you may be seeing a limitation on your host? What timer device are you programing? The ARM generic timers?

Best regards, Edgar

edgarigl avatar Jul 30 '21 18:07 edgarigl

Hi Edgar,

Yes we were seeing a limitation on our host which was then changed with better configuration system. Still we can see a mismatch between the configured timing and the Interrupt triggering timing.

The Timer being used is QNX specific. Link - http://www.qnx.com/developers/docs/6.5.0/index.jsp?topic=%2Fcom.qnx.doc.neutrino_lib_ref%2Fc%2Fclock_gettime.html

Can you please suggest what can be the possible reasons for this issue ? Is there something on QEMU configuration we can add to avoid this system configuration issue

Best Regards Asif

asifsid-32 avatar Aug 02 '21 05:08 asifsid-32