Broadcast IPIs in Qemu
Posted: Thu Apr 02, 2009 11:56 pm
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.
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.