lkml.org 
[lkml]   [2019]   [Dec]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v3 5/6] iommu/vt-d: Flush PASID-based iotlb for iova over first level
Date
> From: Lu Baolu [mailto:baolu.lu@linux.intel.com]
> Sent: Tuesday, December 17, 2019 9:39 AM
> To: Liu, Yi L <yi.l.liu@intel.com>; Joerg Roedel <joro@8bytes.org>; David
> Woodhouse <dwmw2@infradead.org>; Alex Williamson
> <alex.williamson@redhat.com>
> Subject: Re: [PATCH v3 5/6] iommu/vt-d: Flush PASID-based iotlb for iova over first
> level
>
> Hi,
>
> On 12/17/19 9:37 AM, Lu Baolu wrote:
> > You are right. I will change it accordingly. The logic should look
> > like:
> >
> > if (domain attached to physical device)
> >     flush_piotlb_with_RID2PASID()
> > else if (domain_attached_to_mdev_device)
> >     flush_piotlb_with_default_pasid()
> >
>
> Both! so no "else" here.

aha, if we want to flush more precisely, we may check whether
domain->default_pasid is allocated. If not, it means no mdev is
involved, then we may save a p_iotlb_inv_dsc submission and also
save VT-d hardware circles from doing useless flush. This is just
optimization, it's up to you to pick it or not in this patchset. I'm
fine with flush "both" since it guarantees correctness.

Regards,
Yi Liu
\
 
 \ /
  Last update: 2019-12-17 03:45    [W:1.253 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site