qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Clock warping with -icount


From: Michael Eager
Subject: [Qemu-devel] Clock warping with -icount
Date: Wed, 3 Jan 2018 12:15:08 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

I'm trying to get -icount clock warping to work on an older QEMU source base. In my test case, all vCPUs are idle and there is an outstanding timer. What should happen (IMO) is that the qemu_icount value should be bumped to the timer value and then the timer callback should be called through qemu_notify_event(). This is not happening. qemu_icount does not get updated and the code loops forever waiting for this to happen.

In my version of cpus.c in qemu_clock_warp(), the code calls icount_warp_rt(), which does not update qemu_icount, since vm_clock_warp_start is -1. Subsequently, the pending timer is deleted, vm_clock_warp_start is set to the current qemu_icount value, compared with the timer deadline, and then the timer is recreated with the same deadline. (All of this looks like shuffling deck chairs on the Titanic. The new timer is exactly the same as the old timer and there is no change in the clocks.)

I've compared this with the current QEMU sources in cpus.c. Function names have changed and there are some other changes, but the code looks like it would do the same. It isn't clear to me when/where qemu_icount or qemu_icount_bias would be modified to warp the clock ahead.

Can someone explain what vm_clock_warp_start is supposed to mean?  The
warp_delta value is computed by subtracting this from the current clock, which doesn't make sense to me. IN qemu_start_warp_timer() it is set to the clock value.

Can someone offer me some clarifications on how warping the icount clock is done, or better yet send me (or tell me where to find) a working test case using QEMU and -icount which warps the icount timer when all vCPUs are idle?

Thanks in advance.

--
Michael Eager    address@hidden
1960 Park Blvd., Palo Alto, CA 94306



reply via email to

[Prev in Thread] Current Thread [Next in Thread]