On 15.02.22 10:30, Roger Pau Monné wrote:
> On Mon, Feb 14, 2022 at 02:00:26PM +0000, Oleksandr Andrushchenko wrote:
>> /*
>> * FIXME: apply_map is called from dom0 specific init code when
>> * system_state < SYS_STATE_active, so there is no race condition
>> * possible between this code and vpci_process_pending. So, neither
>> * vpci_process_pending may try to acquire the lock in read mode and
>> * also destroy pdev->vpci in its error path nor pdev may be disposed yet.
>> * This means that it is not required to check if the relevant pdev
>> * still exists after re-acquiring the lock.
> I'm not sure why you need to mention vpci_process_pending here:
> apply_map and defer_map are mutually exclusive, so given the current
> code it's impossible to get in a situation where apply_map is called
> while there's pending work on the vCPU (ie: v->vpci.mem != NULL).
>
> Also there's no need for a FIXME tag: the current approach doesn't
> require any fixes unless we start using apply_map in a different
> context.
>
> Hence I think the comment should be along the lines of:
>
> /*
>   * It's safe to drop and reacquire the lock in this context without
>   * risking pdev disappearing because devices cannot be removed until the
>   * initial domain has been started.
>   */
Urgh, I've just sent v2. I'll move this there and answer
>
> Thanks, Roger.
>
Thank you,
Oleksandr

Reply via email to