RE: [PATCH 2/6] iommu/vt-d: Move intel_drain_pasid_prq() into intel_pasid_tear_down_entry()

Tian, Kevin
2024-07-10T08:25:32Z

> From: Liu, Yi L <yi.l.liu@intel.com>
> Sent: Friday, June 28, 2024 6:52 PM
>
> On 2024/6/28 17:42, Baolu Lu wrote:
> > On 2024/6/28 16:55, Yi Liu wrote:
> >> Draining PRQ is needed before repurposing a PASID. It makes sense to
> invoke
> >> it in the intel_pasid_tear_down_entry().
> >
> > Can you please elaborate on the value of this merge?
> >
>
> The major reason is that the next patch would have multiple places that
> need to destroy pasid entry and do prq drain. Wrap them would make life
> easier I suppose.
>
> > Draining the PRQ is necessary when PRI is enabled on the device, and a
> > page table is about to be removed from the PASID. This might occur in
> > conjunction with tearing down a PASID entry, but it seems they are two
> > distinct actions.
>
> Seems like mostly they have conjunction, while there is indeed one
> exception in the intel_mm_release(). Given the above reason, do you have
> any suggestion for it?
>

If we really have such need please don't add more boolean fields.

Let's extend the existing one into a flag instead, for better readability.