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

Re: [Xen-devel] [PATCH 2/6] use is_iommu_enabled() where appropriate...

Hi Jan,

On 07/08/2019 10:55, Jan Beulich wrote:
On 30.07.2019 15:44, Paul Durrant wrote:
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -1531,8 +1531,7 @@ int p2m_init(struct domain *d)
       * shared with the CPU, Xen has to make sure that the PT changes have
       * reached the memory
-    p2m->clean_pte = iommu_enabled &&
-        !iommu_has_feature(d, IOMMU_FEAT_COHERENT_WALK);
+    p2m->clean_pte = !iommu_has_feature(d, IOMMU_FEAT_COHERENT_WALK);

I can't tell if the original code was meant to be this way, but I'm
afraid your transformation is not correct: The prior construct,
expanding iommu_has_feature(), was

The original code is meant to be this way. There are no need to clean the PTE on update unless you have one IOMMU that is not able to snoop the cache.

iommu_has_feature(...) will return false when the IOMMU is not in use. The iommu_enabled prevent to clean PTE on those setups.


Julien Grall

Xen-devel mailing list



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