On 13.10.2021 12:02, Bertrand Marquis wrote:
>> On 13 Oct 2021, at 07:10, Jan Beulich <jbeul...@suse.com> wrote:
>> On 12.10.2021 23:37, Stefano Stabellini wrote:
>>> Good point about MSIs not being setup before the traps. We should remove
>>> the call to pci_cleanup_msi() in the error path then.
>>
>> Your reply makes me fear you didn't pay enough attention to the "partial"
>> in my earlier reply. The traps for the various registers can't all be set
>> up atomically, so there may be a transient period where enough traps are
>> already in place for a cunning guest to arrange for setup. Unless, as
>> said, there are further setup steps needed before a guest could succeed
>> in doing so.
>>
>> But even if partial trap setup alone was sufficient, I think the cleaning
>> up of MSI then might still better go on the error path there than on that
>> of pci_add_device().
> 
> I think I should put the msi_cleanup in the exit path if pdev is not null but
> we got a non null ret (in an else if ( pdev ) ).
> This would cover all exit paths, especially as I will move the add_handler
> before the iommu init.
> 
> Would that be ok for everyone ?

Sounds reasonable at the first glance.

Jan


Reply via email to