Re: [PATCH 2/3] KVM: Use kvm_free_assigned_irq() for free irq

Avi Kivity
2008-12-30T11:16:30Z

Sheng Yang wrote:
>> This will call cancel_work_sync(), which may wait upon kvm->lock, which
>> I think we hold here -> deadlock.
>>
>> I think that the current code has even bigger problems (races), since a
>> scheduled work can arrive after the interrupt has been freed and
>> reallocated.
>>
>
> For the race problem, how about put a cancel_work_sync() for all devices at
> the beginning of kvm_destroy_vm? Something named kvm_arch_cancel_work_sync...
>

There is no race at destroy time since the work_struct has a reference
on struct kvm. So destruction is only triggered after the last interrupt.

(but what if we get another interrupt immediately afterwards?!)

--
error compiling committee.c: too many arguments to function