|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 18/21] xen/arm: p2m: Clean cache PT when the IOMMU doesn't support coherent walk
On Tue, 2014-04-22 at 14:14 +0100, Julien Grall wrote:
> Some IOMMU doesn't suppport coherent PT walk. When the p2m is shared with
> the CPU, Xen has to make sure the PT changes have reached the memory.
>
> Introduce new IOMMU callback that will retrieve the IOMMU feature for a
> specified domain.
>
> On ARM, the platform can contain multiple IOMMUs. Each of them may not
> have the same set of feature. The domain parameter will be used to get the
> set of features for IOMMUs used by this domain.
>
> Signed-off-by: Julien Grall <julien.grall@xxxxxxxxxx>
>
> ---
> Changes in v4:
> - Patch added
> ---
> xen/arch/arm/p2m.c | 24 ++++++++++++++++++------
> xen/drivers/passthrough/iommu.c | 11 +++++++++++
> xen/include/xen/iommu.h | 5 +++++
> 3 files changed, 34 insertions(+), 6 deletions(-)
>
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index 21219de..996d2bd 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -274,6 +274,18 @@ enum p2m_operation {
> CACHEFLUSH,
> };
>
> +static void unmap_coherent_domain_page(struct domain *d, const void *va)
> +{
> + /* Some IOMMU doesn't support coherent PT walk. When the p2m is
"don't support"
> + * shared with the CPU, Xen has to make sure that the PT changes have
> + * reached the memory
> + */
> + if ( need_iommu(d) && !iommu_has_feature(d, IOMMU_FEAT_COHERENT_WALK) )
> + clean_xen_dcache_va_range(va, PAGE_SIZE);
This is a fairly large hammer when you might only have touched a few
bytes, if any, in the page.
Wouldn't it be better to do this is write_pte, or just after the calls
to write_pte?
iommu_has_feature has a lot of callbacks -- worth calling once in
apply_p2m_changes?
Ian
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |