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

Re: [Xen-devel] [PATCH 2/2] IOMMU/MMU: Adjust low level functions for VT-d Device-TLB flush error.



On March 29, 2016 3:37pm, Jan Beulich <JBeulich@xxxxxxxx> wrote:
> >>> On 25.03.16 at 10:27, <quan.xu@xxxxxxxxx> wrote:
> > On March 18, 2016 6:20pm, <JBeulich@xxxxxxxx> wrote:
> >> >>> On 17.03.16 at 07:54, <quan.xu@xxxxxxxxx> wrote:
> >> > --- a/xen/drivers/passthrough/iommu.c
> >> > +++ b/xen/drivers/passthrough/iommu.c
> >> > @@ -554,11 +555,24 @@ static void iommu_flush_all(void)
> >> >          iommu = drhd->iommu;
> >> >          iommu_flush_context_global(iommu, 0);
> >> >          flush_dev_iotlb = find_ats_dev_drhd(iommu) ? 1 : 0;
> >> > -        iommu_flush_iotlb_global(iommu, 0, flush_dev_iotlb);
> >> > +        rc = iommu_flush_iotlb_global(iommu, 0, flush_dev_iotlb);
> >> > +
> >> > +        if ( rc > 0 )
> >> > +        {
> >> > +            iommu_flush_write_buffer(iommu);
> >>
> >> Why is this needed all of the sudden?
> >
> > As there may be multiple IOMMUs. .e.g, there are 2 IOMMUs in my
> > machine, and I can find the following log message:
> > """
> > (XEN) Intel VT-d iommu 0 supported page sizes: 4kB, 2MB, 1GB.
> > (XEN) Intel VT-d iommu 1 supported page sizes: 4kB, 2MB, 1GB.
> > """
> > __iiuc__, iommu_flush_write_buffer() is per IOMMU, so It should be
> > called to flush every IOMMU.
> 
> For one what you say suggests that right now this is being done for some 
> (one?)
> IOMMU(s), which I don't see being the case. And then what you say _still_
> doesn't say _why_ this is now needed all of the sudden. If, in the course of
> doing your re-work here, you find pre-existing issues with the code, please 
> split
> the necessary fixes out of your re-work and submit them separately with proper
> explanations in their commit messages.
> 

I find out it is no need modification for this function.
I overlooked the parameter 'flush_non_present_entry', which is '0' to call 
iommu_flush_iotlb_global().
At the bottom of the call tree,
(Existing code)
>>
In flush->iotlb():
{
....
    if ( flush_non_present_entry )
    {
        if ( !cap_caching_mode(iommu->cap) )
            return 1;
        else
            did = 0;
    }

....
}
<<


it is impossible to return '1', which is used to indicate caller needs to flush 
cache.

Quan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.