]> xenbits.xensource.com Git - people/pauldu/xen.git/commitdiff
xen/arm: Rework p2m_cache_flush to take a range [begin, end)
authorJulien Grall <julien.grall@arm.com>
Wed, 21 Feb 2018 14:18:43 +0000 (14:18 +0000)
committerJulien Grall <julien.grall@arm.com>
Wed, 12 Dec 2018 16:07:22 +0000 (16:07 +0000)
The function will be easier to re-use in a follow-up patch if you have
only the begin and end.

At the same time, rename the function to reflect the change in the
prototype.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/domctl.c
xen/arch/arm/p2m.c
xen/include/asm-arm/p2m.h

index 4587c75826d153500235170931be51f9e84c73e6..c10f568aade3b0a57d57d3b911bce66e288ce218 100644 (file)
@@ -61,7 +61,7 @@ long arch_do_domctl(struct xen_domctl *domctl, struct domain *d,
         if ( e < s )
             return -EINVAL;
 
-        return p2m_cache_flush(d, _gfn(s), domctl->u.cacheflush.nr_pfns);
+        return p2m_cache_flush_range(d, _gfn(s), _gfn(e));
     }
     case XEN_DOMCTL_bind_pt_irq:
     {
index 2706db3e67555f139ac91a827f382fe7c9f6f0ab..836157292c0c870e765f821a2d5b92d4d947bc80 100644 (file)
@@ -1514,10 +1514,9 @@ int relinquish_p2m_mapping(struct domain *d)
     return rc;
 }
 
-int p2m_cache_flush(struct domain *d, gfn_t start, unsigned long nr)
+int p2m_cache_flush_range(struct domain *d, gfn_t start, gfn_t end)
 {
     struct p2m_domain *p2m = p2m_get_hostp2m(d);
-    gfn_t end = gfn_add(start, nr);
     gfn_t next_gfn;
     p2m_type_t t;
     unsigned int order;
index 13f7a27c382c8df2f5440e50ff53ea2b51f424dd..5858f97e9c2a1da00664b7f6aad3adb1a3f9a4cb 100644 (file)
@@ -228,8 +228,11 @@ int p2m_set_entry(struct p2m_domain *p2m,
 
 bool p2m_resolve_translation_fault(struct domain *d, gfn_t gfn);
 
-/* Clean & invalidate caches corresponding to a region of guest address space */
-int p2m_cache_flush(struct domain *d, gfn_t start, unsigned long nr);
+/*
+ * Clean & invalidate caches corresponding to a region [start,end) of guest
+ * address space.
+ */
+int p2m_cache_flush_range(struct domain *d, gfn_t start, gfn_t end);
 
 /*
  * Map a region in the guest p2m with a specific p2m type.