Re: Remove APIC lock

Dong, Eddie
2007-08-24T14:24:12Z

kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org wrote:
> Gregory Haskins wrote:
>> On Fri, 2007-08-24 at 21:08 +0800, Dong, Eddie wrote:
>>> Avi:
>>>
>>> apic->lock is used in many place to avoid race condition with
>>> apic timer call back function which may run on different pCPU.
>>> This patch migrate the apic timer to same CPU with the one VP
>>> runs on, thus the lock is no longer necessary.
>>>
>>
>> What about sources that can inject interrupts besides the timer?
>> (E.g. in-kernel PV drivers)
>
> Injecting IRQ is OK, since it is just operation to IRR
> register which we
> can
> use atomic operations. Xen also do in that way.
>
O, said too quick. Xen current has evolved to be protected by a
bigger irqlock for both APIC & IOAPIC, and PIC uses per chip lock.

For our case, PIC/IOAPIC now is using kvm->lock. So APIC is working
with kvm->lock too. But this lock may be too big for pv driver. We may
need to think of a solution to cover both APIC & IOAPIC in future.
Eddie