qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 2/3] memory: generalize iommu_ops.notify_star


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH v3 2/3] memory: generalize iommu_ops.notify_started to notifier_add
Date: Wed, 7 Sep 2016 12:54:23 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0


On 07/09/2016 08:05, David Gibson wrote:
> On Wed, Sep 07, 2016 at 01:32:23PM +0800, Peter Xu wrote:
>> Considering that we may have multiple IOMMU notifier consumers in the
>> future, converting iommu_ops.notify_{started|stopped} into some more
>> general form. Now we can trap all notifier registerations and
>> deregistrations, rather than only the first ones.
>>
>> Power was leveraging the notifier_{started|stopped}, adding iommu_user
>> field for counting on Power guests to achieve the same goal.
> 
> Requiring each vIOMMU frontend to reference count or whatever seems
> like a pain.  The semantics of notify_started() were designed to avoid
> that.
> 
> Instead I'd suggest a callback which gets tripped any time the logical
> OR of the requested notifications for all current notifiers changes.

I like the suggestion.  Alternatively you could call notify_stopped if
old & ~new is nonzero (and you pass old & ~new), and notify_started if
new & ~old is nonzero (and you pass new & ~old).

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]