Re: [Xen-devel] [PATCH] arm/acpi: Fix the deadlock
in function vgic_lock_rank()
On 2016年06月01日 18:49, Julien Grall wrote:
> Hi Stefano,
> On 01/06/16 10:54, Stefano Stabellini wrote:
>>> spin_is_locked does not work as you expect. The function will not
>>> tell you if
>>> the lock was taken by the current CPU, but if the lock was taken by
>>> *a* CPU.
>>> It would be possible to have CPU A calling this function and have CPU
>>> B with
>>> the lock taken. So the data structure would be accessed by 2 CPUs
>>> concurrently, which is unsafe.
>> Damn, you are right. I don't think we have a spin_lock function which
>> tells us if the spin_lock was taken by us.
> Unfortunately not.
>> The only other option I see would be duplicating route_irq_to_guest and
>> gic_route_irq_to_guest, introducing a second version of those functions
>> which assume that the rank lock was already taken. Very very ugly. I'll
>> just revert the commit and wait for better patches from Shannon.
> I am working on a patch series to decouple IRQ configuration and
> routing. It should be ready soon.
Thanks, Julien :)
Xen-devel mailing list