[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_io
From: |
Peter Xu |
Subject: |
Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier |
Date: |
Fri, 3 Jul 2020 09:03:38 -0400 |
On Fri, Jul 03, 2020 at 03:24:19PM +0800, Jason Wang wrote:
>
> On 2020/7/2 下午11:45, Peter Xu wrote:
> > On Thu, Jul 02, 2020 at 11:01:54AM +0800, Jason Wang wrote:
> > > So I think we agree that a new notifier is needed?
> > Good to me, or a new flag should be easier (IOMMU_NOTIFIER_DEV_IOTLB)?
>
>
> That should work but I wonder something as following is better.
>
> Instead of introducing new flags, how about carry the type of event in the
> notifier then the device (vhost) can choose the message it want to process
> like:
>
> static vhost_iommu_event(IOMMUNotifier *n, IOMMUTLBEvent *event)
>
> {
>
> switch (event->type) {
>
> case IOMMU_MAP:
> case IOMMU_UNMAP:
> case IOMMU_DEV_IOTLB_UNMAP:
> ...
>
> }
Looks ok to me, though imo we should still keep the registration information,
so VT-d knows which notifiers is interested in which events. E.g., we can
still do something like vtd_as_has_map_notifier().
So these are probably two different things: the new IOMMU_NOTIFIER_DEV_IOTLB
flag is one as discussed; the other one is whether we would like to introduce
IOMMUTLBEvent to include the type, so that we can avoid introduce two notifiers
for one device majorly to identify dev-iotlb from unmaps.
Thanks,
--
Peter Xu
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/07/01
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/07/01
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Peter Xu, 2020/07/02
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/07/03
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier,
Peter Xu <=
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/07/07
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Peter Xu, 2020/07/07
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/07/08
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Peter Xu, 2020/07/08
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/07/09
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Peter Xu, 2020/07/09
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/07/10
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Peter Xu, 2020/07/10
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Jason Wang, 2020/07/13
- Re: [RFC v2 1/1] memory: Delete assertion in memory_region_unregister_iommu_notifier, Peter Xu, 2020/07/15