Hi,
I was working with smp function in qemu. I am getting the APs to run a user level task. This is to check for synchronization issues. So i basically need all the CPUs to start executing task at the same to get a better simulation of concurrent threads.
So once the CPUs are started up I make them poll a certain flag. And then I thought I'll try out the broadcast IPI (to all but self). So i make the BSP send out an interrupt to all the CPUs. The interrupt handler sets the flag and the CPUs proceed to execute the task. On running this in Qemu I noticed that on each run i get a different results. sometimes all CPUs receive the interrupt, sometimes just a few and sometimes none.
I remember reading that it's not a good idea to try the broadcast IPI, because it is not reliable. I do understand the issues in hardware that could cause it. But why would it happen in an emulator? I was just curious and also a little worried as to whether there is something wrong in what I am doing. Hope someone can shed some light on this. Thanks.
David.
Broadcast IPIs in Qemu
Re: Broadcast IPIs in Qemu
Hi,
I've noticed this behaviour in Qemu also - I can't explain it. Asking qemu developers might be the best idea.
On a related note, I wouldn't rely on all CPUs starting your task at the same time - qemu is singlethreaded and its timeslices come in fairly randomly.
Cheers,
James
I've noticed this behaviour in Qemu also - I can't explain it. Asking qemu developers might be the best idea.
On a related note, I wouldn't rely on all CPUs starting your task at the same time - qemu is singlethreaded and its timeslices come in fairly randomly.
Cheers,
James
-
- Member
- Posts: 36
- Joined: Sat Jan 03, 2009 4:12 am
Re: Broadcast IPIs in Qemu
I had a feeling that Qemu was single threaded. Anyways, thanks for the info. Will try to send a bug report to the developers.