[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2783078a-1cf6-58da-35a7-98f91afabcc4@amd.com>
Date: Wed, 24 Jan 2018 18:43:18 +0700
From: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
To: linux-kernel@...r.kernel.org, iommu@...ts.linux-foundation.org
Cc: joro@...tes.org, jroedel@...e.de, alex.williamson@...hat.com
Subject: Re: [RFC PATCH v2 2/2] iommu/amd: Add support for fast IOTLB flushing
Hi Joerg,
On 12/27/17 4:20 PM, Suravee Suthikulpanit wrote:
> Implement the newly added IOTLB flushing interface for AMD IOMMU.
>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@....com>
> ---
> drivers/iommu/amd_iommu.c | 73 ++++++++++++++++++++++++++++++++++++++++-
> drivers/iommu/amd_iommu_init.c | 7 ++++
> drivers/iommu/amd_iommu_types.h | 7 ++++
> 3 files changed, 86 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/iommu/amd_iommu.c b/drivers/iommu/amd_iommu.c
> index 7d5eb00..42fe365 100644
> --- a/drivers/iommu/amd_iommu.c
> +++ b/drivers/iommu/amd_iommu.c
> ...
> @@ -3163,6 +3168,69 @@ static bool amd_iommu_is_attach_deferred(struct iommu_domain *domain,
> return dev_data->defer_attach;
> }
>
> +static void amd_iommu_flush_iotlb_all(struct iommu_domain *domain)
> +{
> + struct protection_domain *dom = to_pdomain(domain);
> +
> + domain_flush_tlb_pde(dom);
> +}
I made a mistake here ...
> ...
> +static void amd_iommu_iotlb_sync(struct iommu_domain *domain)
> +{
> + struct protection_domain *pdom = to_pdomain(domain);
> + struct amd_iommu_flush_entries *entry, *next;
> + unsigned long flags;
> +
> + /* Note:
> + * Currently, IOMMU driver just flushes the whole IO/TLB for
> + * a given domain. So, just remove entries from the list here.
> + */
> + spin_lock_irqsave(&amd_iommu_flush_list_lock, flags);
> + list_for_each_entry_safe(entry, next, &amd_iommu_flush_list, list) {
> + list_del(&entry->list);
> + kfree(entry);
> + }
> + spin_unlock_irqrestore(&amd_iommu_flush_list_lock, flags);
> +
> + domain_flush_tlb_pde(pdom);
> +}
... and here where I should also call domain_flush_complete() after
domain_flush_tlb_pde(). I'll send out a new version (v3) as a separate patch
from the series.
Thanks,
Suravee
Powered by blists - more mailing lists