On 14.12.2010, at 01:18, Scott Wood wrote:

> On Tue, 14 Dec 2010 00:54:38 +0100
> Alexander Graf <a...@csgraf.de> wrote:
> 
>> On 13.12.2010, at 20:03, Scott Wood wrote:
>>> [1] Speaking of which, what happens when an interrupt is raised in the
>>> middle of a paravirt critical section?  KVM will hold off the
>>> interrupt delivery if it sees the critical flag set, but when will it
>>> deliver the postponed interrupt?  Seems like it will wait until the next
>>> time an exit happens for some other reason.
>> 
>> mtmsr with IF=1 checks for pending interrupts and enables them with a real 
>> mtmsr then which again checks interrupts in vm entry, so it immediately gets 
>> injected :).
> 
> Right, but I'm not talking about an interrupt that happens when the
> virtual EE bit is zero.  I'm talking about an interrupt that happens
> right in the middle of the paravirt sequence -- after reading int_pending,
> but before setting critical to r2.
> 
> It seems like the race window is just narrowed, not eliminated.

Hrm, is that window really that important? There's usually plenty of interrupts 
and mmios coming through to always have some check going on.

If it really is important, we could also check int_pending right after the 
critical section and just do a nop exit. That way we worst case waste a few 
cycles for the useless guest exit, but always fetch interrupts immediately when 
they occur.


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to