qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] CPU switch timing question


From: Tommy Huang
Subject: [Qemu-devel] CPU switch timing question
Date: Tue, 20 Oct 2009 20:12:30 -0700

Hi,

Suppose I use two cores, smp environment.
I am wondering when QEMU switches CPUs and the time when the interrupt is raised.
I've observed that every time cpu_interrupt is executed, there will be a cpu switch.
CPU switch means the current running vCPU will stop and the other vCPU will run, since QEMU runs on 1 physical CPU. (The term "CPU" I mention in the following is vCPU).
That means the CPU cannot handle the interrupt right after the interrupt is raised even the interrupt goes to it, but it needs to switch to the second CPU.
And next time when the CPU is switched again, it can start to handle the pending interrupt.
Is that right? Once the CPU executes cpu_interrupt function, is it forced to switch to anther CPU immediately? Or it can continues to run its TB before it consumes all its instructions counts.
A more general question is what triggers CPU switch? I know there is an upper bound for instruction counts (not 100% sure). What else?
Any information and guidance is very appreciated.
Thanks.

Regards,
Tommy


Your E-mail and More On-the-Go. Get Windows Live Hotmail Free. Sign up now.

reply via email to

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