Hi, Further to my mail exchange with Victor I would like to ask you some help about time simulaion in Qemu when using SMP. Context:-----------I use Qemu on Windows, I am booting bare metal programs and I am trying to test embedded code, so I need more or lessrepeatable executions (and I do not need the time simulated in Qemu to be synchronised with the "realtime" (watch time)).As a consequence I use the "-icount" option. What I need:---------------- * Time synchronisation between emulated cores, at least with a given time granularity. * For example, I would nice if Qemu could ensure that **all** the cores will execute code between two timer events The two kind of solutions I imagine (if no one exists yet):-------------------------------------------------------------------------* The simplest (if possible): if Qemu is able to affect the scheduling of threads modelling the cores, it would be nice if the user could ask Qemu to ensure that every thread simulating a core will be executed at least every a given period of time.* If the above solution is not feasable, it will be probably necessary to add one *icount* (instruction counter) per core in order to avoid a core to discover than time has been running far further its next timer events while it was preempted by the host OS (because an other core has executed instructions and incremented *icount*). The problem would be then to synchronise this "instructions count" (representing time). This could be done adding synchronisation barriers between all the cores at each timer event. This would probably slow down Qemu but, once again, when coding for embedded boards, it is much preferable to have a consistent simulated time rather real time. Thank you very much in advance for your help. Best regards Francois PS: Could you please answer me on this mail address, I am just not able to deal with the hundreds of mails per day sent to the devel list ;)
> Date: Thu, 23 Jul 2015 11:49:58 +0200 > From: victor.clem...@openwide.fr > To: francois.guer...@hotmail.fr > Subject: Re: QEMU smp and time > > Hi, > > I cannot help you deal with it as I do not know this part of Qemu (SMP). > > I think you should ask your question to the mailing list, maybe with a > little more precision as I am not sure if I really get your goal. > I understand that you want to bind each virtual core with a host thread > then ask the host to schedule it in order to get the same amount of > execution time on each vcpu, is that right ? > I'm not sure that qemu can modify its host OS scheduling. > > Regards, > > Victor > > On Wed, Jul 22, 2015 at 05:48:24PM +0200, françois Guerret wrote: > > Hi, > > I am trying to maintain more or less the same simulated time (in timer > > tick) on each core of the a9mpcore target (i am booting in bare metal). > > Because of windows threads scheduling, i just cannot manage to do it, > > even using software active waiting barriers. > > Would you know a way to ask QEMU to ask the host OS to schedule the > > thread with a given period -- or even just to asleep a given thread > > (core) and execute an other one ? > > I imagine that either as a kind of hypervisor call which could be catch > > by QEMU in c code or as an option which could enable to design the > > scheduling of thread ... > > I hope I am clear enough > > Thank you in advance > > François