[Xen-devel,RFC,13/16] xen/arm: p2m: Allow to flush cache on any RAM region

Message ID 20181008183352.16291-14-julien.grall@arm.com
State Accepted
Commit cd851472876ded5b5d10f83a29988f4d2302adea
Headers show
Series
  • xen/arm: Implement Set/Way operations
Related show

Commit Message

Julien Grall Oct. 8, 2018, 6:33 p.m.
Currently, we only allow to flush cache on region mapped as p2m_ram_{rw,ro}.

There are no real problem to flush cache on any RAM region such as grants
and foreign mapping. Therefore, relax the cache to allow flushing the
cache on any RAM region.

Signed-off-by: Julien Grall <julien.grall@arm.com>
---
 xen/arch/arm/p2m.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Stabellini Nov. 2, 2018, 11:40 p.m. | #1
On Mon, 8 Oct 2018, Julien Grall wrote:
> Currently, we only allow to flush cache on region mapped as p2m_ram_{rw,ro}.
                                             ^ regions

> There are no real problem to flush cache on any RAM region such as grants
                    ^ problems in cache flushing any RAM regions


> and foreign mapping. Therefore, relax the cache to allow flushing the
                                            ^ check


> cache on any RAM region.
> 
> Signed-off-by: Julien Grall <julien.grall@arm.com>

Aside from grammar:

Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>

> ---
>  xen/arch/arm/p2m.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
> index 8537b7bab1..12b459924b 100644
> --- a/xen/arch/arm/p2m.c
> +++ b/xen/arch/arm/p2m.c
> @@ -1532,7 +1532,7 @@ int p2m_cache_flush_range(struct domain *d, gfn_t start, gfn_t end)
>          next_gfn = gfn_next_boundary(start, order);
>  
>          /* Skip hole and non-RAM page */
> -        if ( mfn_eq(mfn, INVALID_MFN) || !p2m_is_ram(t) )
> +        if ( mfn_eq(mfn, INVALID_MFN) || !p2m_is_any_ram(t) )
>              continue;
>  
>          /* XXX: Implement preemption */
> -- 
> 2.11.0
>

Patch

diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c
index 8537b7bab1..12b459924b 100644
--- a/xen/arch/arm/p2m.c
+++ b/xen/arch/arm/p2m.c
@@ -1532,7 +1532,7 @@  int p2m_cache_flush_range(struct domain *d, gfn_t start, gfn_t end)
         next_gfn = gfn_next_boundary(start, order);
 
         /* Skip hole and non-RAM page */
-        if ( mfn_eq(mfn, INVALID_MFN) || !p2m_is_ram(t) )
+        if ( mfn_eq(mfn, INVALID_MFN) || !p2m_is_any_ram(t) )
             continue;
 
         /* XXX: Implement preemption */